Created
May 15, 2020 15:57
-
-
Save TomaszOledzki/f9365dead78227089798ac2797b4c90e to your computer and use it in GitHub Desktop.
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
$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