My understanding of Microsoft's documentation on what happens during a swap, is that if there are slot specific settings, they are applied to the source slot and source is restarted.
If this is the case, does this mean that there is a brief moment where both source and target are running with the same target specific settings?
I have a C# application that reads messages from an Azure Service Bus and the connection to that resource is slot specific (I do not want my staging slot to ever consumer production messages). During the swap, it's possible both source and target will consume messages from my production Azure Service Bus, correct? Is it possible to get around this?
I tried creating a proof of concept to check for this but it's very difficult to understand what is happening to the settings during a swap.
To prevent the
productionmessages going intostagingenvironment by giving the servicebus connection string seperately to staging and production environments inlaunchsettings.jsonfile.To give the connection strings for the different environments in local like below:
WEBSITE_OVERRIDE_PRESERVE_DEFAULT_STICKY_SLOT_SETTINGSset to0orfalse. check thisIn the
slot-specific settings configuration panel, locate the setting for the Azure Service Bus connection string. Enter the appropriate connection string for the destination slot. make sure you have provide the correct connection string to prevent production messages from being consumed in the staging environment.Plan slot swaps during periods of low traffic or scheduled maintenance windows to minimize the impact on users and reduce the likelihood of simultaneous execution of both slots.
Slot specific settings adding like below:
The production and staging environments should be specified separately in the local setup with a Service Bus connection string. Please refer to this SO LINK.