Describe the bug
the az.cmd batch script that wraps python.exe and passes in the correct arguments to start azure.cli seemingly cannot handle arguments with a @() in them
my example is with az webapp config connection-string set because that is where I found it, but it most likely impacts every command
example:
PS C:\Users\mgrandi> # verify we have no existing connection strings in our web app
PS C:\Users\mgrandi> az webapp config connection-string list --resource-group "mgrandi-rg" --name "mgrandi-webapp"
[]
PS C:\Users\mgrandi> # try and set a connection string with a `@()` in it as the value
PS C:\Users\mgrandi> az webapp config connection-string set --connection-string-type custom --name mgrandi-webapp --settings "TestKey=@Microsoft.KeyVault(SecretUri=https://html5zombo.com)" --resource-group mgrandi-rg
--resource-group was unexpected at this time.
C:\Users\mgrandi> "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin\\..\python.exe" -IBm azure.cli webapp config connection-string set --connection-string-type custom --name mgrandi-webapp --settings TestKey=@Microsoft.KeyVault(SecretUri=https://html5zombo.com) --resource-group mgrandi-rg
PS C:\Users\mgrandi> # note, the above is the entire output, i did not type that python.exe command
PS C:\Users\mgrandi> # verify still no connection strings
PS C:\Users\mgrandi> az webapp config connection-string list --resource-group "mgrandi-rg" --name "mgrandi-webapp"
[]
PS C:\Users\mgrandi> # try and set it with calling python.exe manually
PS C:\Users\mgrandi> & 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe' -IBm azure.cli webapp config connection-string set --connection-string-type custom --name mgrandi-webapp --settings "TestKey=@Microsoft.KeyVault(SecretUri=https://html5zombo.com)" --resource-group mgrandi-rg
"TestKey": {
"type": "Custom",
"value": "@Microsoft.KeyVault(SecretUri=https://html5zombo.com)"
}
}
PS C:\Users\mgrandi> # verify we have one connection string now
PS C:\Users\mgrandi> az webapp config connection-string list --resource-group "mgrandi-rg" --name "mgrandi-webapp"
[
{
"name": "TestKey",
"slotSetting": false,
"type": "Custom",
"value": "@Microsoft.KeyVault(SecretUri=https://html5zombo.com)"
}
]
PS C:\Users\mgrandi> # if we get rid of the ending ')' , it works
PS C:\Users\mgrandi> az webapp config connection-string set --connection-string-type custom --name mgrandi-webapp --settings "TestKey2=@Microsoft.KeyVault(SecretUri=https://html5zombo.com" --resource-group mgrandi-rg
{
"TestKey": {
"type": "Custom",
"value": "@Microsoft.KeyVault(SecretUri=https://html5zombo.com)"
},
"TestKey2": {
"type": "Custom",
"value": "@Microsoft.KeyVault(SecretUri=https://html5zombo.com"
}
}
PS C:\Users\mgrandi> # should have 2 connection strings now
PS C:\Users\mgrandi> az webapp config connection-string list --resource-group "mgrandi-rg" --name "mgrandi-webapp"
[
{
"name": "TestKey2",
"slotSetting": false,
"type": "Custom",
"value": "@Microsoft.KeyVault(SecretUri=https://html5zombo.com"
},
{
"name": "TestKey",
"slotSetting": false,
"type": "Custom",
"value": "@Microsoft.KeyVault(SecretUri=https://html5zombo.com)"
}
]
Command Name
az webapp config connection-string set
Errors:
after running, you get this output to the powershell terminal
--resource-group was unexpected at this time.
C:\Users\mgrandi> "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin\\..\python.exe" -IBm azure.cli webapp config connection-string set --connection-string-type custom --name mgrandi-webapp --settings TestKey=@Microsoft.KeyVault(SecretUri=https://html5zombo.com) --resource-group mgrandi-rg
To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.
- run a command with a
@() in it
Expected Behavior
it should pass the arguments to the python process and either work or not, depending on the arguments
Environment Summary
Windows-10-10.0.18362-SP0
Python 3.6.6
Installer: MSI
azure-cli 2.9.1
Additional Context
Describe the bug
the
az.cmdbatch script that wrapspython.exeand passes in the correct arguments to startazure.cliseemingly cannot handle arguments with a@()in themmy example is with
az webapp config connection-string setbecause that is where I found it, but it most likely impacts every commandexample:
Command Name
az webapp config connection-string setErrors:
after running, you get this output to the powershell terminal
To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.
@()in itExpected Behavior
it should pass the arguments to the python process and either work or not, depending on the arguments
Environment Summary
Additional Context