Azure.ResourceManager.Sql 1.3.0 – ImportExistingDatabaseDefinition: ManagedIdentity usage and association (system-assigned vs user-assigned)

FELDNER Ilanit 0 Reputation points
2025-11-06T06:39:26.6066667+00:00

Hi,

We’re using the Azure.ResourceManager.Sql SDK (v 1.3.0) in C# to automate BACPAC imports with managed identity access to both the storage account and the SQL server.

The constructor for ImportExistingDatabaseDefinition now supports StorageKeyType.ManagedIdentity and AuthenticationType.ManagedIdentity, and the comments suggest that when using managed identity, the storageKey and administratorLogin parameters should contain the resource ID of the identity.

However, the implementation still enforces non-null checks on both parameters. This makes it unclear whether the system-assigned managed identity is actually supported or if only user-assigned identities are currently functional.


Questions

  1. Is the system-assigned managed identity supported when using StorageKeyType.ManagedIdentity, or does the SDK currently only support user-assigned identities?
  2. If user-assigned MI is required, is the correct setup to assign it to the SQL server and grant it Storage Blob Data Reader on the target container, then pass its resource ID to the ImportExistingDatabaseDefinition parameters?
  3. Specifically, does the identity need to be explicitly assigned in the Azure Portal under SQL Server → Identity → User-assigned → Add → [select our Managed Identity] for the import to work?

Is there an official example or documentation describing how to properly associate a managed identity with the SQL import operation?

Azure SQL Database
{count} votes

Your answer

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