I'm working on a tool that uses an SQL Server as a database.

First I was using Visual Studio's localdb, then I was using an Azure SQL Server, both of which worked just fine.

I now tried to host my own SQL Server Express, but I can't seem to connect to it. It's hosted in an Azure VM, I have restarted it, enabled TCP and I have opened Port 1433 in Azure.

I have tried both connecting remotely, running the web-app on my local computer and connecting to `tcp:{IP}\InstanceName`, as well as running the app on an IIS Server on my VM using `.\InstanceName` in the connection string (although I still get told to check if the server is set up correctly to handle TCP ? )

Connecting locally on the VM, using Microsoft SQL Server Management Studio works though, so I suspect the connection string in my `web.config` must be wrong ... 

It looks like this: 

```
<connectionStrings>
    <add name="defaultConnection" 
         connectionString="Server=tcp:12.345.678.910\InstanceName,1433;Initial Catalog=master;Persist Security Info=False;User ID=sa;Password={mypassword};MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;" 
         providerName="System.Data.SqlClient" />
</connectionStrings>

```

The error message I get is:

> 
> Server Error in '/application-name' Application. The remote computer refused the network connection.
> 
> 
> Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
> 
> 
> Exception Details: System.ComponentModel.Win32Exception: The remote computer refused the network connection
> 
> 
> Source Error:
> 
> 
> An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
> 
> 
> Stack Trace: [Win32Exception (0x80004005): The remote computer refused
>  the network connection]
> 
> 
> [SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - The remote computer refused the network connection.)] 
> 
> 
> 

*(and more but it doesn't seem important - will post if necessary or helpful)*

Any idea what I'm doing wrong?