Skip to content

[Storage] az storage account create/update: Support sas&key policy#17815

Merged
evelyn-ys merged 3 commits intoAzure:devfrom
evelyn-ys:storage_account_policy
Apr 27, 2021
Merged

[Storage] az storage account create/update: Support sas&key policy#17815
evelyn-ys merged 3 commits intoAzure:devfrom
evelyn-ys:storage_account_policy

Conversation

@evelyn-ys
Copy link
Copy Markdown
Member

Description

Support set KeyPolicy and SASPolicy when creating or updating storage account

Testing Guide

az storage create/update -n mystorageaccount -g myresourcegroup --key-exp-days 3 --sas-exp 5.23:59:59


This checklist is used to make sure that common guidelines for a pull request are followed.

@evelyn-ys evelyn-ys self-assigned this Apr 22, 2021
@evelyn-ys evelyn-ys changed the title [Storage] az storage account create/update: Support sas&key policy expiration [Storage] az storage account create/update: Support sas&key policy Apr 22, 2021
@yonzhan yonzhan added this to the S186 milestone Apr 22, 2021
@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Apr 22, 2021

Storage

)

key_expiration_period_in_days_type = CLIArgumentType(
options_list=['--key-expiration-period-in-days', '--key-exp-days'], min_api='2021-02-01', type=int,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could I set the parameter with any int value? Typically days related parameter needs to be non-negative values. And is there a upper bound for the days?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No detail info from SDK or swagger. So I left value check for server side.


@api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2021-02-01')
@ResourceGroupPreparer(location='eastus', name_prefix='cli_storage_account')
def test_storage_account_with_key_and_sas_policy(self, resource_group):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add test with 100000 days because it is a workaround to disable as e-mail mentioned?

Copy link
Copy Markdown
Member Author

@evelyn-ys evelyn-ys Apr 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. Done~

@evelyn-ys evelyn-ys requested a review from Juliehzl April 27, 2021 02:12
@evelyn-ys evelyn-ys merged commit 5cf2ac3 into Azure:dev Apr 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants