Paugh
Paugh

Reputation: 115

Custom function runs in staging deployment slot, but fails in production slot

I have an Azure environment that was running under an outdated .NET version. I've updated my Function project accordingly, published to a staging deployment slot, and accepted the Azure notification asking if the destination could be updated to the correct runtime version. After publishing to the staging deployment slot the function seems to work fine. Clicking the function's URL redirects me to a page stating that the function is running properly. However, when I swap the staging and production deployment slots, the function no longer runs and I see the following error message in the function's Overview tab:

enter image description here

When looking at the production function's Configuration tab I see that after the swap the Runtime version is still set to "custom (~2.0)" instead of "~4" like it is in the staging function. Apparently, when I publish from Visual Studio to the Azure staging deployment slot it deploys all dependencies and properly updates the Runtime version, but this isn't happening during a swap. My question is: can I simply change this Runtime version directly in the Azure function configuration or will this break other things? I'm worried that if I change it and something goes seriously wrong then I won't be able to revert back (hence my desire to use deployment slots). Or is there a way to ensure that all dependencies/configurations are considered when performing a swap?

Upvotes: 0

Views: 293

Answers (1)

Paugh
Paugh

Reputation: 115

I updated the framework in both the core function class and dependent classes, rebuilt, republished directly to the Prod Deployment Slot, and stopped the function in the Stage Slot (I think resource sharing between the two was contributing to the issue even though they should be operating independently). The function is now functioning correctly.

Upvotes: 0

Related Questions