Created
December 3, 2018 11:26
-
-
Save Zazcallabah/6528d4bf579e8cd017d4375d3e96fb25 to your computer and use it in GitHub Desktop.
Azure Service Principal Login
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$uri = "https://login.microsoftonline.com/$($tenant)/oauth2/token" | |
$data = @{ | |
"resource"="https://management.core.windows.net/"; | |
"client_id"=$servicePrincipalGuid; | |
"client_secret"=$secret; | |
"grant_type"="client_credentials"; | |
} | |
return Invoke-WebRequest -Method POST -Uri $uri -Headers $headers -Body $data | ConvertFrom-Json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment