-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Expose sku and managed identity for GA #11795
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 8 commits
b6db469
341fc00
a3251b7
a764e67
b0bf46d
1ff77a2
249ddfe
9431bf6
3ce80fb
dd24ba7
0a850ea
5e8c32d
40fd252
ad60331
08a473b
1dfc586
f8f5e4e
1d8c382
1585a52
0756703
f7b79fe
4b7e76e
c2f6f01
ddb9c64
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 |
|---|---|---|
|
|
@@ -20,7 +20,8 @@ | |
| validate_export, validate_import, | ||
| validate_import_depth, validate_query_fields, | ||
| validate_feature_query_fields, validate_filter_parameters, | ||
| validate_separator, validate_secret_identifier) | ||
| validate_separator, validate_secret_identifier, | ||
| validate_assigned_identity, validate_identities) | ||
|
|
||
|
|
||
| def load_arguments(self, _): | ||
|
|
@@ -63,14 +64,24 @@ def load_arguments(self, _): | |
| c.argument('top', arg_type=top_arg_type) | ||
| c.argument('all_', options_list=['--all'], action='store_true', help="List all items.") | ||
| c.argument('fields', arg_type=fields_arg_type) | ||
| c.argument('sku', help='The sku of App Configuration', arg_type=get_enum_type(['free', 'standard'])) | ||
|
|
||
| with self.argument_context('appconfig create') as c: | ||
| c.argument('location', options_list=['--location', '-l'], arg_type=get_location_type(self.cli_ctx), validator=get_default_location_from_resource_group) | ||
| c.ignore('sku') | ||
| c.argument('assign_identity', nargs='*', validator=validate_assigned_identity, is_preview=True, help="Accept system or user assigned identities separated by spaces. Use '[system]' to refer system assigned identity, or a resource id to refer user assigned identity. Check out help for more examples") | ||
shenmuxiaosen marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| with self.argument_context('appconfig update') as c: | ||
| c.argument('tags', arg_type=tags_type) | ||
|
|
||
| with self.argument_context('appconfig identity') as c: | ||
|
||
| c.argument('identities', nargs='*', validator=validate_identities) | ||
Juliehzl marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| with self.argument_context('appconfig identity assign') as c: | ||
| c.argument('identities', help="Accept system or user assigned identities separated by spaces. Use '[system]' to refer system assigned identity, or a resource id to refer user assigned identity. Check out help for more examples") | ||
shenmuxiaosen marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| with self.argument_context('appconfig identity remove') as c: | ||
| c.argument('identities', help="Accept system or user assigned identities separated by spaces. Use '[system]' to refer system assigned identity, '[all]' for all identities or a resource id to refer user assigned identity. Check out help for more examples") | ||
|
|
||
| with self.argument_context('appconfig credential regenerate') as c: | ||
| c.argument('id_', options_list=['--id'], help='Id of the key to be regenerated. Can be found using az appconfig credential list command.') | ||
|
|
||
|
|
@@ -79,7 +90,7 @@ def load_arguments(self, _): | |
| c.argument('prefix', help="This prefix will be appended to the front of imported keys. Prefix will be ignored for feature flags.") | ||
| c.argument('source', options_list=['--source', '-s'], arg_type=get_enum_type(['file', 'appconfig', 'appservice']), validator=validate_import, help="The source of importing. Note that importing feature flags from appservice is not supported.") | ||
| c.argument('yes', help="Do not prompt for preview.") | ||
| c.argument('skip_features', help="Import only key values and exclude all feature flags. By default, all feature flags will be imported from file or appconfig. Not applicable for appservice.", arg_type=get_three_state_flag()) | ||
| c.argument('skip_features', is_preview=True, help="Import only key values and exclude all feature flags. By default, all feature flags will be imported from file or appconfig. Not applicable for appservice.", arg_type=get_three_state_flag()) | ||
|
|
||
| with self.argument_context('appconfig kv import', arg_group='File') as c: | ||
| c.argument('path', help='Local configuration file path. Required for file arguments.') | ||
|
|
@@ -103,15 +114,15 @@ def load_arguments(self, _): | |
| c.argument('key', help='If no key specified, return all keys by default. Support star sign as filters, for instance abc* means keys with abc as prefix. Similarly, *abc and *abc* are also supported. Key filtering not applicable for feature flags. By default, all feature flags with specified label will be exported.') | ||
| c.argument('destination', options_list=['--destination', '-d'], arg_type=get_enum_type(['file', 'appconfig', 'appservice']), validator=validate_export, help="The destination of exporting. Note that exporting feature flags to appservice is not supported.") | ||
| c.argument('yes', help="Do not prompt for preview.") | ||
| c.argument('skip_features', help="Export only key values and exclude all feature flags. By default, all features with the specified label will be exported to file or appconfig. Not applicable for appservice.", arg_type=get_three_state_flag()) | ||
| c.argument('skip_features', is_preview=True, help="Export only key values and exclude all feature flags. By default, all features with the specified label will be exported to file or appconfig. Not applicable for appservice.", arg_type=get_three_state_flag()) | ||
|
|
||
| with self.argument_context('appconfig kv export', arg_group='File') as c: | ||
| c.argument('path', help='Local configuration file path. Required for file arguments.') | ||
| c.argument('format_', options_list=['--format'], arg_type=get_enum_type(['json', 'yaml', 'properties']), help='File format exporting to. Required for file arguments. Currently, feature flags are not supported in properties format.') | ||
| c.argument('depth', validator=validate_import_depth, help="Depth for flattening the json or yaml file to key-value pairs. Flatten to the deepest level by default. Not appicable for property files or feature flags.") | ||
| # bypass cli allowed values limition | ||
| c.argument('separator', validator=validate_separator, help="Delimiter for flattening the json or yaml file to key-value pairs. Required for importing hierarchical structure. Separator will be ignored for property files and feature flags. Supported values: '.', ',', ';', '-', '_', '__', '/', ':' ") | ||
| c.argument('naming_convention', arg_type=get_enum_type(['pascal', 'camel', 'underscore', 'hyphen']), help='Naming convention to be used for "Feature Management" section of file. Example: pascal = FeatureManagement, camel = featureManagement, underscore = feature_management, hyphen = feature-management.') | ||
| c.argument('naming_convention', is_preview=True, arg_type=get_enum_type(['pascal', 'camel', 'underscore', 'hyphen']), help='Naming convention to be used for "Feature Management" section of file. Example: pascal = FeatureManagement, camel = featureManagement, underscore = feature_management, hyphen = feature-management.') | ||
|
|
||
| with self.argument_context('appconfig kv export', arg_group='AppConfig') as c: | ||
| c.argument('dest_name', help='The name of the destination App Configuration.') | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -149,6 +149,26 @@ def validate_filter_parameter(string): | |
| return result | ||
|
|
||
|
|
||
| def validate_assigned_identity(namespace): | ||
| if namespace.assign_identity: | ||
| from msrestazure.tools import is_valid_resource_id | ||
|
|
||
| namespace.assign_identity = set(namespace.assign_identity) | ||
| for identity in namespace.assign_identity: | ||
| if identity != '[system]' and not is_valid_resource_id(identity): | ||
| raise CLIError("Invalid identity '{}'. Use '[system]' to refer system assigned identity, or a resource id to refer user assigned identity.".format(identity)) | ||
|
|
||
|
|
||
| def validate_identities(namespace): | ||
| if namespace.identities: | ||
| from msrestazure.tools import is_valid_resource_id | ||
|
|
||
| namespace.identities = set(namespace.identities) | ||
| for identity in namespace.identities: | ||
| if identity != '[system]' and identity != '[all]' and not is_valid_resource_id(identity): | ||
|
||
| raise CLIError("Invalid identity '{}'. Use '[system]' to refer system assigned identity '[all]' for all identities, or a resource id to refer user assigned identity.".format(identity)) | ||
|
|
||
|
|
||
| def validate_secret_identifier(namespace): | ||
| """ Validate the format of keyvault reference secret identifier """ | ||
| from azure.keyvault.key_vault_id import KeyVaultIdentifier | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.