0

After publishing the web API to Azure in Visual Studio, and adding two SQL databases in the wizard the account database connected itself without problems to the app service in azure. The data containing database, however, did not. How do I tell the app service web API to use that database?

2 Answers 2

1

Depending on how your solution was created, you will have a "web.config" and/or an "app.config" file.

Open these up and check the "connectionStrings" section. You should have an entry for each database connection. Verify that these are pointing to the proper databases with the proper security.

In Web.config, the "connectionStrings" section is in the section "configuration". In "App.config the connectionStrings section is in the same place.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you for your answer. I checked and it actually only contains the connection string from the local databases i was running. Interestingly somehow one of the databases for the accounts is working and interacting with the app service without me specifying anything. Why does this not apply to the database containing the application data.
1

You will have to allow certain IP addresses to connect to it. Look at the SQL Database server's Firewall setting. You can the IP address of your computer (or IP range), to access SQL Database

Make sure to enable Allow Azure services and resources to access the server

enter image description here

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.