How can I get the connection string to a database hosted Azure in the appsettings.json file?

450 Views Asked by At

I have created a database and hosted it in Microsoft Azure. I am struggle to connect to the database because I do not have the connection. Where can I get the connection string?

I have tired to find the connection on the Azure platform under the Azure databases that I have created and I was expecting to be able to access the data stored in the database.

1

There are 1 best solutions below

0
Rajesh  Mopati On

Connect to Azure and create an SQL Server and database.

  1. *Select the connection string of that particular database in the left pane as shown below and choose connection strings as highlighted .

enter image description here

  1. The below highlighted string need to be used in the appsettings.json to communicate with database of the azure. enter image description here

  2. *Use the connection string in the appsettings.jsonfile as shown below.

enter image description here