简体   繁体   English

如何在Azure中使用Python SDK设置enable_https_traffic_only?

[英]How do I set enable_https_traffic_only using Python SDK in Azure?

I am trying to write a Python script to enable "Secure transfer enabled" on an Azure storage account. 我正在尝试编写Python脚本以在Azure存储帐户上启用“已启用安全传输”。 I'm having some trouble understanding what I need to put in for the following piece of code: 我在理解以下代码所需的内容时遇到了一些麻烦:

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

I've tried just about every combination I can think of to set this value to true, has anyone got this scenario to work? 我已经尝试过几乎可以想到的每种组合来将此值设置为true,有人能使这种情况起作用吗?

Your code is not valid Python: 您的代码不是有效的Python:

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

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

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

相关问题 如何使用服务主体和 Python SDK 对 Azure 进行身份验证? - How do I authenticate to Azure using a Service Principal and the Python SDK? 如何使用 Python SDK 将身份设置为托管的 Azure 数据工厂? - How to set identity to managed for Azure Data Factory using Python SDK? 如何使用 python SDK 过滤 Azure 表中的特定行 - How do I filter specific rows in Azure Tables using python SDK 如何在 fiddler 中捕获 python https 流量? - How to capture python https traffic in fiddler? 如何使用机器学习在仅将流量作为输入的时间序列预测上制作一个好的功能? - How do I make a good feature using machine learning on a timeseries forecast that has only traffic volume as an input? 如何使用Python API为azure blob创建/设置新元数据并获取元数据? - How do I create/set a new metadata to an azure blob and get the metadata by using Python API? 如何使用Python发送经过身份验证的https请求? - How do I send authenticated https requests using Python? Azure Python SDK:如何在VM上设置自动关闭任务? - Azure Python SDK: How to set auto-shutdown task on VMs? 如何通过python SDK设置Azure表的属性 - How to set the properties of an Azure Table through python sdk 如何使用python SDK在couchbase中为存储桶启用主索引? - How to enable primary index for a bucket in couchbase using python SDK?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM