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

Hi, I find an issue in this page. #1210

Closed
AlexChongMicrosoft opened this issue Jan 17, 2020 — with docs.microsoft.com · 10 comments
Closed

Hi, I find an issue in this page. #1210

AlexChongMicrosoft opened this issue Jan 17, 2020 — with docs.microsoft.com · 10 comments
Assignees
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. DevOps Documentation Service Attention This issue is responsible by Azure service team.

Comments

Copy link

With a lot of testing in both Windows/Linux, I find an issue in the update command.
It's necessary using ' replace " to envelop the token. Please have a check.

az devops security permission update --allow-bit 7 --namespace-id 52d39943-cb85-4d7f-8fa8-c6baac873819 --subject user@fabrikam.com --token '$PROJECT:vstfs:///Classification/TeamProject/e479xxxx-2be8-xxxx-bb0b-3a0209cxxxx'


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@jsntcy jsntcy added extension/devops Service Attention This issue is responsible by Azure service team. labels Jan 19, 2020
@ishitam8
Copy link
Member

Hi @AlexChongMicrosoft ,

I am not sure what is the issue that you are facing.
Could you please give some more details,

Double quotes (") would be required if user is running commands in Powershell.
So, the single quotes vs double quotes is not specific to this command or Azure DevOps CLI, it's a general inconsistency observed across CLIs.

@AlexChongMicrosoft
Copy link
Author

@ishitam8 Thank you for your attention. Actually, I worked with a customer for a long time on this issue. When using double quotes "", the string "$PROJECT:vstfs:///Classification/TeamProject/e479xxxx-2be8-xxxx-bb0b-3a0209cxxxx" would not be detected correctly. But when using single quotes, '$PROJECT:vstfs:///Classification/TeamProject/e479xxxx-2be8-xxxx-bb0b-3a0209cxxxx', it will be considered as a single string.

Here I paste my screenshot in powershell. Hope it could help.
double quotes
single quote

for you.

@ishitam8
Copy link
Member

ishitam8 commented Jan 21, 2020

Sorry for the typo. I meant, Single quotes (') would be required if user is running commands in Powershell.

So, this is specific to powershell, since the command contains a dollar sign and we want to pass the dollar sign as a string, the required string needs to be wrapped around in single quotes.

Usually dollar signs are associated with variables and Powershell would try to resolve these, but if you use single quotes (') instead of double quotes ("), It prevents PowerShell expanding $ into a variable.

What i was trying to convey here is that this behavior is not speciifc to Azure DevOps CLI, these are common escape characters associated with the different command prompts.
So, since this is a specific behavior associated with the type of command prompt you are using, there can't be any one specific command usage guideline here.

@AlexChongMicrosoft
Copy link
Author

@ishitam8 really appreciate your explanation. It makes sense.

Actually, with you explanation, I can understand its meaning. But for some of our users, when they follow this doc and use double quotes " in Linux, there is no notification of $ variable. It's what exactly makes them confused. And after a lot of testing, we found it should be a single quote here in both Linux bash and windows powershell.

I just raise my suggestion here and let you know the scenario. Double quotes " and single quote ' are the same in most of the scenarios, but here in my experience single quote ' is better because there will be less confusion when exactly following this doc. Or could you add a detailed explanation in this doc if possible?

It depends on you. Thank you very much for this good doc.

@ishitam8
Copy link
Member

Thanks @AlexChongMicrosoft , for the detailed explanation of why it would be common for linux users to get confused here.

@geverghe , Do we need to change the doc to include single quotes.?
Which in -turn will create issues for the users who are working on Windows command prompt.
Can we have any guidelines related to this in our docs or help texts?

@AlexChongMicrosoft
Copy link
Author

@ishitam8 Thank you for your attention. Really hope I can do something for our Microsoft.

@geverghe
Copy link

geverghe commented Apr 3, 2020

@AlexChongMicrosoft, @ishitam8 - I believe this is an issue across azure cli and there is a page in azure cli docs that tackles this precise problem -Quoting Issues . I am dropping the devops extension tag. Call out to the Azure CLI team to include this page as part of official doc.

@geverghe geverghe removed their assignment Apr 3, 2020
@yonzhan yonzhan added extension/devops Service Attention This issue is responsible by Azure service team. and removed Service Attention This issue is responsible by Azure service team. labels Apr 3, 2020
@pietergheysens
Copy link

@ishitam8 Thank you for your attention. Actually, I worked with a customer for a long time on this issue. When using double quotes "", the string "$PROJECT:vstfs:///Classification/TeamProject/e479xxxx-2be8-xxxx-bb0b-3a0209cxxxx" would not be detected correctly. But when using single quotes, '$PROJECT:vstfs:///Classification/TeamProject/e479xxxx-2be8-xxxx-bb0b-3a0209cxxxx', it will be considered as a single string.

Here I paste my screenshot in powershell. Hope it could help.
double quotes
single quote

for you.

The double quotes for passing the token have also blocked me for quite some time. Due to the fact that the command returns a successful result, I didn't think about this possibility of a quoting issue. It would be nice if the documentation clearly mentions the quoting issue for the token argument and maybe even better: the command should return a failure when passing an invalid token argument with double quotes.

@ghost
Copy link

ghost commented May 26, 2020

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @narula0781, @ashishonce, @romil07.

@azure-sdk azure-sdk added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Sep 24, 2020
@RakeshMohanMSFT RakeshMohanMSFT self-assigned this Jan 9, 2023
@RakeshMohanMSFT
Copy link
Contributor

This PR Azure/azure-devops-cli-extension#1333 will fix the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. DevOps Documentation Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

9 participants