Skip to content
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

Closed
jrveva opened this issue Sep 15, 2022 · 10 comments
Closed

az tag create treating array as string for --tags #23902

jrveva opened this issue Sep 15, 2022 · 10 comments
Assignees
Labels
ARM az resource/group/lock/tag/deployment/policy/managementapp/account management-group Auto-Assign Auto assign by bot customer-reported Issues that are reported by GitHub users external to the Azure organization. CXP Attention This issue is handled by CXP team. Mgmt This issue points to a problem in the management-plane of the library. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Milestone

Comments

@jrveva
Copy link

jrveva commented Sep 15, 2022

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:

(InvalidTagValueLength) Tag value too large.  Following tag value '**output from tags array**' exceeded the maximum length. Maximum allowed length for tag value - '256' characters.
Code: InvalidTagValueLength
Message: Tag value too large.  Following tag value '**output from tags array**' exceeded the maximum length. Maximum allowed length for tag value - '256' characters.

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

  • Put any pre-requisite steps here...
  • 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

Windows-10-10.0.19042-SP0
Python 3.10.5
Installer: MSI

azure-cli 2.40.0

Extensions:
account 0.2.3
interactive 0.4.5

Dependencies:
msal 1.18.0b1
azure-mgmt-resource 21.1.0b1

Additional Context

@ghost ghost added customer-reported Issues that are reported by GitHub users external to the Azure organization. Auto-Assign Auto assign by bot ARM az resource/group/lock/tag/deployment/policy/managementapp/account management-group labels Sep 15, 2022
@ghost ghost assigned zhoxing-ms Sep 15, 2022
@ghost ghost added this to the Backlog milestone Sep 15, 2022
@yonzhan yonzhan added the CXP Attention This issue is handled by CXP team. label Sep 15, 2022
@ghost
Copy link

ghost commented Sep 15, 2022

Thank you for your feedback. This has been routed to the support team for assistance.

@yonzhan
Copy link
Collaborator

yonzhan commented Sep 15, 2022

route to CXP team

@RakeshMohanMSFT RakeshMohanMSFT self-assigned this Sep 16, 2022
@RakeshMohanMSFT
Copy link
Contributor

@jrveva Thank you for reaching out, we are looking into it.

@berhir
Copy link

berhir commented Sep 16, 2022

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

@RakeshMohanMSFT
Copy link
Contributor

RakeshMohanMSFT commented Sep 17, 2022

@jrveva, Please see the explanation and solution at #23797 (comment)

@RakeshMohanMSFT RakeshMohanMSFT added the needs-author-feedback More information is needed from author to address the issue. label Sep 17, 2022
@jrveva
Copy link
Author

jrveva commented Sep 20, 2022

Thanks, but this does work in 2.39.

So idea is to splat it instead of use the variable array for 2.40 onwards?

@ghost ghost added needs-team-attention This issue needs attention from Azure service team or SDK team and removed needs-author-feedback More information is needed from author to address the issue. labels Sep 20, 2022
@RakeshMohanMSFT
Copy link
Contributor

@jrveva Yes, 2.40 onward you will have to use the splat.

@RakeshMohanMSFT RakeshMohanMSFT added needs-author-feedback More information is needed from author to address the issue. and removed needs-team-attention This issue needs attention from Azure service team or SDK team labels Sep 20, 2022
@jrveva
Copy link
Author

jrveva commented Sep 20, 2022

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.

@ghost ghost added needs-team-attention This issue needs attention from Azure service team or SDK team and removed needs-author-feedback More information is needed from author to address the issue. labels Sep 20, 2022
@RakeshMohanMSFT
Copy link
Contributor

Can i close this issue? @jrveva

@RakeshMohanMSFT RakeshMohanMSFT added needs-author-feedback More information is needed from author to address the issue. and removed needs-team-attention This issue needs attention from Azure service team or SDK team labels Sep 20, 2022
@jrveva
Copy link
Author

jrveva commented Sep 20, 2022

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.

@ghost ghost added needs-team-attention This issue needs attention from Azure service team or SDK team and removed needs-author-feedback More information is needed from author to address the issue. labels Sep 20, 2022
@RakeshMohanMSFT RakeshMohanMSFT removed the needs-team-attention This issue needs attention from Azure service team or SDK team label Sep 20, 2022
@RakeshMohanMSFT RakeshMohanMSFT added Mgmt This issue points to a problem in the management-plane of the library. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Oct 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ARM az resource/group/lock/tag/deployment/policy/managementapp/account management-group Auto-Assign Auto assign by bot customer-reported Issues that are reported by GitHub users external to the Azure organization. CXP Attention This issue is handled by CXP team. Mgmt This issue points to a problem in the management-plane of the library. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

5 participants