0
votes

Here is the steps to connect to a SQL Server or Azure SQL database from Azure Logic apps using the Azure portal.

https://docs.microsoft.com/en-us/azure/connectors/connectors-create-api-sqlazure

But, I have to create SQL Server Connector's API Connection using the DotNet SDK.

1
Can you clarify. By .Net SDK, you mean with just c# or such and not a Logic App?Johns-305
Yes with C# using .Net SDKHiteshKumar Vaghasiya

1 Answers

0
votes

Currently, I can't find the creating logicApp connector API connection function from Azure SDK document.

If use the Rest API is possible, we could use the following rest API to do that.

put https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourcegroup}/providers/Microsoft.Web/connections/sql?api-version=2016-06-01

I also test it on my side with postman with following body.

{"properties":{"api":{"id":"/subscriptions/{subscriptionid}/providers/Microsoft.Web/locations/eastus/managedApis/sql"},"parameterValues":{"server":"{yourserverName}.database.windows.net","database":"{databaseName}","username":"{username}","password":"{password}"},"displayName":"{name}"},"location":"{location}"}

enter image description here

How to get the authorization token, please refer to another SO thread.