Created
August 15, 2022 15:47
-
-
Save magohl/a2fa5c5c141ef76d660abb9a2f4f2ad4 to your computer and use it in GitHub Desktop.
Fetch OAuth token using Managed Identity from Azure App Service
This file contains hidden or 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
$ProgressPreference = "SilentlyContinue" | |
$tokenResponse = Invoke-WebRequest -UseBasicParsing -Headers @{"X-IDENTITY-HEADER"=$env:IDENTITY_HEADER} -Uri "$($env:IDENTITY_ENDPOINT)?resource=https://storage.azure.com/&api-version=2019-08-01" | |
$tokenResponse.RawContent |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment