This is a mixin for Porter that provides the Azure (az) CLI.
When you declare the mixin, you can also configure additional extensions to install
Use the vanilla az CLI
mixins:
- az
Install additional extensions
mixins:
- az:
extensions:
- EXTENSION_NAME
See the az CLI Command Reference for the supported commands.
az:
description: "Description of the command"
arguments:
- arg1
- arg2
flags:
FLAGNAME: FLAGVALUE
REPEATED_FLAG:
- FLAGVALUE1
- FLAGVALUE2
outputs:
- name: NAME
jsonPath: JSONPATH
- name: NAME
path: SOURCE_FILEPATH
The mixin supports jsonpath
and path
outputs.
The jsonPath
output treats stdout like a json document and applies the expression, saving the result to the output.
outputs:
- name: NAME
jsonPath: JSONPATH
For example, if the jsonPath
expression was $[*].id
and the command sent the following to stdout:
[
{
"id": "1085517466897181794",
"name": "my-vm"
}
]
Then then output would have the following contents:
["1085517466897181794"]
The path
output saves the content of the specified file path to an output.
outputs:
- name: kubeconfig
path: /root/.kube/config
mixins:
- az:
extensions:
- azure-cli-iot-ext
az:
description: "Azure CLI login"
arguments:
- login
flags:
service-principal:
username: "{{ bundle.credentials.AZURE_SP_CLIENT_ID}}"
password: "{{ bundle.credentials.AZURE_SP_PASSWORD}}"
tenant: "{{ bundle.credentials.AZURE_TENANT}}"
az:
description: "Create VM"
arguments:
- vm
- create
flags:
resource-group: porterci
name: myVM
image: UbuntuLTS
az:
description: "Delete VM"
arguments:
- vm
- delete
flags:
resource-group: porterci
name: myVM