0
votes

Is it possible to access Azure SQL Database on one subscription from Azure AppService hosted on a different subscription via Managed Identity?

I followed the steps below, which has no example on different subscription. https://docs.microsoft.com/en-us/azure/app-service/app-service-web-tutorial-connect-msi#grant-permissions-to-managed-identity

Other links Using Azure managed Identities to access Azure SQL DB https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/tutorial-windows-vm-access-sql

Update

How to reference idenity-name when it is in a different subscription? shown on the link above https://docs.microsoft.com/en-us/azure/app-service/app-service-web-tutorial-connect-msi#grant-permissions-to-managed-identity

CREATE USER [<identity-name>] FROM EXTERNAL PROVIDER;
ALTER ROLE db_datareader ADD MEMBER [<identity-name>];
ALTER ROLE db_datawriter ADD MEMBER [<identity-name>];
ALTER ROLE db_ddladmin ADD MEMBER [<identity-name>];
1
Have you actually tried it? The name should be unique in that AAD tenantsilent

1 Answers

0
votes

As long as both, AppService as well as SQL DB, live in the same AAD tenant then, yes, this should be possible