Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Dynamic Access to Azure Functions Host Keys without KUDU
# NOTE: This is NOT a real tenant Id, subscription Id, client Id nor client secret. Use yours.
$tenantId = "32a489b1-612c-4d44-b4dd-714376ac7479"
$subscriptionId = "4ba9940b-0057-4184-9965-eb686c3027bc"
$clientId = "310c7137-af66-4bb1-ac76-c4cb4fcbe4e1"
$clientSecret = "QMvihWUWlRuPs3nNjxxzR/rULyKOAibRBkWDsbokzqw="
$authUri = "https://login.microsoftonline.com/$tenantId/oauth2/token?api-version=1.0"
$resourceUri = "https://management.core.windows.net/"
$authRequestBody = @{}
$authRequestBody.grant_type = "client_credentials"
$authRequestBody.resource = $resourceUri
$authRequestBody.client_id = $clientId
$authRequestBody.client_secret = $clientSecret
$auth = Invoke-RestMethod -Uri $authUri -Method Post -Body $authRequestBody
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment