Enabling MARS (Multiple Active Result Sets) in Azure Sql Connection string results in failure with Private Endpoints/Azure Firewall

John 1 Reputation point
2021-10-22T08:45:56.967+00:00

We have an app service running from UK South, that talks to an Azure Sql Database over in North Europe. We have vnet integration on the app service on a virtual network in UK South, the private endpoints vnet/subnet resides on North EU and requests are routed using a routing table through an Azure firewall (standard) using the Hub/Spoke topology

The Azure firewall allows this application rule: -

142810-image.png

The application can communicate with Azure Sql all fine when MARS is set to false on the connection string, MultipleActiveResultSets=False

Now for some reason whenever we set the connection string to MultipleActiveResultSets=True we then get the following error:-

A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.)
An existing connection was forcibly closed by the remote host.

Could you possibly shed any light on as to what im missing or why that is happening? Like i said if i set that MARS setting back to false the application can communicate with the Azure Sql all fine again.

We also removed the private endpoints completely so just hitting azure sql publicly, bypassing the azure firewall using the public url with MARS enabled and that works fine so it seems like the code is fine.

Azure SQL Database
Azure Firewall
Azure Firewall
An Azure network security service that is used to protect Azure Virtual Network resources.
564 questions
Azure Private Link
Azure Private Link
An Azure service that provides private connectivity from a virtual network to Azure platform as a service, customer-owned, or Microsoft partner services.
461 questions
{count} votes