我无法删除Azure blob,因为它上面有无限租约.我现在试图使用BreakLease()方法打破该租约.
以下是我在PowerShell中执行的命令:
$StorageAccountName = "storage account name"
$ContainerName = "container name"
$BlobName = "blob name
[Reflection.Assembly]::LoadFile("C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement\Azure\Azure.Storage\Microsoft.WindowsAzure.Storage.dll")
$Keys = Get-AzureStorageKey -StorageAccountName $StorageAccountName
$StorageAccountKey = $Keys[0].Primary
$Creds = New-Object Microsoft.WindowsAzure.Storage.Auth.StorageCredentials($StorageAccountName,$StorageAccountKey)
$CloudStorageAccount = New-Object Microsoft.WindowsAzure.Storage.CloudStorageAccount($Creds, $true)
$CloudBlobClient = $CloudStorageAccount.CreateCloudBlobClient()
$BlobContainer = $CloudBlobClient.GetContainerReference($ContainerName)
$Blob = $BlobContainer.ListBlobs() | Where{$_.Name -eq $BlobName}
$Blob.Properties
$Blob.BreakLease($(New-TimeSpan), $null, $null, $null)
Run Code Online (Sandbox Code Playgroud)
blob属性输出是:
CacheControl :
ContentDisposition :
ContentEncoding :
ContentLanguage :
Length : 1098437886464
ContentMD5 :
ContentType : application/octet-stream
ETag : "0x8D33831477A9F90"
LastModified : 2/18/2016 7:01:09 AM …Run Code Online (Sandbox Code Playgroud) 过去,我会通过运行以下命令来注册应用程序的 SSL 证书:
netsh http add sslcert ipport=1.2.3.4:443 certhash=a4e9de3a1610ec4eae82fa81444061b8 appid={8792bd09737f8b48991bfce5c15f3700}
其中“appid”GUID 来自 AssemblyInfo.cs 中的“程序集:Guid”属性。但是对于新的.Net Core应用程序,没有AssemblyInfo.cs,那么我从哪里获取这个appid呢?