Skip to content

Commit e326321

Browse files
authored
[App Service] az webapp update: Add parameter --platform-release-channel to support setting the platform release channel for the web app (#32811)
1 parent 159d014 commit e326321

11 files changed

+3019
-2968
lines changed

linter_exclusions.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3966,6 +3966,9 @@ webapp update:
39663966
force_dns_registration:
39673967
rule_exclusions:
39683968
- option_length_too_long
3969+
platform_release_channel:
3970+
rule_exclusions:
3971+
- option_length_too_long
39693972
skip_custom_domain_verification:
39703973
rule_exclusions:
39713974
- option_length_too_long

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2627,6 +2627,9 @@
26272627
- name: Update a web app. (autogenerated)
26282628
text: az webapp update --https-only true --name MyAppName --resource-group MyResourceGroup
26292629
crafted: true
2630+
- name: Update the platform release channel of a web app. Possible values are Latest, Standard, Extended.
2631+
text: az webapp update --platform-release-channel Extended --name MyAppName --resource-group MyResourceGroup
2632+
crafted: true
26302633
"""
26312634

26322635
helps['webapp vnet-integration'] = """

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
ASE_KINDS = ['ASEv3']
4242
PUBLIC_NETWORK_ACCESS_MODES = ['Enabled', 'Disabled']
4343
BASIC_AUTH_TYPES = ['Enabled', 'Disabled']
44+
PLATFORM_RELEASE_CHANNEL_TYPES = ['Standard', 'Latest', 'Extended']
4445
DAPR_LOG_LEVELS = ['debug', 'error', 'info', 'warn']
4546
INSTALL_SCRIPT_TYPES = ['RemoteAzureBlob', 'PlatformStorage']
4647
STORAGE_MOUNT_TYPES = ['AzureFiles', 'LocalStorage', 'FileShare']
@@ -454,6 +455,9 @@ def load_arguments(self, _):
454455
c.argument('end_to_end_encryption_enabled', options_list=['--end-to-end-encryption-enabled', '-e'],
455456
help='Enable or disable end-to-end encryption between the Front End and the Workers.',
456457
arg_type=get_three_state_flag(return_label=True))
458+
c.argument('platform_release_channel', options_list=['--platform-release-channel'],
459+
help='Set the platform release channel for the web app. Possible values: Latest, Standard, Extended.',
460+
arg_type=get_enum_type(PLATFORM_RELEASE_CHANNEL_TYPES))
457461

458462
with self.argument_context('webapp browse') as c:
459463
c.argument('logs', options_list=['--logs', '-l'], action='store_true',

src/azure-cli/azure/cli/command_modules/appservice/custom.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2153,7 +2153,8 @@ def set_webapp(cmd, resource_group_name, name, slot=None, skip_dns_registration=
21532153

21542154

21552155
def update_webapp(cmd, instance, client_affinity_enabled=None, https_only=None, minimum_elastic_instance_count=None,
2156-
prewarmed_instance_count=None, end_to_end_encryption_enabled=None):
2156+
prewarmed_instance_count=None, end_to_end_encryption_enabled=None,
2157+
platform_release_channel=None):
21572158
if 'function' in instance.kind:
21582159
raise ValidationError("please use 'az functionapp update' to update this function app")
21592160
if minimum_elastic_instance_count or prewarmed_instance_count:
@@ -2190,6 +2191,10 @@ def update_webapp(cmd, instance, client_affinity_enabled=None, https_only=None,
21902191
if prewarmed_instance_count is not None:
21912192
instance.site_config.pre_warmed_instance_count = prewarmed_instance_count
21922193

2194+
if platform_release_channel is not None:
2195+
use_additional_properties(instance)
2196+
instance.additional_properties["properties"]["platformReleaseChannel"] = platform_release_channel
2197+
21932198
return instance
21942199

21952200

src/azure-cli/azure/cli/command_modules/appservice/tests/latest/recordings/test_appservice_plan_identity_operations.yaml

Lines changed: 295 additions & 295 deletions
Large diffs are not rendered by default.

src/azure-cli/azure/cli/command_modules/appservice/tests/latest/recordings/test_functionapp_access_restriction_remove_scm.yaml

Lines changed: 190 additions & 570 deletions
Large diffs are not rendered by default.

src/azure-cli/azure/cli/command_modules/appservice/tests/latest/recordings/test_functionapp_container_config_set_replicas.yaml

Lines changed: 1103 additions & 1806 deletions
Large diffs are not rendered by default.

src/azure-cli/azure/cli/command_modules/appservice/tests/latest/recordings/test_webapp_hyperv_acr_use_identity.yaml

Lines changed: 295 additions & 295 deletions
Large diffs are not rendered by default.

src/azure-cli/azure/cli/command_modules/appservice/tests/latest/recordings/test_webapp_update_platform_release_channel.yaml

Lines changed: 1061 additions & 0 deletions
Large diffs are not rendered by default.

src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_webapp_commands.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2164,6 +2164,28 @@ def test_webapp_update(self, resource_group):
21642164
self.check('clientAffinityEnabled', True)
21652165
])
21662166

2167+
@AllowLargeResponse()
2168+
@ResourceGroupPreparer(location=WINDOWS_ASP_LOCATION_WEBAPP)
2169+
def test_webapp_update_platform_release_channel(self, resource_group):
2170+
webapp_name = self.create_random_name('webapp-prc-test', 40)
2171+
plan_name = self.create_random_name('webapp-prc-plan', 40)
2172+
self.cmd('appservice plan create -g {} -n {} --sku S1'
2173+
.format(resource_group, plan_name))
2174+
2175+
self.cmd('webapp create -g {} -n {} --plan {}'
2176+
.format(resource_group, webapp_name, plan_name))
2177+
2178+
# JMESPathCheck is not used here since platformReleaseChannel is not returned in the response of webapp show/list commands and we just want to make sure the update command goes through without any errors
2179+
# Set platform release channel to Extended
2180+
self.cmd('webapp update -g {} -n {} --platform-release-channel Extended'
2181+
.format(resource_group, webapp_name)).assert_with_checks([
2182+
JMESPathCheck('name', webapp_name)])
2183+
2184+
# Update platform release channel to Standard
2185+
self.cmd('webapp update -g {} -n {} --platform-release-channel Standard'
2186+
.format(resource_group, webapp_name)).assert_with_checks([
2187+
JMESPathCheck('name', webapp_name)])
2188+
21672189
@AllowLargeResponse()
21682190
@ResourceGroupPreparer(location=WINDOWS_ASP_LOCATION_WEBAPP)
21692191
def test_webapp_update_e2e_encryption(self, resource_group):

0 commit comments

Comments
 (0)