question

AvireniUpendar-3214 avatar image
0 Votes"
AvireniUpendar-3214 asked deherman-MSFT answered

How do I Download Blob file from an Azure blob Storage using azure runbook and move it sharepath location

Hi Team,
My requirement is to write Azure Powershell Runbooks on below 2 things

1) export SQL query output to csv file and store in Azure blob.

2) download the saved csv from azure blob storage and move it to our company sharedpath location.

I'm good with point(1) and completed successfully. While I'm looking for references of Azure Powershell Runbook script to download azure blob storage and move it to our company sharedpath location.

Request you to provide some references on this please.

Thanks,
Upendar

azure-blob-storage
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

deherman-MSFT avatar image
0 Votes"
deherman-MSFT answered

@AvireniUpendar-3214
You can find some samples on this quickstart page which might be helpful to you. See if this script works for you:

 $resourceGroup = "myRG"
 $storageAccountName = "AccountName"
 $containerName = "listtestblobs"
    
 $storageAccount = Get-AzStorageAccount `
   -ResourceGroupName $resourceGroup `
   -Name $storageAccountName
 $ctx = $storageAccount.Context 
    
 Get-AzStorageBlobContent -Blob "Image001.jpg" `
   -Container $containerName `
   -Destination "D:\_TestImages\Downloads\" `
   -Context $ctx 

Hope this helps. Let us know if you have further questions or issues.



Please don’t forget to "Accept the answer" and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.



5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.