Hi,
I've tried to get an azure function app up and running with deployment slots using bicep templates. The template can create all the resources but I'm having a hard time to get the switch to work, there seem to be some issues with the environment variables.
According to documentation the variable WEBSITE_CONTENTSHARE (https://learn.microsoft.com/en-us/azure/azure-functions/functions-app-settings#website_contentshare) should be omitted when deploying through arm(bicep) templates. It is said to be generated. This is important since it cannot have the same value as the staging slot later. I want to ommitt this environment variable.
I can deploy everything without WEBSITE_CONTENTSHARE and WEBSITE_CONTENTAZUREFILECONNECTIONSTRING (https://learn.microsoft.com/en-us/azure/azure-functions/functions-app-settings#website_contentazurefileconnectionstring), but I get warnings in the portal that storage is not configured correctly.
Checking that page, I see what are required parameters, and I have AzureWebJobsStorage defined.
If I try to add WEBSITE_CONTENTAZUREFILECONNECTIONSTRING, deploy complains that I'm missing required parameter WEBSITE_CONTENTSHARE. But that one I cannot define since it would lead to errors when switching production and staging slots (I've tried). Are there any other environment variables I need to specify? Some older posts and blogs have solved the issue by making the WEBSITE_CONTENTSHARE a deployment slot setting, but that is blocked now. I'm unsure what the problem is here with the function? As a side not, the API works, so as the warning states, I'm worried about scaling.
If I add both the variables WEBSITE_CONTENTAZUREFILECONNECTIONSTRING and WEBSITE_CONTENTSHARE I don't get any warnings, but I cannot use deployment slots. What to do, anyone have any ideas?