Azure SQL Managed Instance Connection with .net 4.8 api/svc host

52 Views Asked by At

We have a .net 4.8 application with api and svc host projects where our applications are hosted in Azure Virtual Machine (IIS), and our Databases are hosted in SQL Managed instance. They are in the same vnet in different subnet.

Managed identity of VM is created in managed instance.

Before, the application was in a vm and on prem sql server was being used.

Connection strings

<add name="AppContext" connectionString="Server=***; Database=App_DevDB; Trusted_Connection=true" providerName="System.Data.SqlClient" />
<add name="BackgroundJobsContext" connectionString="Server=***; Database=Hangfire_DevDB;Trusted_Connection=true" providerName="System.Data.SqlClient" />

We are trying to figure out the changes to have our app connect with the DB in managed instance (db context, conn string, etc.) but not able to get any related information per our requirement. Also we do not want to use user id/pwd in our connection string.

It will be great to get some directions from the community to help figure this and learn about it.

Please let me know if I can provide any more details.

0

There are 0 best solutions below