Greg
Greg

Reputation: 504

Cannot connect to SQL Server from logic app

I'm having trouble connecting to my SQL Server in an Azure Logic App.

I've just created a fresh SQL Server and database and am now attempting to connect to it in my logic app. However, it doesn't appear to be showing when I enter my credentials. I've been following this tutorial.

enter image description here

Does anyone know why this might be the case? Is it perhaps a permission thing that I may have missed?

I've also found that if i do an AD connection, I get this: enter image description here

Upvotes: 3

Views: 5867

Answers (3)

scott_lotus
scott_lotus

Reputation: 3277

Had no end of trouble with this too. Previous Logic App jobs put in place on 20 ish databases over that last 24 months at various dates to execute an SP dbo.Reindex overnight, all connection strings started failing.

I troubleshooted:

  • firewall access
  • credentials
  • different type of auth
  • confirming access from other clients

But resolved by deleting this component in the Logic App Designer:

enter image description here

And replacing with this component:

enter image description here

New component "basic" auth works for SQL auth workflow.

I did spot this from Diagnostics:

enter image description here

But clearly my "connectors" were all V2 already.

I guess you could just try deleting the V2 SQL connector rather than using the DataWarehouse one too.

Testing that theory ....

Delete SQL V2 and re-add

enter image description here

That worked too.

Ok so for whatever reason, V2 connector need to be deleted and re-added to resolve.

Hope that helps someone.

Scott

Upvotes: 0

Egor
Egor

Reputation: 176

Try this for connecting to your DB:

  • first of all, try to connect with Azure AD Integrated here, and if you don't see your SQL Server and DB in the list try the next step
  • go to Resource Group where you created LogicApp and find the connection name that you used when trying to connect with Azure AD Integrated. You need to open it and click on Edit API Connection. In Authentication Type use SQL Server Authentication and other data to connect to your DB here.

Upvotes: 1

Sadiq Khoja
Sadiq Khoja

Reputation: 600

Make sure you are allowing azure services to access your database server at

SQL Server > Firewalls and virtual networks > Allow Azure services and resources to access this server = Yes

enter image description here

Upvotes: 1

Related Questions