MicrosoftDocs / azure-docs

Open source documentation of Microsoft Azure
https://docs.microsoft.com/azure
Creative Commons Attribution 4.0 International
10.2k stars 21.35k forks source link

Doc doesn't mention that Service Bus triggered functions don't respect slot routing rules. #87676

Open VanessaRussell opened 2 years ago

VanessaRussell commented 2 years ago

Item 3 listed under the Swap Slots section should be updated to denote the fact that routing rules are only web-based. For example, if you have a Service Bus triggered function; it will attempt to process messages from the queue/topic regardless of the routing rules.

Here's the information that I obtained from the SME working on my support ticket that should be included within this document somehow:

Regarding Service Bus entities, it is not recommended to use the same entity with two slots (Production and Staging).

Here are some possible options for the customer:

1) Enable the MessageProcessor function only for the Productions slot. To do this, you will need to add the %Topic% app setting to Production and Staging slot. In addition, the Staging slot will need to have a sticky app setting to disable the MessageProcessor function so that it never starts listening. For morning information on creating a sticky app settings, please https://docs.microsoft.com/en-us/azure/azure-functions/functions-deployment-slots#create-a-deployment-setting

2) Have two different Service Bus entities—one for Production and one for Staging

3) Use Service Bus Topics and Subscriptions. This way, each message published to Service Bus is made available to each subscription register with the topic. You could have one subscription for Production and one for Staging. For more information, please see https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-queues-topics-subscriptions#topics-and-subscriptions

Please note that for 2 and 3, you must use non-sticky settings for connection strings/entity names/subscription names.

Furthermore, it begs the question as to whether there's even a point in using slots with Service Bus triggered functions. The Why Use Slots? section should answer this question.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

mike-urnun-msft commented 2 years ago

Thank you for your feedback! We have assigned this issue to the author to review further and take the next course of action.