azure - 如何在 Azure 函数应用中更改 LinuxFxVersion
问题描述
我有天蓝色的功能,LinuxFxVersion
设置为DOTNET
:
"siteProperties": {
"metadata": null,
"properties": [
{
"name": "LinuxFxVersion",
"value": "DOTNET|3.1"
},
{
"name": "WindowsFxVersion",
"value": null
}
],
"appSettings": null
},
我想将其设置为Python
:
"siteProperties": {
"metadata": null,
"properties": [
{
"name": "LinuxFxVersion",
"value": "Python|3.9"
},
{
"name": "WindowsFxVersion",
"value": null
}
],
"appSettings": null
},
根据msdn source,我需要使用 Power shell 来更改它:
az functionapp config set --name <func_name> --resource-group <rg> --linux-fx-version 'Python|3.9'
但我收到错误:
'3.9' is not recognized as an internal or external command,
operable program or batch file.
当我输入只是'Python'
我得到回应:
Operation returned an invalid status 'Bad Request'
如何将 Azure Function 中的 linux fx 版本从 .NET 更改为 Python?
解决方案
在 Powershell 中解决此错误的方法是将包含管道字符的字符串用引号括起来。
以下是多个示例:
az functionapp config set --name <func_name> --resource-group <rg> --linux-fx-version '"Python|3.9"'
az functionapp config set --name <func_name> --resource-group <rg> --linux-fx-version 'Python"|"3.9'
如果您在 bash 中运行上述命令,请使用 : 而不是 |
az functionapp config set --name <func_name> --resource-group <rg> --linux-fx-version "Python:3.9"
推荐阅读
- javascript - 无法在 Javascript 中访问数组数据
- css - 使用 Gulp 将 Bootstrap-Material Scss 转换为 CSS 会导致找不到导入
- ssms - SQL SMS 计算工作线之间的时间差
- vb.net - iTextSharp 不包括使用 PdfSmartCopy 的模板
- java - 从 Websphere 连接到数据库缓慢
- r - R中的计数器功能
- google-apps-script - 将工作表复制到另一个电子表格 (Google) 时出现 #REF 错误
- python - 如何使用 webdriver 选择签入和签出
- cryptography - 至少 256 位随机数的 C 库
- c# - 远程 json 的代理调用以避免 CORS 问题