Static-web-apps: Can't add AzureWebJobsSendGridApiKey to Application Settings

Created on 28 Jun 2020  路  4Comments  路  Source: Azure/static-web-apps

Looks like you can't have a setting named AzureWebJobsSendGridApiKey. When I try to add it and then hit save, the key will be shown briefly but will then disappear. My function cannot seem to read it using process.env either.

Functions

Most helpful comment

Sorry for the delay. Here are all the settings that are currently blocked(starts with).

We will do a better job at conveying this message in coming iterations via portal messages and exceptions.

^APPSETTING_,^AZUREBLOBSTORAGE_,^AZUREFILESSTORAGE_,^AZURE_FUNCTION_,^CONTAINER_,^DIAGNOSTICS_,^DOCKER_,^FUNCTIONS_,^IDENTITY_,^MACHINEKEY_,^MAINSITE_,^MSDEPLOY_,^SCMSITE_,^SCM_,^WEBSITES_,^WEBSITE_,^WEBSOCKET_,^AzureWeb

All 4 comments

Looks like some app settings are being blocked. @anganti is the block list published somewhere? Sounds like AzureWebJobsSendGridApiKey shouldn鈥檛 be blocked.

@trevorkennedy As a workaround, try setting the apiKey property on the binding to another configuration setting name. https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-sendgrid#configuration

It looks like any App Settings prefixed with e.g. "AzureWebJobs" are being blocked. I created a table binding in a function with the connection set to "AzureWebJobsStorage", which was being set in my local.settings.json file. It all worked fine locally, but when it was deployed to Azure the function kept returning a http 500.

I had added the AzureWebJobsStorage setting to my App Settings, so I couldn't figure out why. It was only when I went to double check it that I noticed the App Setting wasn't there. I added it again through the Portal, saved, then refreshed, and it disappeared again. After seeing this issue, I tried creating one with a different name, and that one saved and persisted. So I have it working now!

Sorry for the delay. Here are all the settings that are currently blocked(starts with).

We will do a better job at conveying this message in coming iterations via portal messages and exceptions.

^APPSETTING_,^AZUREBLOBSTORAGE_,^AZUREFILESSTORAGE_,^AZURE_FUNCTION_,^CONTAINER_,^DIAGNOSTICS_,^DOCKER_,^FUNCTIONS_,^IDENTITY_,^MACHINEKEY_,^MAINSITE_,^MSDEPLOY_,^SCMSITE_,^SCM_,^WEBSITES_,^WEBSITE_,^WEBSOCKET_,^AzureWeb

Closing this. We can track the better error handling with #78

Was this page helpful?
0 / 5 - 0 ratings