Blog Post

Azure SQL Blog
3 MIN READ

Give each Azure SQL database its own identity for storage access (Preview)

PDasgupta's avatar
PDasgupta
Icon for Microsoft rankMicrosoft
Nov 23, 2026

Say you’re building an AI assistant that answers questions about your customers’ shipments. Each customer has a database in Azure SQL Database and a private blob container full of files. The assistant doesn’t follow a fixed code path: what it reads depends on the question it’s asked. You’d like the boundary between Customer A’s files and Customer B’s to hold even if something above the database goes wrong.

Azure SQL Database can now draw that boundary at the database level. In this public preview, CREATE DATABASE SCOPED CREDENTIAL can use a managed identity that belongs to a single database, with external tables and OPENROWSET as the first features that use it. Software providers and enterprises can keep many databases on a shared logical server and still give each one its own storage permissions.

A scoped credential isn’t a scoped identity

Server-level managed identity already gives a database password-less access to storage. The catch is that every database on the server uses the same principal to connect to the Azure Storage, so they all share one set of permissions. A database-scoped credential lives inside one database, but the identity it selects can still be the server’s. The credential is database-scoped; the identity behind it may not be. One workaround was a dedicated logical server per customer, created solely to get a distinct identity.

One identity per database

Give each customer’s database its own user-assigned managed identity (UAMI), then grant each identity the Storage Blob Data Reader role on that customer’s container only. In each database, create the credential:

CREATE DATABASE SCOPED CREDENTIAL CustomerStorageCredential
WITH IDENTITY = 'DATABASE MANAGED IDENTITY';

The external data source references the credential. The SQL is identical in both databases, but each one resolves its own assigned identity, so there’s no stored secret and no database master key to manage.

Here’s what that buys the assistant. Three independent checks sit between a question and Customer B’s files: the application decides who’s asking, SQL permissions decide what they can run, and Azure Storage decides whether this database’s identity can read this container. If the first two let something through, whether it’s a bug, an over-broad role, or a prompt that talks the app into something it shouldn’t, the third still refuses, because Customer A’s identity has no role on Customer B’s container. If you need to cut one customer off, you remove that identity’s storage role without touching anyone else’s.

That’s defense in depth, and it only works as layers. It doesn’t replace SQL permissions, application authorization, or network controls. The last layer also holds only if grants are scoped per identity: reuse one identity across databases, or leave another broadly authorized path to storage, and you’ve rebuilt the shared boundary. For container-scoped grants, see Assign an Azure role for access to blob data.

When the customer’s storage is in another tenant

If a customer keeps storage in its own Microsoft Entra tenant, use IDENTITY = 'DATABASE FEDERATED CLIENT IDENTITY' instead. You register a multitenant application in the database’s tenant, configure it to trust the database UAMI, and set its application ID as the database’s federated client ID.

The customer consents to the application and grants storage access to the application’s service principal in the storage tenant, not directly to your managed identity. No customer storage secret is stored in the database. For the setup, see Configure an application to trust a managed identity.

What’s in the preview, and what isn’t

  • Works with external tables and OPENROWSET with DATA_SOURCE against Azure Blob Storage and Azure Data Lake Storage Gen2.
  • Each user database gets one user-assigned managed identity in the same subscription; system-assigned identities aren’t supported.
  • It’s only available in Azure SQL Database (not in master).
  • It doesn’t change how users and applications sign in to the database, and it doesn’t update existing credentials on its own.

If you’re building AI apps, this is the line to watch: the preview covers the data your app reads from storage through SQL. REST calls, AI embeddings, auditing, and import/export aren’t included in this preview, and an assistant reading files isn’t the same as a database using this identity to call a model. If one of those matters to you, tell us which service you need to reach and what permissions it requires through Azure SQL feedback. Please leave out secrets and customer data.

Already using database-level customer-managed keys? This preview reuses the identity settings from transparent data encryption. Grant storage access to the existing identity or federated application, then create a database-scoped credential that uses it.

Where to start

Follow Use database-level managed identity with Azure SQL Database for setup and troubleshooting. Creating a credential doesn’t prove it can reach storage, so test an allowed read and a denied read against another customer’s container before you rely on it.

Published Nov 23, 2026
Version 1.0
No CommentsBe the first to comment