question

thsieh123-1573 avatar image
0 Votes"
thsieh123-1573 asked thsieh123-1573 commented

How the development slot works

I add a "devel" deployment slot in the function app's portal. The target slot is my original "production" that I have been deployed to. I can deploy different code to "devel" and "production" via vsc. It seems that the "devel" slot has been executed when client connects to the function app. This is what I understand that the "devel" maps to target "production" slot. If I want the client to hit the original "production" slot, I can only "stop" the "devel" function app. Is there other way to choose which slot is facing customer? And what is the normal use case for the different deployment slots. Because if I want my real customer still hits the production slot while my test client hits the "devel" slot. If I turn on the devel function app, the mapping happens and my customer will hit to devel one.

My function app sits behind IotHub and triggered by builtin eventhub.

Thanks

azure-functions
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MughundhanRaveendran-MSFT avatar image
2 Votes"
MughundhanRaveendran-MSFT answered thsieh123-1573 commented

Hi @thsieh123-1573 ,

It appears that you have two slots, one is "Production" (default slot) and "devel". Looking at the details provided, devel and production has separate code bases.

Your main concern is "It seems that the "devel" slot has been executed when client connects to the function app"

This would happen if the IOThub triggered function present in the devel slot has been called by the client or if you have performed a slot swap. During a slot swap, the code/ app settings would be swapped from devel slot to production slot .
If you havent swapped the slots, then you will have to check if the client is targetting the production slot's function app

By default, all the requests/triggers would execute the production slot's function, there is no need to stop the devel slot. Again, I would suggest you to check the client side or also take a look at the integration page of the Production slot's function app and check if the trigger and bindings section has been mapped to correct IOThub resource name

141255-image.png


Here are the use cases for deployment slots
https://docs.microsoft.com/en-us/azure/azure-functions/functions-deployment-slots#why-use-slots

Please let me know if you are still facing the issue. I will be able to help you further.

I hope this helps!

Also please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.



image.png (47.4 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@thsieh123-1573 ,

Just checking if the above answer was helpful or not. Please let me know.

0 Votes 0 ·
thsieh123-1573 avatar image thsieh123-1573 MughundhanRaveendran-MSFT ·

Yes I did the slot swap and that is the reason. So now I stop the development slot and the code execution is from production slot.

0 Votes 0 ·