Skip to content

Instantly share code, notes, and snippets.

@justinyoo
Last active December 15, 2017 04:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justinyoo/231c595c411791fc4aba4da3a9e01c68 to your computer and use it in GitHub Desktop.
Save justinyoo/231c595c411791fc4aba4da3a9e01c68 to your computer and use it in GitHub Desktop.
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