Using Azure Quickstart Templates

By:   |   Comments   |   Related: > Azure


Problem

I have heard of Azure Quickstart templates recently. What are these templates and where can I download them? How can I use these templates to deploy on my Azure subscription?

Solution

There are hundreds of community contributed templates that are available that can be used to deploy resources quickly on your own subscription. You can refer to this link: https://azure.microsoft.com/en-us/resources/templates/ where you can view the Quickstart templates that are available to download. 

Once you click on the link, the home page is shown.

azure quickstart templates

From the screenshot you can see that there are 712 Quickstart templates that are currently available in the gallery.

If you are looking for specific Quickstart templates, for example, look for “SQL” related templates, just type “SQL” in the “Search” option and search.

azure quickstart templates

Once you click on the “search” icon, it will show you all the templates that are SQL related. From the screenshot, you can see there are 76 SQL related templates available.

 

azure quickstart templates

On the left-hand side, you can also see the other resource types that are available which you can use. By clicking on those resource types, it will display the templates that are available for that resource type.

How to use Azure Quickstart Templates

After searching for the keyword using “SQL”, you could see that there were 76 templates available. One of them was a template to provision a “SQL Database with TDE”.

provision tde sql database template

We will use this template for our demo in this tip. Just click on the template which will take you to this screen.

provision tde sql database template

When you look closely, I have highlighted the section which you should read as it would be relevant to you. Certain organizations have rules around using such community provisioned tools. You may want to check regarding your company’s policies and guidelines before using any of the Quickstart templates that are available.

Here is the text:

"This Azure Resource Manager template was created by a member of the community and not by Microsoft. Each Resource Manager template is licensed to you under a license agreement by its owner, not Microsoft. Microsoft is not responsible for Resource Manager templates provided and licensed by community members and does not screen for security, compatibility, or performance. Community Resource Manager templates are not supported under any Microsoft support program or service, and are made available AS IS without warranty of any kind."

Deploy an Azure Quickstart Template

You can deploy the Azure Quickstart template using the portal, using PowerShell or by using the command line interface. From the template, you can see the parameters that are required.

azure template parameters

These are the values that you are required to enter when you deploy on Azure. Once you click on “Deploy to Azure”, it will take you to the next screen where you will need to login to your Azure subscription. After you login, you will be at this screen where you can view your Quickstart template in your Azure subscription and is ready for deployment.

Deploying a Quickstart template without any modifications.

template parameters and settings

On the Azure portal, you can view the quickstart template as displayed. The settings section is the value of the parameters for the template that you need to provide. You can enter the details as shown. For “Resource group”, I have used an existing one, review the “Terms and Conditions” and click on “Purchase”.

template parameters and settings

Once you click on “Purchase”, the deployment of the SQL Database will start as shown.

deploy template

Once the deployment succeeds, you can check the confirmation from the notifications section.

deploy template notifications

After this confirmation, you can go to the “SQL Databases” section of the Azure portal to confirm that the new database is created.

deployed database

The “sample-db-with-tde” is the new SQL database created using the Quickstart template.

Modifying a Quickstart template by editing the template and then deploy

From the above demo, you can see that a SQL database with a name “sample-db-with-tde” got created. However, what if you want a different database name instead of this? You can easily accomplish this by modifying the Quickstart template. When you first viewed the Quickstart template on the Azure portal, you would have seen an option to edit the template as shown below.

edit azure template

Once you click on “Edit Template”, you will see the underlying JSON file which defines the resources that will be used for this template. JSON stands for - Java Script Object Notation. To understand more about JSON, you can refer this tip.

At a high level, the key components of a JSON file include the below items which you will see when you click on “Edit Template”.

  • Schema
  • ContentVersion
  • Parameters
  • Variables
  • Resources
edit azure template

The database name will be visible in the section under “Variables”. Click on “Variables” and you will be able to view the variables that are defined in this template.

edit azure template

Once you click on “databaseName” under the “Variables” section, you will be able to view the code line number to the right where you can see where the database name is defined. For this template, it is defined as “sample-db-with-tde”. Just modify it to the name of your choice, for this example, we will modify the database name as “SQLTIPSDEMO”.

edit azure template

Once you click on “Save”, it will take you back to the original window where you need to key in the parameters, enter the resource group details, accept the “Terms and Conditions” and click on the “Purchase” option.

modified azure template

New database created with a customized name of your choice

Once the deployment completes you can view the new database that gets created during a successful deployment.

customize template

With just a few clicks, you were able to successfully update an existing Quickstart template and deploy a SQL database with a name of your choice.

Modifying a Quickstart template by editing parameters

Now you know how to edit a Quickstart template. In this section, we will review the steps to edit the parameters. You would have noticed that you had to manually enter your account details in the template before purchasing.

customize template

This would be time consuming if you are planning to use this template for a number of deployments. In that case, you have the option to edit parameters and embed the values within the parameters, so you don’t have to reenter the values every time you use the template. Click on the option to “Edit Parameters” as shown.

edit azure template parameters

Once you click on this option, it will take you this screen where you can view the details of the parameters that are used in the JSON file.

edit azure template parameters

From the screenshot, you can see that the values for the “sqlAdministratorLogin” and “sqlAdministratorLoginPassword” are both NULL. You can update the NULL values with appropriate values as per your requirements. In my case, I have updated the values as below, click on “Save” when done.

edit azure template parameters

Once you click on “Save”, it will take you to the main Quickstart template page where you will see that the values of the parameters are already populated.

edit azure template parameters

With this you avoid having to spend time filling in parameter values and you can straight away accept and provision the SQL database. In the same way, you could play around with the numerous other Quickstart templates that are available from the portal.

Next Steps
  • In this tip, you learned about Azure Quickstart templates
  • You saw how JSON files are used for the templates
  • In the first section, you were able to deploy the Quickstart template without any modifications
  • In the second section, you modified the Quickstart template to use a different database name
  • In the last section, you updated the parameters that were used in the Quickstart template
  • Refer to the numerous Quickstart templates that are available and try out on your own subscription
  • Check your company policies and guidelines before deploying the Quickstart templates in your client’s environment
  • Refer to these other Azure articles available on MSSQLTips


sql server categories

sql server webinars

subscribe to mssqltips

sql server tutorials

sql server white papers

next tip



About the author
MSSQLTips author Mohammed Moinudheen Mohammed Moinudheen is a SQL Server DBA with over 6 years experience managing production databases for a few Fortune 500 companies.

This author pledges the content of this article is based on professional experience and not AI generated.

View all my tips



Comments For This Article

















get free sql tips
agree to terms