Skip to content
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

{App Config} az appconfig: Add premium sku support #29417

Merged
merged 26 commits into from
Aug 26, 2024

Conversation

ChristineWanjau
Copy link
Contributor

@ChristineWanjau ChristineWanjau commented Jul 18, 2024

Related command

az appconfig create/update

Description

Adds new option to --sku argument in az appconfig update/create

Adds new arguments to az appconfig create i.e --replica-name, --replica-location and --no-replica
Either of the new arguments will be required when creating a premium tier app configuration store.

A user should either specify --no-replica or create a replica using --replica-name and --replica-location.

Testing Guide

  1. Create premium tier store without replica: ( az appconfig create -n <storename> -l <location> --sku Premium --no-replica)
  2. Create premium tier store with replica: ( az appconfig create -n <storename> -l <location> --sku Premium --replica-name <yourReplica> --replica-location <replicaLocation>)

History Notes

[Component Name 1] BREAKING CHANGE: az command a: Make some customer-facing breaking change
[Component Name 2] az command b: Add some customer-facing feature


This checklist is used to make sure that common guidelines for a pull request are followed.

Copy link

azure-client-tools-bot-prd bot commented Jul 18, 2024

️✔️AzureCLI-FullTest
️✔️acr
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️acs
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️advisor
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️ams
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️apim
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️appconfig
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️appservice
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️aro
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️backup
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️batch
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️batchai
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️billing
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️botservice
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️cdn
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️cloud
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️cognitiveservices
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️compute_recommender
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️config
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️configure
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️consumption
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️container
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️containerapp
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️core
️✔️2018-03-01-hybrid
️✔️3.11
️✔️3.12
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.11
️✔️3.12
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️cosmosdb
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️databoxedge
️✔️2019-03-01-hybrid
️✔️3.11
️✔️3.12
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️dla
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️dls
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️dms
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️eventgrid
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️eventhubs
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️feedback
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️find
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️hdinsight
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️identity
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️iot
️✔️2019-03-01-hybrid
️✔️3.11
️✔️3.12
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️keyvault
️✔️2018-03-01-hybrid
️✔️3.11
️✔️3.12
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️kusto
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️lab
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️managedservices
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️maps
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️marketplaceordering
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️monitor
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️mysql
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️netappfiles
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️network
️✔️2018-03-01-hybrid
️✔️3.11
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️policyinsights
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️privatedns
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️profile
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️rdbms
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️redis
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️relay
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️resource
️✔️2018-03-01-hybrid
️✔️3.11
️✔️3.12
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.11
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️role
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️search
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️security
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️servicebus
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️serviceconnector
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️servicefabric
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️signalr
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️sql
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️sqlvm
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️storage
️✔️2018-03-01-hybrid
️✔️3.11
️✔️3.12
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.11
️✔️3.12
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️synapse
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️telemetry
️✔️2018-03-01-hybrid
️✔️3.11
️✔️3.12
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.11
️✔️3.12
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️util
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9
️✔️vm
️✔️2018-03-01-hybrid
️✔️3.11
️✔️3.12
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.11
️✔️3.12
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.12
️✔️3.9

Copy link

azure-client-tools-bot-prd bot commented Jul 18, 2024

⚠️AzureCLI-BreakingChangeTest
⚠️appconfig
rule cmd_name rule_message suggest_message
⚠️ 1006 - ParaAdd appconfig create cmd appconfig create added parameter no_replica
⚠️ 1006 - ParaAdd appconfig create cmd appconfig create added parameter replica_location
⚠️ 1006 - ParaAdd appconfig create cmd appconfig create added parameter replica_name
⚠️ 1010 - ParaPropUpdate appconfig create cmd appconfig create update parameter sku: updated property choices from ['Free', 'Standard'] to ['Free', 'Premium', 'Standard']
⚠️ 1004 - CmdPropRemove appconfig replica delete cmd appconfig replica delete removed property confirmation
⚠️ 1010 - ParaPropUpdate appconfig update cmd appconfig update update parameter sku: updated property choices from ['Free', 'Standard'] to ['Free', 'Premium', 'Standard']

@yonzhan
Copy link
Collaborator

yonzhan commented Jul 18, 2024

AppConfig

@ChristineWanjau ChristineWanjau marked this pull request as ready for review July 25, 2024 12:34
@yonzhan
Copy link
Collaborator

