We have a bot endpoint implemented as an Azure function and it's running fine within Azure.
We've followed this process to enable us to run/debug the Azure Function locally: https://learn.microsoft.com/en-us/azure/azure-functions/functions-run-local
In particular, the following PowerShell command:
func azure functionapp fetch-app-settings <FunctionAppName>
It appears to run fine and put the necessary settings into local.settings.json, which is output to bin when the project is built. However, when we start the function (Right click project - Debug - Start new instance) it gives this error:
Failed to decrypt settings. Encrypted settings only be edited through 'func settings add'.
On two machines we are getting the above decryption error, on two machines it is running fine.
Any suggestions?
P.S. We are not trying to share the same local.settings.json file between machines, which I understand would also yield this sort of error.
UPDATE
Here is the content of the local.settings.json file from a problem machine, with encrypted values removed:
{
"IsEncrypted": true,
"Values": {
"AzureWebJobsStorage": "[encrypted content]",
"AzureWebJobsDashboard": "[encrypted content]",
"FUNCTIONS_EXTENSION_VERSION": "[encrypted content]",
"WEBSITE_CONTENTAZUREFILECONNECTIONSTRING": "[encrypted content]",
"WEBSITE_CONTENTSHARE": "[encrypted content]",
"WEBSITE_NODE_DEFAULT_VERSION": "[encrypted content]",
"BotEnv": "[encrypted content]",
"BotId": "[encrypted content]",
"MicrosoftAppId": "[encrypted content]",
"MicrosoftAppPassword": "[encrypted content]",
"BotStateEndpoint": "[encrypted content]",
"BotOpenIdMetadata": "[encrypted content]",
"UseTableStorageForConversationState": "[encrypted content]",
"BotDevAppInsightsKey": "[encrypted content]",
"BotDevAppInsightsName": "[encrypted content]",
"BotDevAppInsightsAppId": "[encrypted content]",
"AzureWebJobsBotFrameworkDirectLineSecret": "[encrypted content]",
"AzureWebJobsBotFrameworkDirectLineEndpoint": "[encrypted content]",
"WEBSITE_USE_PLACEHOLDER": "[encrypted content]",
"APPINSIGHTS_INSTRUMENTATIONKEY": "[encrypted content]",
"MSDEPLOY_RENAME_LOCKED_FILES": "[encrypted content]"
},
"ConnectionStrings": {}
}
Change the falue of IsEncrypted as follows :
"IsEncrypted": false,
in
local.settings.json
I had exactly the same problems:
After doing :
func azure functionapp fetch-app-settings
I got only encrypted function settings in local.settings.file
. Debugging with func stettings list
and looking at func settings list --help
revealed that i can do:
func settings decrypt
and worked!
EDIT:
Just coming back some months later. Using the explicit "IsEncrypted": false
in function.json works for me now as well, however it may be better to use func settings decrypt
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With