如何使 Azure Bash CLI 命令成为基于参数的?

How to make Azure Bash CLI commands as parameters based?

Azure CLI 命令应该是基于参数的,这样用户就可以输入他的任何参数值,部署应该proceed.any知道如何设置这个参数。

示例- 我想创建一个 azure 资源组,该值是用户定义的。

az group create --name "user-defined" --location "East US 2"

在Windows中,可以使用Read-Host促使用户输入参数值。

$groupName = Read-Host -Prompt 'Input your group  name'
az group create --name $groupName --location "East US 2"

在Linux中,可以使用read -p促使用户输入参数值。

read -p "Enter your groupname: " myname
az group create --name $myname --location "East US 2"