azure-xplat-cli
azure-xplat-cli copied to clipboard
Synchronous execution of commands in scripting environments
CLI Version: 0.10.4 OS Type: Linux (Ubuntu 14.04) Installation via: npm
Mode: ** ARM **
Environment: AzureCloud
Description:
azure group create
doesn't support feedback as to when the operation is complete. I have to continuously execute in a loop azure vm show --name $machinename --resource-group $resourcegroupname
and get the output of the ProvisionState :Updating
line to see when the machines (my final resource being deployed in the template) are done. Is there no native way to get AzureCLI to provide this information as the machine is deploying? Using automation this is very inconvenient, as I cannot execute my next automation step until I know for certain that the resources are online and available.
Steps to reproduce:
- Run
azure group create --name $name --location $location -f \path\to\template.json -e \path\to\params.json -d $deploymentname -vv
Thanks for reporting this. azure group create and azure group deployment create are very similar operations; except the resource group needs to be previously created before executing the latter.
In the group deployment create command we have an option called --nowait. This will cause the CLI to send the initial request and exit. You can then poll by doing a get on the resource you were trying to create
azure group deployment create -h
help: Creates a deployment
help:
help: Usage: group deployment create [options] [resource-group] [name]
help:
help: Options:
help: -h, --help output usage information
help: -v, --verbose use verbose output
help: -vv more verbose with debug output
help: --json use json output
help: -g --resource-group <resource-group> the name of the resource group
help: -n --name <name> the name of the deployment
help: -f --template-file <template-file> the path to the template file in the file system
help: --template-uri <template-uri> the uri to the remote template file
help: --template-version <template-version> the content version of the template
help: -p --parameters <parameters> a JSON-formatted string containing parameters
help: -e --parameters-file <parametersFile> a file containing parameters
help: -m --mode <mode> the deployment mode: specify one of Incremental or Complete. If no mode is specified, Incremental is used as default. When Complete mode is used, all the resources in the specified resource group, which are not included in the template, will be deleted.
help: -d --debug-setting <debugSetting> the debug setting for deployment logs. Valid values include RequestContent, ResponseContent, All or None. None is the default value. When All is specified, both request content and response content will be logged, which will be visible in deployment operations.
help: -q --quiet quiet mode (when complete mode is specified, do not ask for deployment confirmation)
help: --nowait does not wait for the deployment to complete. Returns as soon as the deployment is created
help: --subscription <subscription> the subscription identifier
help:
help: Current Mode: arm (Azure Resource Management)
Does this help?
Thanks for the quick reply @amarzavery. However, your suggestion is just another way to execute what I'm already doing.
I need to opposite of 'nowait' - something that locks shell / stdout until the deployment is complete and then releases my shell for further input once the deployment is done (or, if the deployment fails, notifies stderr). Obviously the more information that could be provided to stdout the better, but even if it's just a deploying...
line being printed every fifteen seconds that would be better. Named options such as --wait
or --polling
would be a great thing to have.
@vivsriaus @tianoms - This should be simple. Putting a message in the progress bar that "deployment in progress" should be good enough.
@vivsriaus - Lets confirm and if we are not doing this already, lets fix.
@glennmate azure group deployment create, by default, waits for the deployment to complete before returning. We show the progress of resources being provisioned while the deployment is running, something like this:
visriniv@avenger1 MINGW64 /a/newGit2/azure-xplat-cli (ThrowOnDepError) $ node bin/azure group deployment create -g vtest -f c://Users//visriniv//Desktop//test3light.json info: Executing command group deployment create info: Supply values for the following parameters hostingPlanName: testwefkj234 siteLocation: westus
- Initializing template configurations and parameters
- Creating a deployment info: Created template deployment "test3light"
- Waiting for deployment to complete + + + + info: Resource 'testwefkj234' of type 'Microsoft.Web/serverfarms' provisioning status is Succeeded data: DeploymentName : test3light data: ResourceGroupName : vtest data: ProvisioningState : Succeeded data: Timestamp : Tue Oct 11 2016 12:08:23 GMT-0700 (Pacific Daylight Time) data: Mode : Incremental data: CorrelationId : 778033c7-63a0-4d3b-a190-c3f68f1ea344 data: DeploymentParameters : data: Name Type Value data: --------------- ------ ------------ data: hostingPlanName String testwefkj234 data: siteLocation String westus data: sku String Standard data: workerSize Int 0 info: group deployment create command OK
Please install the latest version of Azure CLI and let us know if this is not what you're seeing on your end.
cc: @ravbhatnagar