Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Azure Pipeline task to call Azure REST API
- powershell: |
$subscriptionID = ''
$location = 'Japan%20East'
$method = "GET"
$apiurl = ""+$subscriptionID+"/providers/Microsoft.Compute/locations/"+ $location +"/runCommands?api-version=2017-03-30"
$authHeader = "Bearer " + $azuretoken
$requestHeader = @{
"Authorization" = $authHeader
"Accept" = "application/json"
$contentType = "application/json;charset=utf-8"
$apires = Invoke-WebRequest -Uri $apiurl -Method $method -Headers $requestHeader -ContentType $contentType
#Display the responce body
displayName: 'PowerShell Script'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment