I am trying to connect to Azure Machine Learning Web service using Invoke-WebRequest in PowerShell. after bellow command I will get an error that "Request is unauthorized to access
resource.":
Invoke-WebRequest -Uri $Url -Method POST -Body $body
As I know, you can connect to a Machine Learning Web service using any programming language that supports HTTP request and response. read more about it here.
Seems I need to pass API Key with my request. I have tried this two types of command, but the error was same:
Invoke-WebRequest -Uri $Url -Method POST -Body $body -Headers @{'apikey' = $API_key}
and
Invoke-WebRequest -Uri $Url -Method POST -Body $body -Header @{ "X-ApiKey" = $API_key }
Can you please guide me how I can pass API Key to the Azure Machine Learning Web service using PowerShell?
-Headers @{ Authorization = "Bearer " + $apiKey }- Maximilian Burszley