Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def serialize(obj):
# State property doesn't make sense in feature flag version 2 schema beacuse of the added properties - variants, allocation, telemetry
# The State property only exists in the CLI, we should move to showing enabled property instead as the other clients
# As we move to showing the enabled property, we will show the state property in the CLI only if compatibility mode is true
env_compatibility_mode = os.environ.get("AZURE_APPCONFIG_FM_COMPATIBLE", True)
env_compatibility_mode = os.environ.get("AZURE_APPCONFIG_FM_COMPATIBLE", False)
compatibility_mode = str(env_compatibility_mode).lower() == "true"

feature = map_keyvalue_to_featureflag(obj, hide_enabled=compatibility_mode)
Expand Down
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 @@ -184,7 +184,7 @@ def __export_features(retrieved_features, naming_convention):
)
feature_flags_keyword = FeatureFlagConstants.FEATURE_FLAGS_KEY
try:
env_compatibility_mode = os.environ.get("AZURE_APPCONFIG_FM_COMPATIBLE", True)
env_compatibility_mode = os.environ.get("AZURE_APPCONFIG_FM_COMPATIBLE", False)
compatibility_mode = str(env_compatibility_mode).lower() == "true"
if compatibility_mode:
feature_reserved_keywords = FeatureManagementReservedKeywords.get_keywords(
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
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,16 @@ def validate_sku(namespace):
namespace.no_replica = None
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]):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,35 @@ def __init__(self, *args, **kwargs):
@AllowLargeResponse()
def test_azconfig_mgmt(self, resource_group, location):
mgmt_prefix = get_resource_name_prefix('MgmtTest')
config_store_name = self.create_random_name(prefix=mgmt_prefix, length=24)

# Create store with developer sku
developer_config_store_name = self.create_random_name(prefix=mgmt_prefix, length=24)
developer_sku = 'developer'
location = 'eastus'

self.kwargs.update({
'config_store_name': developer_config_store_name,
'rg_loc': location,
'rg': resource_group,
'sku': developer_sku
})

store = self.cmd('appconfig create -n {config_store_name} -g {rg} -l {rg_loc} --sku {sku}',
checks=[self.check('name', '{config_store_name}'),
self.check('location', '{rg_loc}'),
self.check('resourceGroup', resource_group),
self.check('provisioningState', 'Succeeded'),
self.check('sku.name', developer_sku)]).get_output_in_json()


self.cmd('appconfig show -n {config_store_name} -g {rg}',
checks=[self.check('name', '{config_store_name}'),
self.check('location', '{rg_loc}'),
self.check('resourceGroup', resource_group),
self.check('provisioningState', 'Succeeded'),
self.check('sku.name', developer_sku)])

config_store_name = self.create_random_name(prefix=mgmt_prefix, length=24)
standard_sku = 'standard'
premium_sku = 'premium'
tag_key = "key"
Expand Down
Loading