Search code examples
azureazure-functionsazureservicebusazure-servicebus-queues

ServiceBusTrigger on function app with deployment slots


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.


Solution

  • 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.