azure-dev
azure-dev copied to clipboard
[Issue] `Azd env new` asks for environment name instead of using command line arg
Output from azd version
azd version 0.1.0-beta.4 (commit fd96b3e9b283598bc4dc736e893f1b47080fbf7d)
Output from az version
{
"azure-cli": "2.38.0",
"azure-cli-core": "2.38.0",
"azure-cli-telemetry": "1.0.6",
"extensions": {
"containerapp": "0.3.5",
"log-analytics": "0.2.2",
"rdbms-connect": "1.0.2"
}
}
Describe the bug
When using the azd env new
command it is prompting for an environment name from the command line rather than accepting my cli argument as the name to be used.
To Reproduce
azd env new $myNewEnvironmentName
Expected behavior Expected the CLI not to prompt and ask me for environment name
Environment Information on your environment: * Happens with PowerShell and Bash * command line experience
@KSchlobohm can you try like below with -e
option as called out in the reference docs - https://docs.microsoft.com/en-us/azure/developer/azure-developer-cli/reference#azd-env
azd env new -e staging
Please select an Azure location to use: 38. (US) Central US (centralus)
Please select an Azure Subscription to use: Other (enter manually)
Enter an Azure Subscription to use: foo
Note: environment name should contain only alphanumeric characters and hyphens
That worked for me.
I think the help text says this should also work azd env new staging
where staging is the same as azd env new <environment>
"-e" means "use an environment that isn't the default"
the azd env new
This was fixed with #1105