Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/azure-cli/azure/cli/command_modules/appconfig/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
examples:
- name: Create an App Configuration store with name, location, sku, tags and resource group.
text: az appconfig create -g MyResourceGroup -n MyAppConfiguration -l westus --sku Standard --tags key1=value1 key2=value2
- name: Create an App Configuration store with Developer sku
text: az appconfig create -g MyResourceGroup -n MyAppConfiguration -l westus --sku Developer
- name: Create a premium sku App Configuration store with a replica
text: az appconfig create -g MyResourceGroup -n MyAppConfiguration -l westus --sku Premium --replica-name MyReplica --replica-location eastus
- name: Create a premium sku App Configuration store without a replica
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def load_arguments(self, _):
'For more information, see https://learn.microsoft.com/azure/azure-app-configuration/concept-enable-rbac')

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

with self.argument_context('appconfig update') as c:
c.argument('sku', help='The sku of the App Configuration store', arg_type=get_enum_type(['Free', 'Premium', 'Standard']))
c.argument('sku', help='The sku of the App Configuration store', arg_type=get_enum_type(['Free', 'Developer', 'Premium', 'Standard']))
c.argument('tags', arg_type=tags_type)
c.argument('enable_public_network', options_list=['--enable-public-network', '-e'], arg_type=get_three_state_flag(),
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.')
Expand Down Expand Up @@ -416,7 +416,7 @@ def load_arguments(self, _):
with self.argument_context('appconfig snapshot create') as c:
c.argument('filters', arg_type=snapshot_filter_arg_type)
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.')
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)')
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)')
c.argument('tags', arg_type=tags_type, help="Space-separated tags: key[=value] [key[=value] ...].")

with self.argument_context('appconfig snapshot show') as c:
Expand Down
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.

Not related to this PR but it appears this warning misses private_network_access

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor

@albertofori albertofori Apr 15, 2025

Choose a reason for hiding this comment

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

Sorry I was talking about enable_arm_private_network_access?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I see, just updated the warning

Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ def validate_snapshot_import(namespace):
def validate_sku(namespace):
if namespace.sku.lower() == 'free':
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
logger.warning("Options '--enable-purge-protection', '--replica-name', '--replica-location' , '--no-replica' and '--retention-days' will be ignored when creating a free store.")
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.")
namespace.retention_days = None
namespace.enable_purge_protection = None
namespace.replica_name = None
Expand All @@ -398,6 +398,16 @@ def validate_sku(namespace):
namespace.enable_arm_private_network_access = None
return

if namespace.sku.lower() == 'developer':
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
logger.warning("Options '--enable-purge-protection', '--replica-name', '--replica-location' , '--no-replica' and '--retention-days' will be ignored when creating a developer store.")
namespace.retention_days = None
namespace.enable_purge_protection = None
namespace.replica_name = None
namespace.replica_location = None
namespace.no_replica = None
return

if namespace.sku.lower() == 'premium' and not namespace.no_replica:
if any(arg is None for arg in [namespace.replica_name, namespace.replica_location]):
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'.")
Expand Down
Loading