Unable to read csv frile from storage account

Pradeep MISHRA 31 Reputation points
2020-06-22T14:34:57.04+00:00

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.

Login-AzureRmAccount

$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,667 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,416 questions
0 comments No comments
{count} votes

Accepted answer
  1. Manu Philip 16,961 Reputation points MVP
    2020-06-22T15:55:24.497+00:00

    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

    Regards,

    Manu


0 additional answers

Sort by: Most helpful