【问题标题】:Can't pull proper information with Azure python SDK or update storage account无法使用 Azure python SDK 提取正确信息或更新存储帐户
【发布时间】:2020-11-27 02:49:21
【问题描述】:

我正在尝试通过 Azure python SDK 更新 Azure 存储帐户。我按照文档进行操作,可以很好地针对 Azure 进行身份验证。

但是,当我运行代码来更新存储帐户的参数时,我收到以下错误: 'minimum_tls_version 不是类 的已知属性,将被忽略'

来自微软的引用说它应该存在:https://docs.microsoft.com/en-us/python/api/azure-mgmt-storage/azure.mgmt.storage.v2019_06_01.models.storageaccountupdateparameters?view=azure-python

有问题的代码: storage_account = self.storage.storage_accounts.update(resource_group, storage_account_name, StorageAccountUpdateParameters(enable_https_traffic_only=True, minimum_tls_version='TLS1_1' ))

感谢任何帮助或指导。

【问题讨论】:

    标签: python azure azure-storage azure-storage-account


    【解决方案1】:

    该参数是2020-6-22发布的11.1.0版本中新增的参数。你有机会使用旧包吗?该文档将仅显示最新的。

    ChangeLog 在 PyPI 上可用:https://pypi.org/project/azure-mgmt-storage/

    (我在 MS SDK 团队工作)

    【讨论】:

    • 是的,我刚刚检查了它是否已正确更新。也许我错了: self.storage = StorageManagementClient(credentials, SUBSCRIPTION) self.client.providers.register('Microsoft.Storage') storage_account = self.storage.storage_accounts.update(resource_group, storage_account_name, StorageAccountUpdateParameters(enable_https_traffic_only= True,allow_blob_public_access=False))
    • 想通了:我已经下载了最新的 Azure 存储 SDK,但它没有。我去下载了最新版本,特别是 11.1.0 感谢您的洞察力! SDK 上的扎实工作
    • 谢谢!我很高兴它现在可以工作了:)。在 Stackoverflow 之上,如果您有任何问题,您也可以随时在 Github 上提问 github.com/Azure/azure-sdk-for-python/issues。好好休息一天:)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-09-19
    • 1970-01-01
    • 2019-01-14
    • 1970-01-01
    • 2023-02-11
    • 1970-01-01
    相关资源
    最近更新 更多