# Add Azure Function App Identity to MSSQL

> How to add Azure Function App Identity to MSSQL

- Canonical URL: <https://carlossura.com/blog/add-azure-function-app-identity-to-mssql/>
- Author: Carlos Sura
- Published: 2026-01-07
- Tags: app, role, mssql, function, identity

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!
