I have a function app and I just created a slot called development
. When I try to deploy code to the slot with:
func azure functionapp publish <function app name> --slot development
I get the following output and error:
Removing WEBSITE_CONTENTAZUREFILECONNECTIONSTRING app setting.
Removing WEBSITE_CONTENTSHARE app setting.
Error when removing app settings: {"Code":"InternalServerError","Message":null,"Target":null,"Details":[{"Message":null},{"Code":"InternalServerError"},{"ErrorEntity":{"Code":"InternalServerError","Message":null}}],"Innererror":null}.
I tried deleting and recreating the slot with a different name but it did not work.
I am using the latest az
and Azure Functions Core Tools
cli versions
I am afraid deleting the environment variables myself in case they affect production. [ref]
1
I created a sample function and added a slot. I encountered the same error when I tried to publish the function to the slot.
- To fix the error, we need to delete the
WEBSITE_CONTENTAZUREFILECONNECTIONSTRING
andWEBSITE_CONTENTSHARE
settings in the slot, but we can’t directly delete them in the slot.
So, I deleted those settings in the main Function app as shown below.
Then, I swapped the Target slot changes
with the Source slot changes
.
So that the WEBSITE_CONTENTAZUREFILECONNECTIONSTRING
and WEBSITE_CONTENTSHARE
values are not present in the development
slot.
And those will be swapped into the main function app’s environment variables.
After swapping, the WEBSITE_CONTENTAZUREFILECONNECTIONSTRING
and WEBSITE_CONTENTSHARE
values will not be present in the target slot
After making all the above changes, I have successfully deployed a sample HTTP trigger function in Python to the development slot.
func azure functionapp publish kamfuncappslot --slot development
development slot :
I successfully got the function in the development slot.