Skip to main content

[Obsolete] Azure deployment. Connectionstrings

Azure resource group

This template is used to create an azure deployment project. Based on a wizard, it generates file with list of console commands to perform the automatic deployment, with or without visual studio. After the project is created it can be configured and modified. Those types of projects are flexible and has a great possibility




Connectionstrings in azure

It's a common practice to use .config files to store connectionstrings, but it's not possible to identify what content should connectionstring have after deployment. There is a separate task to change .config file after deployment. To get rid of this task azure provides a new way of using connectionstrings from .config files: they are not used at all.
Azure provides a possibility to store connectionstrings as separate settings, which are accessible in azure portal in website settings. So connectionstrings block in .config file can be empty.

Connectionstrings in deployment

 
There is a possibility to configure those connectionstrings in deployment project. After creation of a web project deployment new section in .json file appears. This section shown in json outline window as connectionstrings and by default contains a connectionstring to database server mentioned in the wizard. That section can be edited according to application parameters. 

E.g. if.config file contains next connectionstrings:

<connectionStrings>
    <add name="DbModel" connectionString="..." providerName="..." />
    <add name="RedisCacheConnection" connectionString="..." />
</connectionStrings>
.json file can contains next lines:
"DbModel": {
              "value": "[concat('Data Source=tcp:', reference(concat('Microsoft.
Sql/servers/', variables('sqlserverName'))).fullyQualifiedDomainName, ',1433;Initial Catalog=', parameters('databaseName'), ';User Id=', parameters('administratorLogin'), '@', variables('sqlserverName'), ';Password=', parameters('administratorLoginPassword'), ';')]",
              "type": "SQLServer"
            },
"RedisCacheConnection": {
              "value": "[concat(parameters('RetRedisCacheName'),'.redis.cache.windows.net,abortConnect=false,ssl=true')]",
              "type": "SQLServer"
            }
It's obvious that connectionstrings names should fit each other and application can find the correct string while executed. Connectionstring in azure deployment is dynamically built, there are two ways to see the final connectionstrings: go to azure portal and check it there or download publish profile from azure website using visual studio. That file will contain publishing information, including generated connectionstrings.

Comments

Popular posts from this blog

RetrieveMultiple Plugins MS CRM

Plugin for RetrieveMultiple message in MS Dynamics CRM RetrieveMultiple message is not the most popular message in CRM development, because not so much types of tasks are solved via plugin registered on this message. And it leads to situation, when this message is forgotten and not used.

System solutions in MS Dynamics CRM

In storage model description was described, how different types of solutions affect component storage in system. And only one system solution was mentioned: "Active solution", but it's not alone in CRM system. System solutions There are four standard solutions in any CRM organization