官术网_书友最值得收藏!

  • Learn Azure Administration
  • Kamil Mrzyg?ód
  • 456字
  • 2021-06-11 18:14:31

Other tools

ARM templates are not the only way to manage resources via ARM. There are external tools that you can consider if you find this particular feature cumbersome or counterproductive. These tools are as follows:

  • Azure Fluent: A set of helpful SDKs that enable you to programmatically call ARM APIs to provision resources. They are written for multiple different platforms (.NET, Java, Python, or Node.js).
  • Terraform: A tool by HashiCorp where you use a YAML file to describe your infrastructure. 
  • Pulumi: A new project where you can use TypeScript, Go, or Python to write scripts that describe your infrastructure.
Each tool has its pros and cons – your choice may be also affected by the technology stack your team is used to. I strongly encourage you to give the aforementioned tools a go as they follow the recent standards in terms of scripting infrastructure and may greatly improve your productivity.

Once you have your template prepared, you probably want to deploy it. The easiest way to do so is to use the CLI. The following is an example of the command required to deploy the template we created earlier:

az group deployment create --name <name-of-a-deployment> --resource-group <name-of-rg> --template-file <name-of-your-file>.json

The preceding command will create a new deployment with a specific name and use a particular template file. Of course, if your template accepts parameters, you can pass them using the --parameters switch:

az group deployment create --name <name-of-a-deployment>--resource-group <name-of-rg> --template-file <name-of-your-file>.json --parameters storageAccountType=Standard_GRS

Once the deployment is finished, you should see a JSON file that represents the serialized output of the operation. Each deployment can be found in the Deployments blade of your resource group:

Figure 2.9: Resource group deployments list

With ARM templates, you can quickly provision your infrastructure in any region available in Azure. As it is a native way of deploying resources in Azure, it is important to understand at least the basic features of this functionality so that you can quickly multiply required services. To better understand the advanced topics (such as conditional statements, functions, and linked templates), take a look at the following link: https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/template-syntax. It contains a full description of the syntax and its structure.

Although JSON templates are often a recommended way of managing resources in Azure, do not forget about alternatives. Azure Fluent, Terraform, and Pulumi can be really interesting propositions, especially if you are working with IaaS architectures. 

Deciding which tool is the best for you relies solely on your actual requirements. In many setups, a mix of available tools will give the best results. The next section will help you enhance your deployments by introducing locks, which help in preventing accidental deletion of resources or changes in their configuration.

主站蜘蛛池模板: 苗栗市| 忻城县| 阿瓦提县| 大姚县| 临海市| 铜山县| 沧州市| 贵定县| 霍邱县| 大兴区| 彝良县| 大名县| 西畴县| 商南县| 太仆寺旗| 新郑市| 论坛| 彝良县| 南华县| 诸城市| 宁陵县| 社旗县| 从江县| 高要市| 巫溪县| 荥阳市| 龙山县| 洪湖市| 汕头市| 石柱| 布尔津县| 清水河县| 上饶市| 施甸县| 红桥区| 嵊泗县| 内丘县| 大同县| 德惠市| 西华县| 社旗县|