I would like to save JSON files from an API call directly to Blob Storage rather than saving the files to local folder and transferring it to Blob Storage.
My code below calls an API and then saves it to a local folder. Is it possible to save it directly to Blob Storage via PowerShell
$logPath = 'C:\Dev\Template\Test'
$access_token ="Access_Token"
$URI = "https://XXXXX"
$headers = @{“authorization” = “Bearer $access_token”}
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$result = Invoke-RestMethod -Uri $URI -Headers $headers -ContentType $ContentType |ConvertTo-Json
$Result|ConvertFrom-Json| Select -ExpandProperty Forms| Out-File "$logPath\$report_iu.json"
D:\FIle\Microsoft.WindowsAzure.Storage.dll
is mean intall your Storage package in your local, so you could use Storage property. And after running the code as below, you could generate json file straight in blob. – Joey Cai Oct 10 at 1:19