我尝试通过Azure CLI将.vhd文件上传到Microsoft Azure。上载的.vhd将存储到Azure容器中。
我可以通过将其转换为Azure门户中的图像来手动启动它。但我希望通过其API执行相同的操作。有可能吗?
答案 0 :(得分:0)
请参阅命令“azure vm image create”以使用CLI创建映像。 (对于PowerShell,它将是命令Add-AzureVMImage。)
有关详细信息,请参阅下面的集成帮助:
azure help vm image create
info: Executing command help
help: Upload and register a VM image
help:
help: Usage: vm image create [options] <name> [source-path]
help:
help: Options:
help: -h, --help output usage information
help: -v, --verbose use verbose output
help: --json use json output
help: -u, --blob-url <url> the target image blob url
help: -l, --location <name> the location
help: -a, --affinity-group <name> the affinity group
help: -o, --os <type> the operating system [linux|windows]
help: -p, --parallel <number> the maximum number of parallel uploads [96]
help: -m, --md5-skip skip MD5 hash computation
help: -f, --force-overwrite Force overwrite of prior uploads
help: -e, --label <about> the image label
help: -d, --description <about> the image description
help: -b, --base-vhd <blob> the base vhd blob url
help: -k, --source-key <key> the source storage key if source-path
help: is a Microsoft Azure private blob url
help: -s, --subscription <id> the subscription id