In the latest article (Using Azure Resource Manager Templates To Provision Azure SQL Databases) posted on this web site, a sample Azure Resource Manager template changed into supplied that provisions a new logical server website hosting an unmarried Azure SQL Database example. Template-based provisioning simplifies deployment and promotes standards of DevOps and Infrastructure as Code, making it the recommended approach for implementing cloud-based total services. However, its advantages enlarge past initial implementation, due to the fact you could use it on configuring and keeping existing Azure SQL Database times. In this text, you are supplied with an example of this approach.
When considering the use of ARM templates for editing the configuration to existing instances of an Azure SQL Database, it is essential to observe that, by using the default, template deployments are incremental in nature. As the end result, the scope of changes is limited to resources and their residences, that are explicitly referenced inside the template, while all others within the equal useful resource institution continue to be intact. This simplifies template authoring and minimizes the length of template deployment.
Consider a scenario in which Azure SQL Database auditing wishes to be enabled on a logical server (which, by means of default, is inherited through all of its databases). This configuration is managed with the aid of the properties of the auditing settings resource kind:
As you may see, the configuration calls for getting admission to an present Azure Storage account, set up based at the mixture of the account name and one of its keys. Not exceedingly, the auditing settings additionally require a present Azure SQL Database logical server. To put in force the useful resource, a template is used so that it will, moreover, automatically provision the storage account in order that its handiest parameter can be the logical server call. There are a few extra interesting factors of the template:
The name of the storage account should be globally particular. In order to generate it, rely upon the unique string() function with the seed fee derived from the aid institution identifier (assured to be globally unique). The ensuing string can also be prepended with the ‘st’ prefix by way of the use of the concat() function with a purpose to make certain that the storage account call starts with a letter.
The garage account name is stored in a variable to facilitate multiple references to its value during the template
The value of the primary storage account key is retrieved through the use of the listKeys() feature
The target Azure vicinity in which the deployment takes region is determined based totally on the vicinity of the resource organization. Note that this presumes that the aid institution vicinity matches the area of the logical server.