Skip to content

azlin template import

Import a VM template from a file into local template storage.

Description

Import templates shared by team members or restored from backups.

Usage

azlin template import INPUT_FILE [OPTIONS]

Arguments

  • INPUT_FILE - Template file to import (YAML or JSON)

Options

Option Description
--name TEXT Override template name
--overwrite Overwrite existing template
-h, --help Show help message

Examples

Import Template from File

azlin template import ~/downloads/prod-template.yaml

Output:

Importing template from ~/downloads/prod-template.yaml...

Template: prod
  VM Size: Standard_D8s_v3
  Region: eastus
  Description: Production servers

✓ Template imported: ~/.azlin/templates/prod.yaml

Import with Custom Name

azlin template import ~/team-dev.yaml --name dev-customized

Import and Overwrite Existing

azlin template import ~/updated-template.yaml --overwrite

Bulk Import

for file in ~/azlin-templates-backup/*.yaml; do
  azlin template import $file --overwrite
done

Common Workflows

Restore from Backup

# After system migration
cd ~/azlin-templates-backup
for template in *.yaml; do
  azlin template import $template
done

# Verify
azlin template list

Team Distribution

# Clone team templates repo
git clone https://github.com/company/azlin-templates.git /tmp/templates

# Import all
cd /tmp/templates
for template in *.yaml; do
  azlin template import $template --overwrite
done

See Also