yonzhan commented Jul 25, 2024

Please fix CI issues

@ChristineWanjau ChristineWanjau changed the title [AppConfig] az appconfig create Add premium sku support [AppConfig] az appconfig create/update: Add premium sku support Jul 25, 2024
@ChristineWanjau ChristineWanjau changed the title [AppConfig] az appconfig create/update: Add premium sku support [AppConfig] az appconfig create/update: Add premium sku support Jul 25, 2024
@@ -5,7 +5,8 @@

# pylint: disable=line-too-long
from knack.log import get_logger
from azure.core.exceptions import ResourceNotFoundError
from azure.core.exceptions import ResourceNotFoundError, HttpResponseError
from azure.cli.command_modules.appconfig._constants import StatusCodes
Copy link
Member

Choose a reason for hiding this comment

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

nit: from ._constants import ...

)
# Incase premium sku is not available in a given region yet. Temporary fix will be removed when premium is in all regions
except HttpResponseError as exception:
if exception.status_code == StatusCodes.BAD_REQUEST:
Copy link
Member

Choose a reason for hiding this comment

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

Can all this be 1 if statement so we would not need multiple else statements doing the same thing?

@yanzhudd
Copy link
Contributor

Please note that Azure CLI will have a code freeze on 07/30/2024 10:00 UTC for the upcoming release. If you want to catch this release train, please address all the comments ASAP, otherwise it has to be postponed to next sprint (09-03).

@zhoxing-ms
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

progress.spinner.step(label="Creating store")
config_store.wait(3)

if config_store.status() == ProvisioningStatus.SUCCEEDED and replica_name is not None:
Copy link
Member

Choose a reason for hiding this comment

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

What happens when store creation fails? Are we guaranteed an error will be thrown?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah it still throws an error. wait() function can throw error

@@ -269,13 +312,29 @@ def create_replica(cmd, client, store_name, name, location, resource_group_name=
replica_creation_parameters=replica_creation_params)


def delete_replica(cmd, client, store_name, name, resource_group_name=None):
def delete_replica(cmd, client, store_name, name, yes=False, resource_group_name=None):
Copy link
Member

@albertofori albertofori Aug 15, 2024

Choose a reason for hiding this comment

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

Just to confirm, this command already had a confirmation so this will not break users, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes the delete command already had a confirmation.


if config_store.sku.name.lower() == "premium" and len(list(replicas)) == 1:
user_confirmation(
"Deleting the last replica will disable geo-replication. When using the premium tier, it is recommended to have geo-replication enabled to take advantage of an increased SLA of 99.99%. The first replica created for a premium tier store is included. Do you want to continue with this operation?"
Copy link
Member

@albertofori albertofori Aug 15, 2024

Choose a reason for hiding this comment

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

Not exactly sure but how about this?

Deleting the last replica will disable geo-replication. It is recommended that a premium tier store have geo-replication enabled to take advantage of the 99.99% SLA. The first replica for a premium tier store comes at no additional cost.

Copy link
Member

Choose a reason for hiding this comment

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

We usually avoid documenting SLA in clients. We have dedicated documentation for SLAs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see, Although these were strings discussed by Jimmy and Joe. We have added them on portal as well. I can confirm with them on this.

Copy link
Member

@albertofori albertofori Aug 20, 2024

Choose a reason for hiding this comment

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

Perhaps, we can remove the numbers?

Deleting the last replica will disable geo-replication. It is recommended that a premium tier store have geo-replication enabled to take advantage of the improved SLA. The first replica for a premium tier store comes at no additional cost.

@avanigupta @ChristineWanjau Thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This makes sense to me. Updated

@@ -144,6 +159,9 @@ def load_arguments(self, _):
c.argument('disable_local_auth', arg_type=get_three_state_flag(), help='Disable all authentication methods other than AAD authentication.')
c.argument('retention_days', arg_type=retention_days_arg_type)
c.argument('enable_purge_protection', options_list=['--enable-purge-protection', '-p'], arg_type=get_three_state_flag(), help='Property specifying whether protection against purge is enabled for this App Configuration store. Setting this property to true activates protection against purge for this App Configuration store and its contents. Enabling this functionality is irreversible.')
c.argument('replica_name', arg_type=store_creation_replica_name_arg_type, help='Name of the replica of the App Configuration store.')
c.argument('replica_location', arg_type=replica_location_arg_type, help='Location of the replica of the App Configuration store.')
c.argument('no-replica', help='Proceed without replica creation for premium tier store.', arg_type=get_three_state_flag())
Copy link
Member

Choose a reason for hiding this comment

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

no_replica

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

replica_location=None,
no_replica=False):

