简体   繁体   English

更改 Azure 存储 API 的 API 版本

[英]Change the API Version of the Azure Storage API

I'm trying to deploy a function app which downloads a file from an azure storage account.我正在尝试部署一个从 azure 存储帐户下载文件的函数应用程序。 Locally when I run the code it works fine with API Version 2020-10-02.当我在本地运行代码时,它适用于 API 版本 2020-10-02。 However, when running the code from an Azure Function it does not work and raises the following error: Result: Failure Exception: ValueError: Unsupported API version '2020-10-02'. Please select from: 2019-02-02 2019-07-07 2019-10-10 2019-12-12 2020-02-10 2020-04-08 2020-06-12但是,从 Azure 函数运行代码时,它不起作用并引发以下错误: Result: Failure Exception: ValueError: Unsupported API version '2020-10-02'. Please select from: 2019-02-02 2019-07-07 2019-10-10 2019-12-12 2020-02-10 2020-04-08 2020-06-12 Result: Failure Exception: ValueError: Unsupported API version '2020-10-02'. Please select from: 2019-02-02 2019-07-07 2019-10-10 2019-12-12 2020-02-10 2020-04-08 2020-06-12

I use the following code:我使用以下代码:

# Connect to CDE-Currated with the source list data
cdecurrated = DataLakeServiceClient.from_connection_string(
    conn_str)
logging.info('Connected to CDE-Currated')

# Get the csv file based on the request and convert to xml
sl_file = cdecurrated.get_file_client(
    file_system='source-list', 
    file_path=f'{request["file_path"]}/{request["file_name"]}'
)
df = pd.read_csv(BytesIO(sl_file.download_file().readall()))

Azure SDK for Python 中存在一个错误 - 我的同事在创建有问题的DataLakeServiceClient手动指定api-version使其工作。

As went thorugh the different Storage Service API version only API version '2020-10-02' as very less feature as comparsion to others.正如不同的存储服务 API 版本一样,只有API version '2020-10-02'与其他版本相比功能非常少。 This Error you are getting for API version 2020-10-02 is not supported with Azure Function. Azure Function 不支持您在 API 版本 2020-10-02 中遇到的此错误。 This Might be reason you are getting an error.这可能是您收到错误的原因。

Failure Exception: ValueError: Unsupported API version '2020-10-02'.失败异常:ValueError:不支持的 API 版本“2020-10-02”。 Please select from: 2019-02-02 2019-07-07 2019-10-10 2019-12-12 2020-02-10 2020-04-08 2020-06-12.请选择:2019-02-02 2019-07-07 2019-10-10 2019-12-12 2020-02-10 2020-04-08 2020-06-12。

Would Suggest you to please use the API version as recommanded in the Error or you can reach out to Azure Support or Can raise a GitHub Issue for root cause of this issue.建议您按照错误中的建议使用API version ,或者您可以联系 Azure 支持或可以针对此问题的根本原因提出GitHub问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 python 发布 api 创建 azure 存储帐户,其最低 TLS 版本为 1.1 - How to create a azure storage account with minmum TLS version as 1.1 using python post api 如何通过 Z3A580F142203677F1F0BC30898 托管 Azure Python API - How to host Azure Python API via Azure Data Storage 通过 REST API & ZA7F5F35426B923682317B 连接到 Azure 存储模拟器 - Connect to Azure Storage Emulator via REST API & Python Azure存储容器API请求身份验证因Django应用程序失败 - Azure storage container API request authentication failing with Django app 将 API JSON 响应直接保存到 Azure Blob 存储 json 文件 - Save API JSON Response directly to Azure Blob Storage json file 通过python API列出azure blob存储中的虚拟文件夹 - list virtual folders in azure blob storage via python API 如何使用Rest API查询Azure表存储 - How to query Azure table storage using rest API 通过 python API 获取 Windows Azure 存储表名称 - Fetching Windows Azure Storage tables names through python API 使用API​​共享密钥在azure Blob Storage中获取blob - Get blob in azure Blob Storage with API shared key 获取适用于Azure python delete_by_id方法的正确API版本 - Getting proper api version for azure python delete_by_id method
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM