I have an AspNetCore3.1 app hosted on Linux Azure WebApp. I have enabled Private Endpoint on the same. All works like a charm. Now to add DB interaction, I have enabled system assigned Managed Identity(MI) for the web app and added that as contained user to my Azure SQL PaaS. However, I'm getting errors while DB connection:
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 DB too. This one is in different subnet but same VNet as webapp's private endpoint is in.
-Update: I have verified that the error is still thrown even if I remove Private Endpoint from webApp.
What am I missng here?