if sku.lower() == 'premium' and not no_replica:
Copy link
Member

Choose a reason for hiding this comment

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

Are the new arguments supported for standard tier?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes they are. You can create a replica while creating a standard tier store, although --no-replica argument when provided will be ignored.

)
replicas = list_replica(cmd, client, store_name, resource_group_name)

if config_store.sku.name.lower() == "premium" and len(list(replicas)) == 1:
Copy link
Member

Choose a reason for hiding this comment

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

What if the provided replica name does not match the last replica name? The operation should fail without the need to display this warning.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently when you want to delete a replica and fail to provide the replica name that matches the last replica name/replica name that exists. We still ask for user confirmation and the operation doesn't fail.
I was thinking we should still show the warning if we also ask for confirmation with the current implementation. What do you think

Copy link
Member

Choose a reason for hiding this comment

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

ok, thanks! we can show the warning even if name does not match

retention_days = None
enable_purge_protection = None

__validate_replication(sku, replica_name, replica_location, no_replica)
Copy link
Member

Choose a reason for hiding this comment

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

I think we should move this validation to _validators.py

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We move the whole function to validators.py?

Copy link
Member

Choose a reason for hiding this comment

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

yes

Copy link
Member

Choose a reason for hiding this comment

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

@avanigupta I initially had a similar thought, but since this method jointly validates 3 arguments, I was wondering which of them the validation should be added to in params.

Copy link
Member

Choose a reason for hiding this comment

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

I think it should be on the sku.

Copy link
Member

Choose a reason for hiding this comment

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

The warning about free sku just above this code can also move to validators

Copy link
Contributor Author

@ChristineWanjau ChristineWanjau Aug 21, 2024

Choose a reason for hiding this comment

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

Moving the validation function to validators.py and adding it to the sku was causing tests to fail. I was getting an error - "Attribute "no-replica" or "replica-name" doesn't exist in Namespace. I moved it back to the custom.py.
I am thinking its because the arguments are in a different argument context than the sku argument.

@@ -18,6 +18,10 @@
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 name, location, resource group and premium sku with a replica
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- name: Create an App Configuration store with name, location, resource group and premium sku with a replica
- name: Create a premium sku App Configuration store with a replica

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This has been updated

@@ -18,6 +18,10 @@
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 name, location, resource group and premium sku with a replica
text: az appconfig create -g MyResourceGroup -n MyAppConfiguration -l westus --sku Premium --replica-name MyReplica --replica-location eastus
- name: Create an App Configuration store with name, location, resource group and premium sku without a replica
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- name: Create an App Configuration store with name, location, resource group and premium sku without a replica
- name: Create a premium sku App Configuration store without a replica

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This has been updated

if sku.lower() == 'free' and (enable_purge_protection or retention_days):
logger.warning("Options '--enable-purge-protection' and '--retention-days' will be ignored when creating a free store.")
if sku.lower() == 'free' and (enable_purge_protection or retention_days or replica_name or replica_location or no_replica):
logger.warning("Options '--enable-purge-protection', '--replica-name', '--replica-location' , 'no-replica' and '--retention-days' will be ignored when creating a free store.")
Copy link
Member

Choose a reason for hiding this comment

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

--no-replica

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

progress.spinner.step(label="Creating store")
config_store.wait(3)
config_store.wait(1)

if config_store.status() == ProvisioningStatus.SUCCEEDED and replica_name is not None:
Copy link
Member

Choose a reason for hiding this comment

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

nit: We do not need to check config_store.status() == ProvisioninsStatus.SUCCEEDED

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, updated

@yanzhudd yanzhudd changed the title [AppConfig] az appconfig create/update: Add premium sku support [App Config] az appconfig: Add premium sku support Aug 26, 2024
@yanzhudd yanzhudd merged commit ab94d05 into Azure:dev Aug 26, 2024
65 checks passed
albertofori added a commit to albertofori/azure-cli that referenced this pull request Aug 27, 2024
@yanzhudd yanzhudd changed the title [App Config] az appconfig: Add premium sku support {App Config} az appconfig: Add premium sku support Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants