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.