我正在尝试使用Powershell和Azure CLI获取Azureure V2密钥,下面是代码。我遇到错误:
未找到({“错误”:{“代码”:“未找到”,“消息”:“错误检索功能键。”}})
如果不将AzureWebJobsSecretStorageType应用设置设置为'files',似乎不可能获得Azure Function V2的密钥。
https://github.com/Azure/azure-functions-host/wiki/Changes-to-Key-Management-in-Functions-V2
我发现的唯一有用的文章是:
https://markheath.net/post/managing-azure-functions-keys-2
根据https://github.com/Azure/azure-functions-host/issues/3994,它应该可以工作。
我想念什么吗?
$webAppName = 'XXX'
$resourceGroup = 'YYY'
$subscriptionId = 'ZZZ'
$resourceId = "/subscriptions/$subscriptionId/resourceGroups/$resourceGroup/providers/microsoft.Web/sites/$webAppName"
az rest --method post --uri "https://management.azure.com$resourceId/functions/$webAppName/listKeys?api-version=2018-02-01"