Azure / Azure/azure-cli

Template support (like arm templates)

Open
#15,852 6 comments 0 reactions 1 assignee Claimed by @zhoxing-ms View on GitHub
act-identity-squad ARM feature-request Service Attention
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

**Is your feature request related to a problem? Please describe.**
nope

**Describe the solution you'd like**
When creating resources with az you can create each resource manually or via a powershell/bash script.
ARM has templates, why not support an option like "az template "

Yaml could be formatted like this: (kinda like Ansible syntax)

```bash
---
vars:
foo: "bar"
number: 42

var_files:
- ./vars/myvars.yml

resources:
group:
create:
- name: "MyResourceGroup1"
location: "westeurope"
- name: "MyResourceGroup2"
location: "westeurope"
resource-type: "Microsoft.web/site"
vm:
create:
- name: MyVm
resource-group: "MyResourceGroup"
public-ip-address: ""
image: "Win2012R2Datacenter"
nic:
- nic_name1
- nic_name2
disk_attach:
- name: "disk_{{ foo }}"
new: true
size-gb: {{ number }}
sku: "Standard_LRS"
```

**Describe alternatives you've considered**
You could use az deployment and use ARM templates and this could also be used in terraform or ansible. However when starting with ARM they can look quite daunting I think this yaml is more readable and cleaner.

You can also create a script for deployment. When creating a script you have to choose upfront if you want Bash or Powershell and they are not interoperable in the way variables are defined.

**Additional context**
Other non-platform specific tools like terraform or ansible depend on azure cli or the azure cli python library. When new features are made available through ARM they first need to be incorporated in AZ and python libs. Only then those tools can incorporate those features into their platform before they are available to the users of those tools.
This serial development takes time and often not all features are incorporated.

When those tools could offload commands to native tools like azure cli you cut some development time and use the full feature set azure cli offers
@ansible-collections

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.