Reputation: 5839
I have a function app with a deployment slot for the purpose of development testing (e.g. blue/green)
One of the functions is setup as a ServiceBusTrigger
bound to a service bus queue.
I do not want the function in the development deployment slot to be tripped by the queue elements in the service bus. I have disabled this function in the deployment slot in the Azure portal. What is the correct approach for this?
Edit: Disabling the function in the development slot is no good, because once the slots are swapped, the function becomes disabled in production. My current workaround is to create an entirely new "development" service bus, and use it's connection string for the development slot.
Upvotes: 6
Views: 1985
Reputation: 141
I found that going into the portal and manually disabling a function creates an app setting "AzureWebJobs.{FunctionName}.Disabled"=1
My solution was to add that to the slot-specific app settings in my environment and check "Deployment Slot Setting" so that the value doesn't get swapped during deployment as you observed.
Upvotes: 3
Reputation: 25994
Azure Functions just like Azure WebApps have sticky slot settings. You could have two namespaces, green and blue, where each namespace stays with ("sticks to") the intended slot. You would not need to disable the function and separate between the production and the testing namespaces.
Upvotes: 4