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

If the application settings contain a !, it can't be set using az webapp config appsettings set #7147

Closed
gstrantor opened this Issue Aug 27, 2018 · 6 comments

Comments

Projects
None yet
3 participants
@gstrantor
Copy link

gstrantor commented Aug 27, 2018

When I try to set the application setting for a app service, the characters ^ and ! are ignored which are part of the string, I have tried using the quotes to no effect.

to replicate, try calling
call az webapp config appsettings set "serverpassword"="abcde!xyz"
I am using Microsoft Azure Command Prompt v2.9 on Windows 8.1 Pro build 6.3.9600

@tjprescott

This comment has been minimized.

Copy link
Member

tjprescott commented Aug 27, 2018

This sounds like an escaping issue. Did you try escaping the special characters with \! ?

@gstrantor

This comment has been minimized.

Copy link

gstrantor commented Aug 28, 2018

That didn't work, if I use abcde!xyz it saves abcde"xyz

@tjprescott

This comment has been minimized.

Copy link
Member

tjprescott commented Aug 28, 2018

If you run this with --debug you can see what string is actually being sent to the service. If it is sending a mangled string, then it is likely an escaping issue with your chosen shell (but could also be the CLI). If it is sending the correct string, then the issue is with the service doing some kind of string sanitization.

Note: please don't paste a debug trace in GitHub :)

@gstrantor

This comment has been minimized.

Copy link

gstrantor commented Aug 29, 2018

The String sent in the request body does not contain the ! character, so the filtering is happening on the shell itself (Windows Command prompt cmd.exe). The command arguments themselves omit the character.
That helped me to narrow down the issue to be escape characters for ! in command prompt. https://ss64.com/nt/syntax-esc.html helped me that it needs to be ^^!

@gstrantor gstrantor closed this Aug 29, 2018

@markheath

This comment has been minimized.

Copy link
Contributor

markheath commented Jan 5, 2019

I ran into the same issue with a close brackets ) character, and also had to escape it with ^^. Spent a very long time trying to get to the bottom of this. Any chance the docs could be updated to warn of this issue?

It might also be helpful if appsettings set provided an alternative way to get settings in that didn't suffer from this issue

@markheath

This comment has been minimized.

Copy link
Contributor

markheath commented Jan 14, 2019

Another scenario in which az webapp config appsettings set is almost unusable is trying to use the new WEBSITE_RUN_FROM_PACKAGE feature. To successfully escape the & character in the SAS URI I had to replace them all with ^^^&

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment