Write https request to azure blobstorage

  • Hi All,

    I have been trying to download a csv file which is produced by calling an api and then to store the csv file directly in azure blob storage. I am able to download the file on my local machine and then copy it to azure blob storage. But I would like to copy the file directly in azure blob storage due to that this powershell code will be running on azure data factory via azure batch services. When I try this change of code given below to directly download the file in blob storage, I get an error "Can't find a drive, DriveNotFound exception".  I am unable to understand the issue. Can someone please help me here?  I have also attached the screenshot of the complete script.

    $reportlink = Invoke-WebRequest -Uri ($output.Headers.Location) -Headers @{Authorization = "Bearer $accessToken"} -UseBasicParsing

    $originalData = Invoke-WebRequest -Uri (($reportlink.Content | ConvertFrom-Json).Manifest.blobs.blobLink) -UseBasicParsing

    Set-AzStorageBlobContent -File $originalData -Container $ContainerName -Blob $OutputFileName -Context (New-AzStorageContext -StorageAccountName $AzureStorageAccountName -StorageAccountKey $AzureStorageAccountKey)

     

    Regards,

    Prakash

    Attachments:
    You must be logged in to view attached files.

    Thanks,
    Charmer

  • Thanks for posting your issue and hopefully someone will answer soon.

    This is an automated bump to increase visibility of your question.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply