MicrosoftDocs / azure-docs

Open source documentation of Microsoft Azure
https://docs.microsoft.com/azure
Creative Commons Attribution 4.0 International
10.12k stars 21.19k forks source link

Connect Azure WebApp to Azure Sql PaaS with Private Endpoint and MI #66303

Closed sameer-kumar closed 3 years ago

sameer-kumar commented 3 years ago

My application exception has brought into this page here. I'm looking for accessing Azure SQL PaaS from Azure WebApp via Managed Identity and Private EndPoint but couldn't find any documentation or guidance.

I have an AspNetCore3.1 app hosted on Linux Azure WebApp with Private Endpoint. I have also enabled system assigned Managed Identity(MI) on the web app and added that as contained user to my Azure SQL PaaS. However, I could not establish sql connection and my app returns errors:

Connection was denied since Deny Public Network Access is set to Yes (https://docs.microsoft.com/azure/azure-sql/database/connectivity-settings#deny-public-network-access). To connect to this server, use the Private Endpoint from inside your virtual network (https://docs.microsoft.com/azure/sql-database/sql-database-private-endpoint-overview#how-to-set-up-private-link-for-azure-sql-database). at Microsoft.Data.ProviderBase.DbConnectionPool.CheckPoolBlockingPeriod(Exception e)

There is Private Endpoint configured for SQL PaaS too. This one is in different subnet but same VNet as webapp's private endpoint is in.

What am I missing here?


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

AnuragSharma-MSFT commented 3 years ago

@sameer-kumar Thank you for the detailed feedback. We are actively investigating and will get back to you soon.

AnuragSharma-MSFT commented 3 years ago

@sameer-kumar Thanks for the detailed provided.

GitHub forum is primarily focused on providing the answers related to queries/issues pertaining to documents/article.

For technical implementation issues, I would suggest you to post the queries on Microsoft Q&A or Stack Overflow.

Doing this on the forums allows us to help out other people who may have the same questions as you.

AnuragSharma-MSFT commented 3 years ago

@sameer-kumar We will now proceed to close this thread. If there are further questions regarding this matter, please comment and we will gladly continue the discussion.