jenkinsci / azure-cli-plugin

A Jenkins plugin to use Azure CLI for managing Azure resources.
https://plugins.jenkins.io/azure-cli/
MIT License
5 stars 18 forks source link

Spaces in commands #7

Closed MassimoSporchia closed 6 years ago

MassimoSporchia commented 6 years ago

Hello,

I was trying to tag resources via the azureCLI plugin via the command: azureCLI commands: [[exportVariablesString: '', script: "az group update -n ${resource_group_name} --set tags.Company=Hello"]], principalCredentialId: 'jenkins-ci-azure-app'

The issue occurs when I try to specify a spaced value, like the following: azureCLI commands: [[exportVariablesString: '', script: "az group update -n ${resource_group_name} --set tags.Company=\"Hello World\""]], principalCredentialId: 'jenkins-ci-azure-app'

The resulting tag is: "Company": "\"Hello"

When run from the native CLI via: az group update -n ${resource_group_name} --set tags.Company="Hello World"

The resulting tag is: "Company": "Hello World"

I'm sure it has do be done this way (see: https://github.com/Azure/azure-cli/issues/1863 )

torosent commented 6 years ago

Fixed with 0.9 version

MassimoSporchia commented 6 years ago

@torosent Thanks! I'll try it as soon as possible. As far as you are aware, is there a way to specify, using azure CLI, tag names with spaces? AFAIK the only way is to use powershell: Set-AzureRmResourceGroup

torosent commented 6 years ago

--tags "test key=test value" works for me