question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue when connecting to azure sql over Virtual Network in App Service.

See original GitHub issue

Describe 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

image

image

image

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
alandilloncommented, Mar 24, 2020

Ok thanks! I will try some things out. And post back here if I reach a solution so it may help others.

0reactions
cheenamalhotracommented, Oct 21, 2020

Closing due to non reproducible and non active.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found