【问题标题】:How do I set enable_https_traffic_only using Python SDK in Azure?如何在 Azure 中使用 Python SDK 设置 enable_https_traffic_only?
【发布时间】:2019-11-25 11:13:39
【问题描述】:

我正在尝试编写 Python 脚本以在 Azure 存储帐户上启用“已启用安全传输”。我无法理解我需要为以下代码输入的内容:

storage_account = storage_client.storage_accounts.update(
    GROUP_NAME, STORAGE_ACCOUNT_NAME, 
    StorageAccountUpdateParameters(enable_https_traffic_only(bool=true))
)

我已经尝试了几乎所有我能想到的将这个值设置为 true 的组合,有没有人让这个场景工作?

【问题讨论】:

    标签: python azure azure-storage azure-sdk-python


    【解决方案1】:

    您的代码不是有效的 Python:

    storage_account = storage_client.storage_accounts.update(
        GROUP_NAME, STORAGE_ACCOUNT_NAME, 
        StorageAccountUpdateParameters(enable_https_traffic_only = True)
    )
    

    此页面可能会有所帮助: https://github.com/Azure-Samples/storage-python-manage/blob/master/example.py

    【讨论】:

    • 感谢 Laurent - 我尝试了很多不同的组合,我粘贴的代码只是绝望中的最后一个。你的建议奏效了——救命!
    猜你喜欢
    • 1970-01-01
    • 2021-04-20
    • 2020-08-20
    • 2015-09-23
    • 1970-01-01
    • 2020-04-28
    • 1970-01-01
    • 2017-04-21
    • 2016-03-16
    相关资源
    最近更新 更多