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

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:

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.
Set Admin
In Local DB => Right click on the DB => Tasks =>select Deploy Database to Microsoft Azure SQL Database.
Click on Connect , provide the Server name from Azure Portal (SQL Server Overview page).
Initially I got the below error.
To access/ Connect Azure SQL DB , we need to enable Public network access and add Firewall rules in Azure SQL Server.
Now I have connected to Azure SQL server and deployed local DB Test to Azure SQL Server without any issues.
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.
I have inserted data by connecting Azure SQL DB , you can see the changes in portal.
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.
Replace the password with your Password.

Related

I cannot access my Azure SQL database when I upload my web app using Azure Portal and devops

When I test my web app locally, I can access my Azure SQL database.
But when I upload my web app using the Azure Portal and Devops, the website can display, but it looks like it cannot access the Azure SQL database.
Firewall set in my SQL database of Azure portal and connection string
Firewall:
Console error...

Unable to insert data into Azure SQL Database from On-premises SQL Database in Azure data factory pipeline

Scenarios:
I have to move data from an on-premise SQL Server database to Azure SQL database using Azure Data Factory pipeline.
I have created a self-hosted linked service for on-premises database and provided managed identity access to Azure SQL database for the ADF account.
Linked Service Configuration:
IR Configuration: Azure Managed Virtual Run time.
I tried with both SQL Authentication type and System assigned managed identity.
Test Connection is giving successful and we are able to do select operation individually by Azure SQL Server
Getting below error while doing insert when running the pipeline.
Error:
ErrorCode=SqlFailedToConnect,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Cannot connect to SQL Database: '', Database: '', User: ''. Check the linked service configuration is correct, and make sure the SQL Database firewall allows the integration runtime to access., Source=Microsoft.DataTransfer.ClientLibrary,''Type=System.Data.SqlClient.SqlException,Message=Cannot open server "" requested by the login. The login failed.,Source=.Net SqlClient Data Provider,SqlErrorNumber=40532,Class=14,ErrorCode=-2146232060,State=1,Errors=[{Class=14,Number=40532,State=1,Message=Cannot open server "*****" requested by the login. The login failed.,},],'
In copy activity, in case if either the source or the sink is leveraging an IR, than it is expected that both the source and sink should be accessible from the server containing the IR.
So to debug : please login into the Server hosting the IR and check whether you are able to access the Azure DB from that server. If not than please whietlist the IP and make the necessary port updates

Is SQL Login the only Azure Data Migration Service (DMS) target database Authentication Type?

When setting up a Data Migration Project, migrating from SQL database to Azure SQL Database in Azure Portal, I can only see the option to connect to the Target database using SQL Login Authentication Type.
I expect to see more options - like Azure AD integrated Mode.
I am in Azure AD Group assigned as SQL Admin on the Azure SQL Server.
Is any other Authentication Type supported for the target Azure Server?
If others are support, what do I need to do to get them to be available in the Authentication Option for the target server?
Thank you
The following tutorial spells out that only SQL Logins are currently supported:
https://learn.microsoft.com/en-us/azure/dms/tutorial-sql-server-to-azure-sql#specify-target-details

How to design a pipeline for creating users in Azure SQL Database

In Azure SQL DB, if we want to create users for the DB. Is there a way to create a pipeline instead of connecting to the Azure SQL Database server as an admin via SQL Server Management Studio or Azure Data Studio from on premises.

Not able to connect to Azure SQL Server without specifying SQL Database name

Current Environment: I have been given Reader and SQL DB Contributor access to a resource group in Azure which has all the Azure SQL databases and the related Azure SQL server. I have 10 databases under the same server and within the same resource group.
Problem: When I try to connect to this server via SSMS using "Azure Active Directory - Password" I can not connect and get the "Login failed for user NT Authority\Anonymous Logon" error with error code 18456. But when I provide the database name in the connection properties in the login window of SSMS I can connect but now I can only view one database.
Question: I am trying to find out what's the reason for this behavior? As I have "SQL DB Contributor" access, shouldn't I be able to connect to the server and view all databases? Is "SQL Server Contributor" a requirement to connect to Azure SQL Server without specifying a Database name?
To connect to the server and view all your databases on SQL Server Management Studio you need to connect to the master database on that server and it will show you all databases listed on SSMS Object Explorer. If you connect to a user database SSMS won't show you the rest of the databases.
Get connected to the master database using the server Admin account.
If you are using an Azure Active Directory account make sure you add the the account as Azure SQL Administrator as shown here.

Resources