Azure automation runbook unable to write csv output to Azure blob

Akash Gupta 1 Reputation point
2022-08-02T19:44:50.623+00:00

I am running azure automation runbook and writing data into csv.
When I try to save the csv to Azure blob, I'm getting below error:

The remote name could not be resolved:'azuretest.blob.core.windows.net.blob.core.windows.net'

The code looks like this:

Get key to storage account

$acctKey = (Get-AzStorageAccountKey -ResourceGroupName "Usage" -Name "reportsusagestorage").Value[0]

Map to the reports BLOB context

$storageContext = New-AzureStorageContext -StorageAccountName "Usage" -StorageAccountKey $acctKey

Copy the file to the storage account

Set-AzureStorageBlobContent -File OutputCSV.csv -Container "usagecontainer" -BlobType "Block" -Context $storageContext -Verbose

Any help would be appreicated

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,789 questions
Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,240 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.