Creating an Instance under Azure CLI 2.0

To create an instance under Azure CLI 2.0, complete the following steps.

  1. Install Azure CLI 2.0 ( https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest).
  2. Run az login and follow the prompts to authorize the machine.
  3. Download the template and parameters files from the GitHub repository. https://github.com/Azure/azure-quickstart-templates
  4. Open <prefix>-parameters.json:. Locate the ./single_line_json.sh user_data.txt script.
  5. Copy and paste the generated output into the customData value field of the JSON parameters file.
  6. Use the script as in the following example:
    #!/usr/bin/bash
    
    cat $1 | python -c 'import json, sys; print( json.dumps( sys.stdin.read() ) )'
  7. Use the template and parameters JSON files to launch a CloudEOS and vEOS Router instance in Azure using the Azure CLI 2.0.
    $ az group create --name ExampleGroup --location "Central US"
    Note: You must use the same location as the storage account where the VHD image is uploaded.
    $ az group deployment create \
    --name ExampleDeployment \
    --resource-group ExampleGroup \
    --template-file <prefix>-template.json \
    --parameters @<prefix>-parameters.json
    Note: If you are using a newer version of the Azure CLI 2.0, you may encounter a parameter file parsing bug. To fix this, remove the @ symbol before the parameters filename.