azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

WebApp:can't recognize "|" character correctly in “az webapp create” command in powershell

Open hanhsia opened this issue 6 years ago • 7 comments

az feedback auto-generates most of the information requested below, as of CLI version 2.0.62

Describe the bug

following command works well in cmd window but fails in powershell az login az configure --defaults group="" location="" az webapp create --name "" --plan "" -r "DOTNETCORE|3.1" it reports following error '3.1' is not recognized as an internal or external command, operable program or batch file. To Reproduce

run following command in powershell: az login az configure --defaults group="" location="" az webapp create --name "" --plan "" -r "DOTNETCORE|3.1"

Expected behavior

a webapp hosted .net core app should be created successfully. Environment summary

az --version

azure-cli 2.14.1

core 2.14.1 telemetry 1.0.6

Extensions: application-insights 0.1.11 azure-iot 0.10.3 Additional context

it looks like a powershell issue but my suggestion is not using "|" character in the string.

hanhsia avatar Nov 08 '20 13:11 hanhsia

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @AzureAppServiceCLI, @antcp.

ghost avatar Nov 08 '20 23:11 ghost

webapp

yonzhan avatar Nov 08 '20 23:11 yonzhan

hi @hanhsia could you pls does this https://github.com/Azure/azure-cli/blob/dev/doc/quoting-issues-with-powershell.md#workaround-the-stop-parsing-symbol work for you?

yungezz avatar Nov 09 '20 01:11 yungezz

You can solve this by "double escaping" in powershell.

--runtime '"node|12-lts"'

Working example:

az webapp create  --name "$FrontendAppName" --resource-group "$ResourceGroup" --plan $Plan --runtime '"node|12-lts"'

Strepto avatar Nov 09 '20 15:11 Strepto

yes, i use this way to workaround it. The doc is great.

hanhsia avatar Nov 10 '20 03:11 hanhsia

happy to see if works for you. :) is it ok to close the issue?

yungezz avatar Nov 10 '20 03:11 yungezz

sure, please close it.

hanhsia avatar Nov 12 '20 02:11 hanhsia