Get Azure storage blob url after uploading powershell
Retrieve blob information using the Get-AzureStorageBlob cmdlet and select the AbsoluteUri
:
(Get-AzureStorageBlob -blob 'StarterSite.zip' -Container 'clouddata ').ICloudBlob.uri.AbsoluteUri
Another option: just capture the result of Set-AzureStorageBlobContent
$result = Set-AzureStorageBlobContent -File C:\Package\StarterSite.zip$blobUri = $result.ICloudBlob.Uri.AbsoluteUri
It's not necessary to call Get-AzureStorageBlob
after calling Set-AzureStorageBlobContent
.
Set-AzureStorageBlobContent
returns the same object type that Get-AzureStorageBlob
returns.
More details
The output type is AzureStorageBlob
for both Get-AzureStorageBlob
and Set-AzureStorageBlobContent
AzureStorageBlob
has a ICloudBlob property
AzureStorageBlob.ICloudBlob
getter returns a CloudBlob
which has the Uri
property