Testing in staging slot Azure Function App

781 Views Asked by At

I'm trying to understand how deployment slots work:

Let's say I have 2 azure functions: Fun A & Fun B. Fun A has 2 slots - production, staging and Fun B has 2 slots - production, staging. Fun B is a service bus trigger function - when a message is passed to a queue from Fun A, Fun B gets triggered. Means, Fun B has a dependency on Fun A. Let's say I made some changes to Fun B and these changes are deployed to staging slot of Fun B (not production slot). A messaged is passed to the queue from Fun A, Fun B gets triggered. What happens now, does the code in both staging slot/production slot run? Please help me understand.

To make it more clear:

Let's say I have some code in production slot to add logs to some File 1.

New code in staging slot adds logs to some File 2.

When I run the function, will it add logs to File 1 or File 2?

1

There are 1 best solutions below

3
On

You would define slot settings in your function appsettings and have different queues for testing the staging and production slots.

https://learn.microsoft.com/en-us/azure/azure-functions/functions-deployment-slots#manage-settings

When you swap the slots the slot specific settings are used so you can test in isolation.