Issue when connecting to azure sql over Virtual Network in App Service.
See original GitHub issueDescribe the bug
-
I can connect with the user via SSMS.
-
If I run the code locally on my machine it works.
-
If I run it in an azure app service using IP whitelisting against azure sql it works.
-
If I use Virtual Network with the app service for whitelisting the virtual network against azure sql it no longer works.
I use the virtual network method with other apps that do not use entity framework core.
I am working on implementing this sample.
https://github.com/Azure/Microsoft-commercial-marketplace-transactable-SaaS-offer-SDK
Microsoft.Marketplace.SaaS.SDK.CustomerProvisioning
Exception message:
Stack trace:
Microsoft.Data.SqlClient.SqlException (0x80131904): Cannot open server "xxxxxx" requested by the login. The login failed.
at Microsoft.Data.ProviderBase.DbConnectionPool.CheckPoolBlockingPeriod(Exception e)
at Microsoft.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
at Microsoft.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
at Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
at Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
at Microsoft.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
at Microsoft.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
at Microsoft.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
at Microsoft.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
at Microsoft.Data.SqlClient.SqlConnection.Open()
at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenDbConnection(Boolean errorsExpected)
ClientConnectionId:xxxxxxx
Error Number:40532,State:1,Class:14



Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Connect your application to Azure SQL Managed Instance
If you're unable to connect to SQL Managed Instance from an Azure virtual machine within the same virtual network but a different subnet,...
Read more >Troubleshoot virtual network integration with Azure App ...
This article describes tools you can use to troubleshoot connection issues in Azure App Service that integrate with a virtual network.
Read more >Azure App service failing to connect to the Azure SQL VM ...
Azure App service failing to connect to the Azure SQL VM Server ... However, I am able to connect to the database via...
Read more >Connect App Service to Azure SQL Server through Virtual ...
I have an Azure Sql server, and Azure App service, and now I am connecting them using the public DNS address, and protect...
Read more >Troubleshoot common connection issues to Azure SQL ...
These connection problems can be caused by reconfiguration, firewall settings, a connection timeout, incorrect login information, or failure to ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Ok thanks! I will try some things out. And post back here if I reach a solution so it may help others.
Closing due to non reproducible and non active.