0

Azure CLI command should be Parameters based, so that user can enter his any values to parameters and deployment should be proceed.any one know how to set this parameter.

example- I want to create one azure resource group and the value is user-defined.

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

1 Answer 1

1

In Windows, you could use Read-Host to promote user to input the parameter value.

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

enter image description here

In Linux, you could use read -p to promote user to input the parameter value.

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

enter image description here

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks it worked for me. How can we run an existing CLI script file in Azure Bash?
You could refer to this article to run cli script file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.