The
Azure Web App Deployment task can actually configure the desired values for
your connection strings. If you were to
review an Azure Web App’s Applications settings blade in the portal, you will
find a section for App settings and Connection strings.
When
you are hosting an ASP.NET application in your Azure Web App these values will
be used instead of what is in your web.config.
Any access to your web.config is intercepted by the Azure Web App and if
the value is stored in this section that is the value that will be provided to
the application.
If
you are hosting a non-ASP.NET application each of these values are stored as
environment variables so any technology can gain access to the values stored
here.
To
set the connection string value when using the Azure Web App Deployment task
simply use the Additional Arguments field and enter a value like the one below.
-connectionString
@{"$(ConnectionStringName)"="Server=tcp:$(ServerName).database.windows.net,1433;Database=$(DatabaseName);User
ID=$(AdministratorLogin)@$(ServerName);Password=$(AdministratorLoginPassword);Trusted_Connection=False;Encrypt=True;"}
The
-connectionString argument is a hashtable so you can set as many connection
strings as you need.