Last post Jun 28, 2018 09:22 PM by rkrex
Jun 28, 2018 06:23 PM|rkrex|LINK
I have a .Net Core application that is using a SQL Server Database. I know how to deploy a project or application to Azure that's not using a database. But what if I want to deploy an application that is using a sql server database. Do I create a SQL Server
Database on Azure and then connect to it? If so what happens to all of my existing connectionstring settings in the web.config file? Thanks !
Jun 28, 2018 07:46 PM|ryanbesko|LINK
Do I create a SQL Server Database on Azure and then connect to it?
Yes. You will have a server address available in the Azure portal that you use in SSMS on your local machine to connect to SQL Server on Azure. You can either backup your database and restore it to Azure or script it all and run that script on Azure.
If so what happens to all of my existing connectionstring settings in the web.config file?
Use Web.config transforms:
<?xml version="1.0" encoding="utf-8"?>
<add name="YOUR_CONNECTION_STRING_NAME" connectionString="Data Source=YOUR_AZURE_SERVER_NAME;Initial Catalog=YOUR_DATABASE_NAME;Integrated Security=True;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />
<compilation xdt:Transform="RemoveAttributes(debug)" />
EDIT: Right-click the Web.config file in your project and you will see the choice "Add Config Transform" on the popup menu.
Jun 28, 2018 09:22 PM|rkrex|LINK
Thanks very Much !