-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
az tag create treating array as string for --tags #23902
Comments
Thank you for your feedback. This has been routed to the support team for assistance. |
route to CXP team |
@jrveva Thank you for reaching out, we are looking into it. |
could be related to #23896. passing an array to 'az webapp config appsettings set' doesn't work correctly too. I can confirm this is a new bug in v2.40 |
@jrveva, Please see the explanation and solution at #23797 (comment) |
Thanks, but this does work in 2.39. So idea is to splat it instead of use the variable array for 2.40 onwards? |
@jrveva Yes, 2.40 onward you will have to use the splat. |
Thanks. I have done a test now and yes, this has fixed the issue by changing it to a splat instead. I will update the team so knowledge is shared as this might break other areas of our deployments. |
Can i close this issue? @jrveva |
Yes, that's fine. It makes sense, we splat params all the time, so not sure why we did a powershell array for this, but if it accepted it i guess we never questioned it :) Please close. |
This is autogenerated. Please review and update as needed.
Describe the bug
When creating an array of tags within powershell to pass to --tags, it treats it as a single string instead of an array. This is a new bug in 2.40 as we have tested the functionality within 2.39
Command Name
az tag create
Errors:
To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.
Create an array for tags such as:
$tags = @(
"cdo:cost:business-unit=Planning and Operations",
"cdo:cost:primary-segment=Planning and Operations",
"cdo:cost:secondary-segment=Something",
"cdo:cost:csr-name=Some long name",
"cdo:cost:customer-name=TestClient",
"cdo:cost:primary-function=RnD",
"cdo:cost:secondary-function=Product Development",
"cdo:cost:region=Corporate",
"cdo:cost:market=Corporate",
"cdo:cost:environment=Development",
"cdo:cost:stage=Development",
"Function=Spoke",
"Client=TestClient",
"Environment=Production",
"Role=AA",
"Package=1234.1.123"
)
Then pass this using az tag create --resource-id {} --tags $tags --output none
az tag create --resource-id {} --tags {} --output {}
Expected Behavior
Tags are treated individually rather than treating the first tag up to '=' as the key, and then the rest as the 'value' which exceeds the 256 limit.
Environment Summary
Additional Context
The text was updated successfully, but these errors were encountered: