您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

在Azure函数中使用Python 3

在Azure函数中使用Python 3

目前有一个解决的问题:

但是,作为一种变通办法,所有内容在这里进行了解释(作者所有版权Murat Eken

2.1。转到“平台功能>所有设置>扩展> +添加

2.2。安装“ Python 3.6.2 x86”扩展。

2.3。转到“平台功能>应用程序设置

2.4。添加处理程序映射: 扩展名:fastCgi 处理器:D:\ home \ python362x86 \ python.exe 参数:D:\ home \ python362x86 \ wfastcgi.py

Azure函数-
处理程序映射以使用特定的python版本

2.5添加一个名为WEBSITE_USE_PLACEHOLDER的应用程序设置并将其值设置为0。这对于解决Azure函数问题(该问题导致Python扩展程序在卸载函数应用程序后停止工作)之前的工作是必需的。

2.6。保存您的应用设置。

这是我的功能输出 "3.6.2 (v3.6.2:5fd33b5, Jul 8 2017, 04:14:34) [MSC v.1900 32 bit (Intel)]"

您可以使用ARM模板自动化这些步骤,这是模板中有趣的部分:

{
  "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json",
  "contentVersion": "1.0.0.0",
  "parameters": {
    //...
  },
  "variables": {
    // ...
  },
  "resources": [
    // ...
    {
      "type": "Microsoft.Web/sites",
      // ...
      "kind": "functionapp",
      "properties": {
        // ...
        "siteConfig": {
          "handlerMappings": [{
            "arguments": "D:\\home\\python362x86\\wfastcgi.py",
            "extension": "fastCgi",
            "scriptProcessor": "D:\\home\\python362x86\\python.exe"
          }]
          // ...
        },
        "resources": [{
          "name": "python362x86",
          "type": "siteextensions",
          "apiVersion": "2016-08-01",
          "properties": {}
          // ...
        }]
        // ...
      }
    }
  ]
}
python 2022/1/1 18:37:55 有268人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