-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Closed
Labels
MgmtThis issue is related to a management-plane library.This issue is related to a management-plane library.Service AttentionWorkflow: This issue is responsible by Azure service team.Workflow: This issue is responsible by Azure service team.StorageStorage Service (Queues, Blobs, Files)Storage Service (Queues, Blobs, Files)customer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
Description
- azure-mgmt-storage
- 10.0.0 (2020-05-07)
- Python 3.7
I have a script that changes all storage accounts from LRS to GRS replication. When looking at the change history actions, I can also see that it turns HTTPS Only to False.
Steps to reproduce the behavior:
- When running this script:
#! /usr/bin/env python3
from azure.mgmt.storage import StorageManagementClient
from azure.mgmt.storage.models import StorageAccountUpdateParameters, Sku, SkuName
def list_storage_accounts(credentials, rgs):
print("Fetching storage accounts data")
storage_account_data = {}
for sub, groups in rgs.items():
storage_client = StorageManagementClient(credentials, sub)
for rg in groups:
storage_accounts = storage_client.storage_accounts.list_by_resource_group(
rg
)
for account in storage_accounts:
account_data = dict(
{
"name": account.name,
"sub": sub,
"resource_group": rg,
"sku": account.sku.name,
}
)
storage_account_data[account.name] = account_data
return storage_account_data
def change_sku(credentials, storage_accounts):
storage_container_data = {}
for account, config in storage_accounts.items():
storage_client = StorageManagementClient(credentials, config.get("sub"))
storage_container_data[account] = account
if (str(config.get("sku"))) == "SkuName.standard_lrs":
storage_client.storage_accounts.update(
config.get("resource_group"),
account,
StorageAccountUpdateParameters(sku=Sku(name=SkuName.standard_grs)),
)
print(f"Storage account {account} changed to standard_grs SKU")
def change_storage_sku(credentials, rgs):
storage_accounts = list_storage_accounts(credentials, rgs)
change_sku(credentials, storage_accounts)
You should then go to the change history of the bucket and see that both the storage account sku has change as well as "supportsHttpsTrafficOnly" if it was previously set to true.
Expected behavior
The change should be on LRS storage accounts to GRS, with no impact on HTTPS Only functionality.
Screenshots
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
MgmtThis issue is related to a management-plane library.This issue is related to a management-plane library.Service AttentionWorkflow: This issue is responsible by Azure service team.Workflow: This issue is responsible by Azure service team.StorageStorage Service (Queues, Blobs, Files)Storage Service (Queues, Blobs, Files)customer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
