Search code examples
azure-functionsazure-deployment-slots

Azure Function with Blob Trigger - Stage Slot Still Firing on Old Container


I have an Azure Function fired by a blob trigger. The function is deployed using a deployment slot (zero downtime), with auto-swap on the stage slot enabled to the production slot. My latest deployment changed the blob container used for the trigger. The deployment was successful and the new function in the production slot is trigger from any new blob in the new container.

The issue: Even though the stage slot is specified with 0% traffic it is still being fired by any new blob that appears in the old container still, why?


Solution

  • As per my observation, Irrespective of the Traffic Percentage, Azure Functions will trigger when the new blob is uploaded to the container.

    I have deployed a Blob Trigger Function App to the Azure Functions (.NET 6 Stack - Premium Hosting Plan) with Auto Swap Enabled from the stage slot to prod slot.

    • Stage Slot - old container - Eg, samples-workitems

    • Prod Slot - Function with same code but new container - Eg: prodcontainer

    I tested by uploading the files to both the blob containers one by one and checked the invocation logs. Even though traffic is 0%, both slot functions are fired when containers are getting updated with new blobs.

    Stage slot - old container - samples-workitems

    enter image description here

    prod slot - new container - prodcontainer enter image description here

    Traffic in the deployment slots means Incoming requests will be redirected to the respective target slot during auto-swap without down time.

    For more information, you can refer Azure Functions Deployment Slots - MSFT Doc.