Skip to content

Commit 024ced1

Browse files
[App Config] az appconfig create/update: Add developer sku support (#31199)
1 parent 0cf0a7b commit 024ced1

File tree

7 files changed

+18422
-19309
lines changed

7 files changed

+18422
-19309
lines changed

src/azure-cli/azure/cli/command_modules/appconfig/_help.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
examples:
1919
- name: Create an App Configuration store with name, location, sku, tags and resource group.
2020
text: az appconfig create -g MyResourceGroup -n MyAppConfiguration -l westus --sku Standard --tags key1=value1 key2=value2
21+
- name: Create an App Configuration store with Developer sku
22+
text: az appconfig create -g MyResourceGroup -n MyAppConfiguration -l westus --sku Developer
2123
- name: Create a premium sku App Configuration store with a replica
2224
text: az appconfig create -g MyResourceGroup -n MyAppConfiguration -l westus --sku Premium --replica-name MyReplica --replica-location eastus
2325
- name: Create a premium sku App Configuration store without a replica

src/azure-cli/azure/cli/command_modules/appconfig/_params.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def load_arguments(self, _):
160160
'For more information, see https://learn.microsoft.com/azure/azure-app-configuration/concept-enable-rbac')
161161

162162
with self.argument_context('appconfig create') as c:
163-
c.argument('sku', help='The sku of the App Configuration store', arg_type=get_enum_type(['Free', 'Premium', 'Standard']), validator=validate_sku)
163+
c.argument('sku', help='The sku of the App Configuration store', arg_type=get_enum_type(['Free', 'Developer', 'Premium', 'Standard']), validator=validate_sku)
164164
c.argument('location', options_list=['--location', '-l'], arg_type=get_location_type(self.cli_ctx), validator=get_default_location_from_resource_group)
165165
c.argument('tags', arg_type=tags_type, help="Space-separated tags: key[=value] [key[=value] ...].")
166166
c.argument('assign_identity', arg_type=identities_arg_type,
@@ -177,7 +177,7 @@ def load_arguments(self, _):
177177
c.argument('enable_arm_private_network_access', arg_type=enable_arm_private_network_access_arg_type)
178178

179179
with self.argument_context('appconfig update') as c:
180-
c.argument('sku', help='The sku of the App Configuration store', arg_type=get_enum_type(['Free', 'Premium', 'Standard']))
180+
c.argument('sku', help='The sku of the App Configuration store', arg_type=get_enum_type(['Free', 'Developer', 'Premium', 'Standard']))
181181
c.argument('tags', arg_type=tags_type)
182182
c.argument('enable_public_network', options_list=['--enable-public-network', '-e'], arg_type=get_three_state_flag(),
183183
help='When true, requests coming from public networks have permission to access this store while private endpoint is enabled. When false, only requests made through Private Links can reach this store.')
@@ -416,7 +416,7 @@ def load_arguments(self, _):
416416
with self.argument_context('appconfig snapshot create') as c:
417417
c.argument('filters', arg_type=snapshot_filter_arg_type)
418418
c.argument('composition_type', arg_type=get_enum_type(["key", "key_label"]), help='Composition type used in building App Configuration snapshots. If not specified, defaults to key.')
419-
c.argument('retention_period', type=int, help='Duration in seconds for which a snapshot can remain archived before expiry. A snapshot can be archived for a maximum of 7 days (604,800s) for free tier stores and 90 days (7,776,000s) for standard and premium tier stores. If specified, retention period must be at least 1 hour (3600s)')
419+
c.argument('retention_period', type=int, help='Duration in seconds for which a snapshot can remain archived before expiry. A snapshot can be archived for a maximum of 7 days (604,800s) for free and developer tier stores and 90 days (7,776,000s) for standard and premium tier stores. If specified, retention period must be at least 1 hour (3600s)')
420420
c.argument('tags', arg_type=tags_type, help="Space-separated tags: key[=value] [key[=value] ...].")
421421

422422
with self.argument_context('appconfig snapshot show') as c:

src/azure-cli/azure/cli/command_modules/appconfig/_validators.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ def validate_snapshot_import(namespace):
389389
def validate_sku(namespace):
390390
if namespace.sku.lower() == 'free':
391391
if (namespace.enable_purge_protection or namespace.retention_days or namespace.replica_name or namespace.replica_location or namespace.no_replica or namespace.enable_arm_private_network_access): # pylint: disable=too-many-boolean-expressions
392-
logger.warning("Options '--enable-purge-protection', '--replica-name', '--replica-location' , '--no-replica' and '--retention-days' will be ignored when creating a free store.")
392+
logger.warning("Options '--enable-purge-protection', '--replica-name', '--replica-location' , '--no-replica' , 'enable-arm-private-network-access' and '--retention-days' will be ignored when creating a free store.")
393393
namespace.retention_days = None
394394
namespace.enable_purge_protection = None
395395
namespace.replica_name = None
@@ -398,6 +398,16 @@ def validate_sku(namespace):
398398
namespace.enable_arm_private_network_access = None
399399
return
400400

401+
if namespace.sku.lower() == 'developer':
402+
if (namespace.enable_purge_protection or namespace.retention_days or namespace.replica_name or namespace.replica_location or namespace.no_replica): # pylint: disable=too-many-boolean-expressions
403+
logger.warning("Options '--enable-purge-protection', '--replica-name', '--replica-location' , '--no-replica' and '--retention-days' will be ignored when creating a developer store.")
404+
namespace.retention_days = None
405+
namespace.enable_purge_protection = None
406+
namespace.replica_name = None
407+
namespace.replica_location = None
408+
namespace.no_replica = None
409+
return
410+
401411
if namespace.sku.lower() == 'premium' and not namespace.no_replica:
402412
if any(arg is None for arg in [namespace.replica_name, namespace.replica_location]):
403413
raise RequiredArgumentMissingError("Options '--replica-name' and '--replica-location' are required when creating a premium tier store. To avoid creating replica please provide explicit argument '--no-replica'.")

0 commit comments

Comments
 (0)