Hi, I am trying to import json payload from a REST api GET method and save json documents into ADLS Gen2 using azure databricks.
GET: https://myapi.com/api/v1/city
GET method Output:
[
{"id":2643743,
"name":"London"},
{"id":2643744,
"name":"Manchester"}
]
Powershell:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$username = "user"
$password = "password"
$params = @{uri = 'https://myapi.com/api/v1/city';
Method = 'Get';
Headers = @{Authorization = 'Basic ' + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes("$($username):$($password)"));
} #end headers hash table
} #end $params hash table
$var = invoke-restmethod @params -ContentType "application/json".Content | ConvertTo-Json
Now, I'm stuck with how to save json document in Azure Data Lake Storage Gen2. Please guide me.
Thank you.
