user20776389
user20776389

Reputation:

My web api get 500 internal server after deploy to azure api management

I am new to azure app service, i have used visual studio to deploy my web api to azure api management. i am doing a mobile application project, I need to make local ssms database data sync to azure cloud. because my web api is connect to ssms database, and it has error when i am testing it in azure api management, it response 500 internal server error, but i have the weatherforecast GET Sample, and this api work normal, it response 200 ok. i don't know what i have done wrong to the web api or i set up wrong in the azure.

ScreenShots:

enter image description here

enter image description here

Upvotes: 0

Views: 431

Answers (1)

Harshitha
Harshitha

Reputation: 7297

Check the below steps to deploy sync the local DB to Azure SQL Server.

I need to make local ssms database data sync to azure cloud.

  • In Azure Portal => Create a new SQL Database Server.

enter image description here

  • Set Admin enter image description here

In Local DB => Right click on the DB => Tasks =>select Deploy Database to Microsoft Azure SQL Database.

enter image description here

  • Click on Connect , provide the Server name from Azure Portal (SQL Server Overview page).

enter image description here

  • Initially I got the below error. enter image description here

  • To access/ Connect Azure SQL DB , we need to enable Public network access and add Firewall rules in Azure SQL Server.

enter image description here

  • Now I have connected to Azure SQL server and deployed local DB Test to Azure SQL Server without any issues.

enter image description here

  • SQL Database in Azure contains all the data which we have in local DB.
  • Now if we want to make any changes to the DB, from SSMS we need to connect to the Azure SQL DB and make required changes.

enter image description here

  • I have inserted data by connecting Azure SQL DB , you can see the changes in portal.

enter image description here

  • Now we need to provide the Azure SQL Connection string in the Web.config file of the ASP.Net Web API.
  • Copy the connection string from Azure SQL DB and paste it in the Web.config file.

enter image description here

  • Replace the password with your Password.

Upvotes: 0

Related Questions