【Azure Function】发布 Python Function 到 Azure 成功,但是无法显示Function列表

简介: 【Azure Function】发布 Python Function 到 Azure 成功,但是无法显示Function列表

问题描述

发布Python Function到Azure Function App服务,发布成功后,在Overview页面却无法查看到这个Function,进入Kudu站点,查看Function Log,发现错误信息为:

"module not found" error: "Failure Exception: ImportError: libpq.so.5: cannot open shared object file: No such file or directory. Cannot find module."

 

问题解答

经过调查,在网上发现相同的错误信息。 原因是无法加载psycopg2模块,需要使用 psycopg2-binary。

(在 requirements.txt 中,使用  psycopg2-binary )

 

根据文档提示修改后,Function显示并执行成功!

 

参考资料

Unable to get Azure Function Python 3.8 to work in Azure #1586: https://github.com/Azure/Azure-Functions/issues/1586

python function app works locally but not when deployed :https://learn.microsoft.com/en-us/answers/questions/174155/python-function-app-works-locally-but-not-when-dep

 

目录
打赏
0
0
0
0
203
分享
相关文章
【Azure Developer】分享两段Python代码处理表格(CSV格式)数据 : 根据每列的内容生成SQL语句
本文介绍了使用Python Pandas处理数据收集任务中格式不统一的问题。针对两种情况:服务名对应多人拥有状态(1/0表示),以及服务名与人名重复列的情况,分别采用双层for循环和字典数据结构实现数据转换,最终生成Name对应的Services列表(逗号分隔)。此方法高效解决大量数据的人工处理难题,减少错误并提升效率。文中附带代码示例及执行结果截图,便于理解和实践。
Python数据结构:列表、元组、字典、集合
Python 中的列表、元组、字典和集合是常用数据结构。列表(List)是有序可变集合,支持增删改查操作;元组(Tuple)与列表类似但不可变,适合存储固定数据;字典(Dictionary)以键值对形式存储,无序可变,便于快速查找和修改;集合(Set)为无序不重复集合,支持高效集合运算如并集、交集等。根据需求选择合适的数据结构,可提升代码效率与可读性。
|
3月前
|
C#
【Azure Function】Function App出现System.IO.FileNotFoundException异常
Exception while executing function: xxxxxxx,The type initializer for 'xxxxxx.Storage.Adls2.StoreDataLakeGen2Reading' threw an exception. Could not load file or assembly 'Microsoft.Extensions.Configuration, Version=9.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the
128 64
【Azure Function】C#独立工作模式下参数类型 ServiceBusReceivedMessage 无法正常工作
Cannot convert input parameter 'message' to type 'Azure.Messaging.ServiceBus.ServiceBusReceivedMessage' from type 'System.String'.
126 73
深入探讨 Python 列表与元组:操作技巧、性能特性与适用场景
Python 列表和元组是两种强大且常用的数据结构,各自具有独特的特性和适用场景。通过对它们的深入理解和熟练应用,可以显著提高编程效率和代码质量。无论是在数据处理、函数参数传递还是多线程环境中,合理选择和使用列表与元组都能够使得代码更加简洁、高效和安全。
57 9
【Azure Developer】编写Python SDK代码实现从China Azure中VM Disk中创建磁盘快照Snapshot
本文介绍如何使用Python SDK为中国区微软云(China Azure)中的虚拟机磁盘创建快照。通过Azure Python SDK的Snapshot Class,指定`location`和`creation_data`参数,使用`Copy`选项从现有磁盘创建快照。代码示例展示了如何配置Default Azure Credential,并设置特定于中国区Azure的`base_url`和`credential_scopes`。参考资料包括官方文档和相关API说明。
【Azure Function】Function App门户上的Test/Run返回错误:Failed to fetch
Running your function in portal requires the app to explicitly accept requests from https://portal.azure.cn. This is known as cross-origin resource sharing (CORS).Configure CORS to add https://portal.azure.cn to allowed origins.
[oeasy]python069_当前作用域都有些什么_列表dir_函数_builtins
本文介绍了Python中`dir()`函数的使用方法及其作用。`dir()`可以列出当前作用域内的所有变量和成员,类似于`locals()`,但`dir()`不仅限于本地变量,还能显示模块中的所有成员。通过`dir(__builtins__)`可以查看内建模块中的所有内建函数,如`print`、`ord`、`chr`等。此外,还回顾了`try-except-finally`结构在数据库连接中的应用,并解释了为何`print`函数可以直接使用而无需导入,因为它位于`__builtins__`模块中。最后,简要提及了删除`__builtins__.print`的方法及其影响。
38 0

热门文章

最新文章