'How to differentiate code running in production and staging slots

I have 2 Azure Functions: Azure Function 1 and Azure Function 2.

Azure Function 1 is timer trigger function which runs every n minutes and puts a message to a queue.

Azure Function 2 is a service bus trigger function which gets triggered after receiving a message from the queue

As of now, I only have one deployment slot for these 2 functions - production slot.

I'm trying to add a new staging slot for both functions.

Both staging slot and production slot will have same app settings (uses same queue, same log workspace).

Now, let's say Azure Function 1 gets triggered and puts a message to queue. Will there be 2 messages in the queue (from Azure Function 1 in staging slot and production slot)? Will Azure Function 2 in both staging slot and production slot gets triggered after receiving the message? Please help me understand.

UPDATE:

For clarification, my understanding is that both production and staging slots are in running state all the time. So, Azure Function 1 (timer trigger function) in both staging and production slots get triggered and put a message to the same queue (since both slots use the same queue). Will there be 2 messages in the queue? If so, will Azure Function 2 in both production and staging slots get triggered (since Azure Function 2 is a service bus trigger function)? So, should different queues be used for production/staging slots?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source