Skip to content

Instantly share code, notes, and snippets.

@TomaszOledzki
Created May 15, 2020 15:57
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 TomaszOledzki/f9365dead78227089798ac2797b4c90e to your computer and use it in GitHub Desktop.
Save TomaszOledzki/f9365dead78227089798ac2797b4c90e to your computer and use it in GitHub Desktop.
$authToken = <jwtToken> # JWTToken do Azure Resource Manager
$appName = <FunctionAppName> # Nazwa twojego FunctionAppa
$appKeyName = <appKeyName> # Nazwa App Key, któty chcesz usunąć/odwołać (revoke)
# Uwierzytelnienie do Kudu (zamiast przez ARM, można też zrobić credsy do Kudu)
$authToken = Invoke-RestMethod -Method GET -Headers @{Authorization = ("Bearer {0}" -f $authToken)} -Uri "https://$appName.scm.azurewebsites.net/api/functions/admin/token";
# Usunięcie App Key
Invoke-RestMethod -Method DELETE -Headers @{Authorization = ("Bearer {0}" -f $authToken)} -Uri "https://$appName.azurewebsites.net/admin/host/keys/$appKeyName";
# Bonus: listing wszystkich App Key na Function App
(Invoke-RestMethod -Method GET -Headers @{Authorization = ("Bearer {0}" -f $authToken)} -Uri "https://$appName.azurewebsites.net/admin/host/keys").Keys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment