-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[Storage] az storage account create: Add edge zone support
#17528
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,7 @@ | |
| from azure.cli.core.profiles import ResourceType | ||
| from azure.cli.core.commands.validators import get_default_location_from_resource_group | ||
| from azure.cli.core.commands.parameters import (tags_type, file_type, get_location_type, get_enum_type, | ||
| get_three_state_flag) | ||
| get_three_state_flag, edge_zone_type) | ||
| from azure.cli.core.local_context import LocalContextAttribute, LocalContextAction, ALL | ||
|
|
||
| from ._validators import (get_datetime_type, validate_metadata, get_permission_validator, get_permission_help_string, | ||
|
|
@@ -270,6 +270,7 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem | |
| help='The minimum TLS version to be permitted on requests to storage. ' | ||
| 'The default interpretation is TLS 1.0 for this property') | ||
| c.argument('allow_shared_key_access', allow_shared_key_access_type) | ||
| c.argument('edge_zone', edge_zone_type, min_api='2020-08-01-preview') | ||
|
Member
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. Does it take any string or have a allowed values' list?
Contributor
Author
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. There is no way to get allowed values now unless you know service design. We will add a document link here when service team is ready.
Member
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.
Contributor
Author
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. as different RP has different api version restriction, so we cannot make it global.
Member
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. I mean |
||
|
|
||
| with self.argument_context('storage account private-endpoint-connection', | ||
| resource_type=ResourceType.MGMT_STORAGE) as c: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,243 @@ | ||
| interactions: | ||
| - request: | ||
| body: '{"sku": {"name": "Premium_LRS"}, "kind": "StorageV2", "location": "eastus2euap", | ||
| "extendedLocation": {"name": "microsoftrrdclab1", "type": "EdgeZone"}, "properties": | ||
| {"encryption": {"services": {"blob": {}}, "keySource": "Microsoft.Storage"}}}' | ||
| headers: | ||
| Accept: | ||
| - application/json | ||
| Accept-Encoding: | ||
| - gzip, deflate | ||
| CommandName: | ||
| - storage account create | ||
| Connection: | ||
| - keep-alive | ||
| Content-Length: | ||
| - '243' | ||
| Content-Type: | ||
| - application/json | ||
| ParameterSetName: | ||
| - -n -g --edge-zone -l --sku | ||
| User-Agent: | ||
| - AZURECLI/2.21.0 azsdk-python-azure-mgmt-storage/17.0.0 Python/3.7.7 (Windows-10-10.0.19041-SP0) | ||
| method: PUT | ||
| uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cliedgezone000001/providers/Microsoft.Storage/storageAccounts/edge1000002?api-version=2021-01-01 | ||
| response: | ||
| body: | ||
| string: '' | ||
| headers: | ||
| cache-control: | ||
| - no-cache | ||
| content-length: | ||
| - '0' | ||
| content-type: | ||
| - text/plain; charset=utf-8 | ||
| date: | ||
| - Wed, 31 Mar 2021 09:21:32 GMT | ||
| expires: | ||
| - '-1' | ||
| location: | ||
| - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus2euap/asyncoperations/32693f32-3ca8-42f1-909d-7502a8dc43bd?monitor=true&api-version=2021-01-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: | ||
| - '1199' | ||
| status: | ||
| code: 202 | ||
| message: Accepted | ||
| - request: | ||
| body: null | ||
| headers: | ||
| Accept: | ||
| - '*/*' | ||
| Accept-Encoding: | ||
| - gzip, deflate | ||
| CommandName: | ||
| - storage account create | ||
| Connection: | ||
| - keep-alive | ||
| ParameterSetName: | ||
| - -n -g --edge-zone -l --sku | ||
| User-Agent: | ||
| - AZURECLI/2.21.0 azsdk-python-azure-mgmt-storage/17.0.0 Python/3.7.7 (Windows-10-10.0.19041-SP0) | ||
| method: GET | ||
| uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus2euap/asyncoperations/32693f32-3ca8-42f1-909d-7502a8dc43bd?monitor=true&api-version=2021-01-01 | ||
| response: | ||
| body: | ||
| string: '{"extendedLocation":{"type":"EdgeZone","name":"microsoftrrdclab1"},"sku":{"name":"Premium_LRS","tier":"Premium"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cliedgezone000001/providers/Microsoft.Storage/storageAccounts/edge1000002","name":"edge1000002","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":"2021-03-31T09:21:32.0697122Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2021-03-31T09:21:32.0697122Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2021-03-31T09:21:31.9634141Z","primaryEndpoints":{"web":"https://edge1000002.web.microsoftrrdclab1.edgestorage.azure.net/","blob":"https://edge1000002.blob.microsoftrrdclab1.edgestorage.azure.net/"},"primaryLocation":"eastus2euap","statusOfPrimary":"available"}}' | ||
| headers: | ||
| cache-control: | ||
| - no-cache | ||
| content-length: | ||
| - '1197' | ||
| content-type: | ||
| - application/json | ||
| date: | ||
| - Wed, 31 Mar 2021 09:21:50 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 | ||
| - request: | ||
| body: null | ||
| headers: | ||
| Accept: | ||
| - application/json | ||
| Accept-Encoding: | ||
| - gzip, deflate | ||
| CommandName: | ||
| - storage account create | ||
| Connection: | ||
| - keep-alive | ||
| ParameterSetName: | ||
| - -n -g --edge-zone --sku | ||
| User-Agent: | ||
| - python/3.7.7 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 | ||
| azure-mgmt-resource/12.0.0 Azure-SDK-For-Python AZURECLI/2.21.0 | ||
| accept-language: | ||
| - en-US | ||
| method: GET | ||
| uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cliedgezone000001?api-version=2020-10-01 | ||
| response: | ||
| body: | ||
| string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cliedgezone000001","name":"cliedgezone000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2021-03-31T09:21:23Z"},"properties":{"provisioningState":"Succeeded"}}' | ||
| headers: | ||
| cache-control: | ||
| - no-cache | ||
| content-length: | ||
| - '428' | ||
| content-type: | ||
| - application/json; charset=utf-8 | ||
| date: | ||
| - Wed, 31 Mar 2021 09:21:50 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": "Premium_LRS"}, "kind": "StorageV2", "location": "westus", | ||
| "extendedLocation": {"name": "microsoftlosangeles1", "type": "EdgeZone"}, "properties": | ||
| {"encryption": {"services": {"blob": {}}, "keySource": "Microsoft.Storage"}}}' | ||
| headers: | ||
| Accept: | ||
| - application/json | ||
| Accept-Encoding: | ||
| - gzip, deflate | ||
| CommandName: | ||
| - storage account create | ||
| Connection: | ||
| - keep-alive | ||
| Content-Length: | ||
| - '241' | ||
| Content-Type: | ||
| - application/json | ||
| ParameterSetName: | ||
| - -n -g --edge-zone --sku | ||
| User-Agent: | ||
| - AZURECLI/2.21.0 azsdk-python-azure-mgmt-storage/17.0.0 Python/3.7.7 (Windows-10-10.0.19041-SP0) | ||
| method: PUT | ||
| uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cliedgezone000001/providers/Microsoft.Storage/storageAccounts/edge2000003?api-version=2021-01-01 | ||
| response: | ||
| body: | ||
| string: '' | ||
| headers: | ||
| cache-control: | ||
| - no-cache | ||
| content-length: | ||
| - '0' | ||
| content-type: | ||
| - text/plain; charset=utf-8 | ||
| date: | ||
| - Wed, 31 Mar 2021 09:21:56 GMT | ||
| expires: | ||
| - '-1' | ||
| location: | ||
| - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/westus/asyncoperations/c547edc5-994e-4791-994f-f4a4f1ef0c90?monitor=true&api-version=2021-01-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: | ||
| - '*/*' | ||
| Accept-Encoding: | ||
| - gzip, deflate | ||
| CommandName: | ||
| - storage account create | ||
| Connection: | ||
| - keep-alive | ||
| ParameterSetName: | ||
| - -n -g --edge-zone --sku | ||
| User-Agent: | ||
| - AZURECLI/2.21.0 azsdk-python-azure-mgmt-storage/17.0.0 Python/3.7.7 (Windows-10-10.0.19041-SP0) | ||
| method: GET | ||
| uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/westus/asyncoperations/c547edc5-994e-4791-994f-f4a4f1ef0c90?monitor=true&api-version=2021-01-01 | ||
| response: | ||
| body: | ||
| string: '{"extendedLocation":{"type":"EdgeZone","name":"microsoftlosangeles1"},"sku":{"name":"Premium_LRS","tier":"Premium"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cliedgezone000001/providers/Microsoft.Storage/storageAccounts/edge2000003","name":"edge2000003","type":"Microsoft.Storage/storageAccounts","location":"westus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2021-03-31T09:21:55.9811523Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2021-03-31T09:21:55.9811523Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2021-03-31T09:21:55.9030063Z","primaryEndpoints":{"web":"https://edge2000003.web.microsoftlosangeles1.edgestorage.azure.net/","blob":"https://edge2000003.blob.microsoftlosangeles1.edgestorage.azure.net/"},"primaryLocation":"westus"}}' | ||
| headers: | ||
| cache-control: | ||
| - no-cache | ||
| content-length: | ||
| - '1166' | ||
| content-type: | ||
| - application/json | ||
| date: | ||
| - Wed, 31 Mar 2021 09:22:13 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 |
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.
Add a min_api?
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.
How do users know allowed values?
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.
see #17528 (comment)