Add Azure Function App Identity to MSSQL
I’m assuming you’ve already enabled a system-assigned or user-assigned identity for this. If so, all you need to do is execute the following commands in your database:
-- Create the user
CREATE USER [functionappname] FROM EXTERNAL PROVIDER;
-- Grant permissions READ/WRITE
ALTER ROLE db_datareader ADD MEMBER [functionappname];
ALTER ROLE db_datawriter ADD MEMBER [functionappname];
This grants read and write permissions to the user, though you can add more roles if needed.
That’s it!
Related Articles
Adding App Identity to Directory Readers Role in Azure
How to assign a user-assigned Managed Identity to the Directory Readers role in Microsoft Entra ID (Azure AD) to resolve SQL error Msg 37353.
Libman in Azure DevOps Pipelines
How to use Libman in Azure DevOps Pipelines
How to run Azure DevOps self-hosted agents on Azure Container Instances (ACI)
Learn how to build and deploy self-hosted Azure DevOps build agents using Azure Container Instances (ACI) and Azure Container Registry (ACR).