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
# Script variables. | |
$functionAppId = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{functionAppName}'; | |
$functionAppKey = @{ | |
Name = 'ApiKey' | |
Value = '<my-secret-api-key>' | |
}; | |
$headers = @{Authorization = ("Bearer {0}" -f $(GetToken))}; | |
$body = @{Properties = $functionAppKey} | ConvertTo-Json; |
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
Function GetToken { | |
Try { | |
Write-Verbose "START: Function GetToken"; | |
$azProfile = [Microsoft.Azure.Commands.Common.Authentication.Abstractions.AzureRmProfileProvider]::Instance.Profile; | |
if(-not $azProfile.Accounts.Count) { | |
Write-Error "Ensure you have logged in before calling this Function."; | |
Exit; | |
} |
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"; |
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
{ | |
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
"serviceBus": { | |
"defaultValue": { | |
"location": "uksouth", | |
"name": "myNewSB1", | |
"skuCapacity": 1, | |
"skuName": "Standard", |
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
{ | |
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
"serviceBusTopics": { | |
"defaultValue": [ | |
{ | |
"name": "topic1", | |
"subscriptions": [ | |
"topic1-sub1", |