Unable to read csv frile from storage account

Pradeep MISHRA 31 Reputation points

I have created one storage and upload csv file and now i am creating azure runbook and read file from storage account but getting the error message.


$File = $PWD.Path+'\Startvm.csv'

Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
2,913 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,616 questions
0 comments No comments
{count} votes

Accepted answer
  1. Manu Philip 17,351 Reputation points MVP

    Hello @PradeepMISHRA-2350 ,

    Please check the code you use in Runbook:
    It should be matching as follows:

    $StorageAccountKey = Get-AutomationVariable -Name 'your storageKey'
    $Context = New-AzureStorageContext -StorageAccountName 'your-storage' -StorageAccountKey $StorageAccountKey Get-AzureStorageFileContent -ShareName 'your-share' -Context $Context
    -path 'your-file' -Destination 'C:\Temp'

    $filePath = Join-Path -Path 'C:\Temp' -ChildPath 'your-file'

    Please mark as "Accept the answer" if the above steps helps you. Others with similar issues can also follow the solution as per your suggestion



0 additional answers

Sort by: Most helpful