gpt4 book ai didi

python-3.x - 部署的Azure python函数无法运行,因为找不到 'azure.storage'模块

转载 作者:行者123 更新时间:2023-12-03 04:11:18 25 4
gpt4 key购买 nike

部署我的 Python 函数应用程序后,当我尝试在 Azure 云上运行它时,它失败并出现以下错误:如何在运行应用程序服务的计算机上安装 azure-storage?请帮忙。

导入 azure.functions 作为 func导入日期时间

导入操作系统、uuid、sys从 azure.storage.blob 导入 BlockBlobService、PublicAccess……......

最佳答案

连接到您的 Azure CLI,或者您也可以从 Azure 门户打开 Azure CLI。

创建存储帐户:

az 存储帐户创建 --name --location --resource-group --sku Standard_LRS

例如:-az storage account create --name apistorage --location westindia --resource-group apiGroup --sku Standard_LRS

创建资源组:

az group create --name --location

例如:-
az group create --name apiGroup --location westindia

现在您可以从 CLI 创建 Azure 函数:

例如:-az functionapp create --resource-group apiGroup --os-type Linux --conspiration-plan-location westindia --runtime python --name ServiceName --storage-account apistorage

引用:

https://learn.microsoft.com/en-us/azure/azure-functions/functions-create-first-function-python

关于python-3.x - 部署的Azure python函数无法运行,因为找不到 'azure.storage'模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56482234/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com