【问题标题】:Deploy python functions to Azure function将 python 函数部署到 Azure 函数
【发布时间】:2021-12-12 03:43:35
【问题描述】:

我们有一个 python 提取函数,其工作原理如下:将音频文件(m4a 文件)提供给提取函数。然后该函数从音频文件中提取谐波并输出为json格式。

现在,我们正在尝试将这个 python 谐波提取函数部署到 Azure 函数。因此,我们只需将音频文件(例如 m4a)上传到 Azure blob,然后 python 提取功能就可以在云端处理上传的文件。但是我们不知道如何将音频文件从 Azure blob 提供给 Azure python 函数。

【问题讨论】:

    标签: python azure triggers azure-functions azure-blob-storage


    【解决方案1】:
    • 解决方法之一是在本地下载谐波提取 JSON 文件并从 azure 函数中读取该文件。
    • 另一种方法是直接读取 blob 文件,无需从 azure 函数下载(即连接到您的 azure 存储帐户)。

    参考:

    1. How to read a file from Azure Blob Container using Python in function app

    2. How to read json file from blob storage using Azure Functions Blob Trigger with Python - Stack Overflow

    3. python - Azure blob storage to JSON in azure function using SDK - Stack Overflow

    【讨论】:

    • 感谢您的回复!但我们的问题是我们不知道如何将音频文件从 blob(无需下载)馈送到部署的谐波提取功能。我们使用 audioread.audio_open(path) 在本地读取音频文件。但是,它不适用于 Azure 功能。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-08-12
    • 1970-01-01
    • 1970-01-01
    • 2017-08-01
    • 1970-01-01
    • 2020-10-06
    • 1970-01-01
    相关资源
    最近更新 更多