Azure Functions Deployment Slot and User-Assigned Managed Identities

Jean David Ruvini 85 Reputation points
2024-11-20T01:15:52.53+00:00

Hi everyone,

I’m working with an HTTP-triggered Azure Function that uses environment variables and a User-Assigned Managed Identity (UMI). I’ve also set up a deployment slot for this function.

I noticed that while environment variables are carried over to the deployment slot, the User-Assigned Managed Identity is not automatically assigned to the slot. Is this the expected behavior?

If so, is there any official documentation that outlines what configurations (like managed identities) need to be manually set up when creating a deployment slot?
Do they need to be setup each time the function is pushed to the slot?

Thanks in advance!

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,215 questions
0 comments No comments
{count} votes

Accepted answer
  1. Khadeer Ali 1,300 Reputation points Microsoft Vendor
    2024-11-20T01:58:33.4966667+00:00

    Hi Jean David Ruvini,

    Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.

    Yes, this is the expected behavior. Deployment slots in Azure Functions do not automatically inherit User-Assigned Managed Identities (UMI) or System-Assigned Managed Identities. Managed Identities must be explicitly assigned to each deployment slot because these identities are associated with the slot's unique underlying resources rather than the application itself.

    Please refer to the below document on the same

    Managed Identities in Azure Functions

    Regarding your second question, you do not need to set up the UMI each time you push the function to the slot. Once you have assigned the UMI to the deployment slot, it will be available for use in all deployments to that slot.

    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.