I am trying to get azure function V2 key by using Powershell and Azure CLI, below is code. I am getting error:
Not Found({"error":{"code":"NotFound","message":"Error retrieving function keys."}})
It seems like it is not possible to get keys of Azure Function V2 without setting the AzureWebJobsSecretStorageType app setting to 'files'.
https://github.com/Azure/azure-functions-host/wiki/Changes-to-Key-Management-in-Functions-V2
The only helpful article I found is this:
https://markheath.net/post/managing-azure-functions-keys-2
According to https://github.com/Azure/azure-functions-host/issues/3994 it should work.
Am I missing something?
$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"