3

I have a question about "Data connections" in azure.

I have an App Service. I published my API app there. In my app I have connection strings (I need to work with databases). Among numerous settings for my app I saw a "Data connections" item: enter image description here

There you can add new connection (server, login, password). After creation you can look at connection string for this connection: enter image description here

My questions are: 1. what does it do? (I mean in my app I already have a connection string in Web.config and is there any advantages of using connection string in azure?) 2. how to use this "connection from azure" in my app?

I'll appreciate any help.

hokkaidi
  • 858
  • 6
  • 19
Zirochka
  • 146
  • 2
  • 10

2 Answers2

3

After you add a Data Connection, you can find that it is configured to Connection strings section under Application settings blade. And for .NET apps, these connection strings are injected into your .NET configuration connectionStrings settings at runtime, overriding existing entries where the key equals the linked database name.

enter image description here

Besides, you can find Data Connection section is under Mobile tab, when we do with Azure Mobile Apps’ Easy Tables, we need Data Connection to connect to a database.

Fei Han
  • 26,415
  • 1
  • 30
  • 41
2

Data connections help you create a SQL database in azure and then helps you add the necessary connection string so that you can use it form your app.

If you already have a database/connection string, you can ignore this.

Byron Tardif
  • 1,172
  • 6
  • 16
  • 1
    You don't need to use Data Connections workflow at all if you hit issues, All the workflow does it validate and add the connection string to list of connectionString on the AppSettings. Just add the connection string directly in the App Settings. The Data connections is a helper – C B Feb 22 '18 at 01:44