-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Storage] Support Table and Queue Encryption Service for storage account #11706
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
01b6399
initialize encryption key feature
Juliehzl 28a10a3
enable key type for queue
Juliehzl 5c117b6
add test
Juliehzl 6ef2025
uodate history
Juliehzl 6951ec3
fix style
Juliehzl ce3541e
update package version
Juliehzl 1712419
add test
Juliehzl a2f4e1d
add examples
Juliehzl 21f31f6
refine examples
Juliehzl a5869e1
remove Preview
Juliehzl 1556d04
refine help
Juliehzl b1d5ba2
fix style
Juliehzl aaaf0c3
refine history
Juliehzl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -159,6 +159,16 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem | |
help=" Allow the blob service to exhibit filesystem semantics. This property can be enabled only " | ||
"when storage account kind is StorageV2.", | ||
min_api='2018-02-01') | ||
c.argument('encryption_key_type_for_table', arg_type=get_enum_type(['Account', 'Service']), | ||
help='Set the encryption key type for Table service. "Account": Table will be encrypted ' | ||
'with account-scoped encryption key. "Service": Table will always be encrypted with ' | ||
'service-scoped keys. Currently the default encryption key type is "Service".', | ||
min_api='2019-06-01', options_list=['--encryption-key-type-for-table', '-t']) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is '-t' too simple for option? #Closed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it is a short name. |
||
c.argument('encryption_key_type_for_queue', arg_type=get_enum_type(['Account', 'Service']), | ||
help='Set the encryption key type for Queue service. "Account": Queue will be encrypted ' | ||
'with account-scoped encryption key. "Service": Queue will always be encrypted with ' | ||
'service-scoped keys. Currently the default encryption key type is "Service".', | ||
min_api='2019-06-01', options_list=['--encryption-key-type-for-queue', '-q']) | ||
|
||
with self.argument_context('storage account update', resource_type=ResourceType.MGMT_STORAGE) as c: | ||
c.register_common_storage_account_options() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
150 changes: 150 additions & 0 deletions
150
...modules/storage/tests/latest/recordings/test_storage_create_with_encryption_key_type.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,150 @@ | ||
interactions: | ||
- request: | ||
body: null | ||
headers: | ||
Accept: | ||
- application/json | ||
Accept-Encoding: | ||
- gzip, deflate | ||
CommandName: | ||
- storage account create | ||
Connection: | ||
- keep-alive | ||
ParameterSetName: | ||
- -n -g --kind -t -q | ||
User-Agent: | ||
- python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 | ||
azure-mgmt-resource/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.79 | ||
accept-language: | ||
- en-US | ||
method: GET | ||
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_storage_account_encryption000001?api-version=2019-07-01 | ||
response: | ||
body: | ||
string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_storage_account_encryption000001","name":"cli_storage_account_encryption000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2020-01-09T15:38:38Z"},"properties":{"provisioningState":"Succeeded"}}' | ||
headers: | ||
cache-control: | ||
- no-cache | ||
content-length: | ||
- '433' | ||
content-type: | ||
- application/json; charset=utf-8 | ||
date: | ||
- Thu, 09 Jan 2020 15:38:44 GMT | ||
expires: | ||
- '-1' | ||
pragma: | ||
- no-cache | ||
strict-transport-security: | ||
- max-age=31536000; includeSubDomains | ||
vary: | ||
- Accept-Encoding | ||
x-content-type-options: | ||
- nosniff | ||
status: | ||
code: 200 | ||
message: OK | ||
- request: | ||
body: '{"sku": {"name": "Standard_RAGRS"}, "kind": "StorageV2", "location": "eastus2euap", | ||
"properties": {"encryption": {"services": {"table": {"enabled": true, "keyType": | ||
"Account"}, "queue": {"enabled": true, "keyType": "Service"}}, "keySource": | ||
"Microsoft.Storage"}}}' | ||
headers: | ||
Accept: | ||
- application/json | ||
Accept-Encoding: | ||
- gzip, deflate | ||
CommandName: | ||
- storage account create | ||
Connection: | ||
- keep-alive | ||
Content-Length: | ||
- '263' | ||
Content-Type: | ||
- application/json; charset=utf-8 | ||
ParameterSetName: | ||
- -n -g --kind -t -q | ||
User-Agent: | ||
- python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 | ||
azure-mgmt-storage/7.1.0 Azure-SDK-For-Python AZURECLI/2.0.79 | ||
accept-language: | ||
- en-US | ||
method: PUT | ||
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_storage_account_encryption000001/providers/Microsoft.Storage/storageAccounts/cliencryption000002?api-version=2019-06-01 | ||
response: | ||
body: | ||
string: '' | ||
headers: | ||
cache-control: | ||
- no-cache | ||
content-length: | ||
- '0' | ||
content-type: | ||
- text/plain; charset=utf-8 | ||
date: | ||
- Thu, 09 Jan 2020 15:38:49 GMT | ||
expires: | ||
- '-1' | ||
location: | ||
- https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus2euap/asyncoperations/d8641a9c-2b25-42d1-9c6e-f15ef09124c0?monitor=true&api-version=2019-06-01 | ||
pragma: | ||
- no-cache | ||
server: | ||
- Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 | ||
strict-transport-security: | ||
- max-age=31536000; includeSubDomains | ||
x-content-type-options: | ||
- nosniff | ||
x-ms-ratelimit-remaining-subscription-writes: | ||
- '1198' | ||
status: | ||
code: 202 | ||
message: Accepted | ||
- request: | ||
body: null | ||
headers: | ||
Accept: | ||
- application/json | ||
Accept-Encoding: | ||
- gzip, deflate | ||
CommandName: | ||
- storage account create | ||
Connection: | ||
- keep-alive | ||
ParameterSetName: | ||
- -n -g --kind -t -q | ||
User-Agent: | ||
- python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 | ||
azure-mgmt-storage/7.1.0 Azure-SDK-For-Python AZURECLI/2.0.79 | ||
method: GET | ||
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus2euap/asyncoperations/d8641a9c-2b25-42d1-9c6e-f15ef09124c0?monitor=true&api-version=2019-06-01 | ||
response: | ||
body: | ||
string: '{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_storage_account_encryption000001/providers/Microsoft.Storage/storageAccounts/cliencryption000002","name":"cliencryption000002","type":"Microsoft.Storage/storageAccounts","location":"eastus2euap","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-01-09T15:38:49.1955953Z"},"table":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-01-09T15:38:49.1955953Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-01-09T15:38:49.1955953Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2020-01-09T15:38:49.1331246Z","primaryEndpoints":{"dfs":"https://cliencryption000002.dfs.core.windows.net/","web":"https://cliencryption000002.z3.web.core.windows.net/","blob":"https://cliencryption000002.blob.core.windows.net/","queue":"https://cliencryption000002.queue.core.windows.net/","table":"https://cliencryption000002.table.core.windows.net/","file":"https://cliencryption000002.file.core.windows.net/"},"primaryLocation":"eastus2euap","statusOfPrimary":"available","secondaryLocation":"centraluseuap","statusOfSecondary":"available","secondaryEndpoints":{"dfs":"https://cliencryption000002-secondary.dfs.core.windows.net/","web":"https://cliencryption000002-secondary.z3.web.core.windows.net/","blob":"https://cliencryption000002-secondary.blob.core.windows.net/","queue":"https://cliencryption000002-secondary.queue.core.windows.net/","table":"https://cliencryption000002-secondary.table.core.windows.net/"}}}' | ||
headers: | ||
cache-control: | ||
- no-cache | ||
content-length: | ||
- '1965' | ||
content-type: | ||
- application/json | ||
date: | ||
- Thu, 09 Jan 2020 15:39:08 GMT | ||
expires: | ||
- '-1' | ||
pragma: | ||
- no-cache | ||
server: | ||
- Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 | ||
strict-transport-security: | ||
- max-age=31536000; includeSubDomains | ||
transfer-encoding: | ||
- chunked | ||
vary: | ||
- Accept-Encoding | ||
x-content-type-options: | ||
- nosniff | ||
status: | ||
code: 200 | ||
message: OK | ||
version: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we define a CLIArgumentType (encryption_key_type) for reuse instead of defining for both table and queue? #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a little different. In this way, I haven't use CLIArugmentType.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, in the future, if there is more places to use this arg_type, we can extract them for re-use.
In reply to: 365073751 [](ancestors = 365073751)