简体   繁体   English

az cli 2.0 ... az webapp 创建运行时 php|7.1 错误

[英]az cli 2.0 … az webapp create runtime php|7.1 error

I am doing the following tutorial instructions.我正在执行以下教程说明。 I using the CLI 2.0 that is integrated in the azure portal.我使用集成在 azure 门户中的 CLI 2.0。 Not the version on my laptop.不是我笔记本电脑上的版本。

https://docs.microsoft.com/en-us/azure/app-service/app-service-web-get-started-php https://docs.microsoft.com/en-us/azure/app-service/app-service-web-get-started-php

az webapp create --resource-group xxxx-DevGroup --plan xxxxServicePlan --name hello --runtime "php|7.1" --deployment-local-git

and at the instruction to create the webapp i am getting this error:在创建 webapp 的说明中,我收到此错误:

'7.1' is not recognized as an internal or external command,

The runtimes 7.0 and 7.1 are supported.支持运行时 7.0 和 7.1。 I also tried these variations without success.我也尝试过这些变体,但没有成功。

php|7.1. I also tried php|7.0,  "php|7.1" and "php|7.0"

Any pointers to fix this issue would be appreciated任何解决此问题的指针将不胜感激

If you're using PowerShell, you need to do this:如果您使用的是 PowerShell,则需要执行以下操作:

az --% webapp create az --% webapp 创建

The problem is az is escaping your string's bar "node|6.9", the --% disables it.问题是 az 正在转义您的字符串栏“node|6.9”, --% 禁用了它。

According to the error log, it seems that you use a older version.根据错误日志,您似乎使用的是旧版本。 You could use az -v to check version.您可以使用az -v来检查版本。

I test it on 2.0.7 and Azure Cloud Shell , they all work for me.我在 2.0.7 和Azure Cloud Shell上对其进行了测试,它们都对我有用。

在此处输入图片说明

I suggest you could upgrade your azure cli version or execute the command on Azure Cloud Shell .我建议您可以升级您的 azure cli 版本或在Azure Cloud Shell上执行该命令。

In PowerShell, the |在 PowerShell 中, | will be seen als a command.将被视为命令。 Use single quotes to escape your string.使用单引号来转义您的字符串。

--runtime '"php|7.1"'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM