[英]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.