Skip to content

Commit 9309159

Browse files
authored
[App Service] Fix webapp list-runtimes config delimiter to use colon instead of pipe
1 parent be83d3c commit 9309159

4 files changed

Lines changed: 14 additions & 7 deletions

File tree

src/azure-cli/HISTORY.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Release History
3030
* `az appservice plan`: Remove preview flag for managed instance app service plans (#33690)
3131
* `az appservice plan`: Add Premium V3 SKU support (`P0V3`, `P1-3V3`, `P1-5MV3`) for managed instances (#33690)
3232
* `az webapp troubleshoot status`: Provide latest application startup attempt data (#33673)
33+
* `az webapp list-runtimes`: Change `config` field delimiter from `|` to `:` so the value can be passed directly to `az webapp create --runtime` on all platforms including Windows (#33822)
3334

3435
**ARM**
3536

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ def load_arguments(self, _):
797797
c.argument('login_with_github', help='Interactively log in with GitHub to retrieve the Personal Access Token', action='store_true')
798798

799799
with self.argument_context('webapp deployment github-actions add')as c:
800-
c.argument('runtime', options_list=['--runtime', '-r'], help='Canonicalized web runtime in the format of Framework|Version, e.g. "PHP|5.6". Use "az webapp list-runtimes" for available list.')
800+
c.argument('runtime', options_list=['--runtime', '-r'], help='Canonicalized web runtime in the format of Framework:Version, e.g. "PHP:5.6". Use "az webapp list-runtimes" for available list.')
801801
c.argument('force', options_list=['--force', '-f'], help='When true, the command will overwrite any workflow file with a conflicting name.', action='store_true')
802802

803803
with self.argument_context('webapp deployment source config-zip')as c:

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7719,7 +7719,7 @@ def get_stacks_as_table(self, runtime_filter=None, support_filter=None):
77197719
'os': stack.os,
77207720
'runtime': stack.runtime_family,
77217721
'version': stack.version_label or '',
7722-
'config': stack.display_name,
7722+
'config': stack.display_name.replace(self.DEFAULT_DELIMETER, ':'),
77237723
'support': support_status,
77247724
'end_of_life': stack.eol_date or '-',
77257725
})

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

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2025,9 +2025,15 @@ class TestStackRuntimeJavaSELinux(unittest.TestCase):
20252025
aggregate container's position in the response mattering.
20262026
"""
20272027

2028-
EXPECTED = {
2028+
EXPECTED_DISPLAY_NAMES = {
20292029
'JAVA|25-java25', 'JAVA|21-java21', 'JAVA|17-java17', 'JAVA|11-java11', 'JAVA|8-jre8',
20302030
}
2031+
# config field uses ':' delimiter so the value can be passed directly to 'az webapp create --runtime'
2032+
EXPECTED_CONFIGS = {
2033+
'JAVA:25-java25', 'JAVA:21-java21', 'JAVA:17-java17', 'JAVA:11-java11', 'JAVA:8-jre8',
2034+
}
2035+
# Keep EXPECTED as an alias for backward-compat with display_name-based assertions
2036+
EXPECTED = EXPECTED_DISPLAY_NAMES
20312037

20322038
FULL_RUNTIMES = [
20332039
{'runtimeVersion': '8', 'runtime': 'JAVA|8-jre8'},
@@ -2094,7 +2100,7 @@ def test_aggregate_runtimes_array_complete(self):
20942100
aggregate = self._minor('SE', _TypespecContainerSettings(
20952101
{'isAutoUpdate': True, 'runtimes': self.FULL_RUNTIMES}, is_auto_update=True))
20962102
stack = self._java_se_stack([aggregate] + self._patch_minors())
2097-
self.assertEqual(self._java_se_configs(stack), self.EXPECTED)
2103+
self.assertEqual(self._java_se_configs(stack), self.EXPECTED_CONFIGS)
20982104

20992105
def test_aggregate_javaNNRuntime_keys(self):
21002106
# Fallback path: no 'runtimes' array, but the Mapping exposes individual
@@ -2110,15 +2116,15 @@ def test_aggregate_javaNNRuntime_keys(self):
21102116
},
21112117
is_auto_update=True))
21122118
stack = self._java_se_stack([aggregate] + self._patch_minors())
2113-
self.assertEqual(self._java_se_configs(stack), self.EXPECTED)
2119+
self.assertEqual(self._java_se_configs(stack), self.EXPECTED_CONFIGS)
21142120

21152121
def test_aggregate_not_first_selected_by_auto_update(self):
21162122
# The aggregate auto-update container must be chosen by its is_auto_update
21172123
# flag, not its position -- here it is returned last, after the per-patch minors.
21182124
aggregate = self._minor('SE', _TypespecContainerSettings(
21192125
{'isAutoUpdate': True, 'runtimes': self.FULL_RUNTIMES}, is_auto_update=True))
21202126
stack = self._java_se_stack(self._patch_minors() + [aggregate])
2121-
self.assertEqual(self._java_se_configs(stack), self.EXPECTED)
2127+
self.assertEqual(self._java_se_configs(stack), self.EXPECTED_CONFIGS)
21222128

21232129
def test_typed_attrs_only_expose_java_8_11_but_mapping_has_all(self):
21242130
# Reproduces the exact regression: the SDK types only java8_runtime /
@@ -2131,7 +2137,7 @@ def test_typed_attrs_only_expose_java_8_11_but_mapping_has_all(self):
21312137
# Sanity-check the model: typed attrs cover only 8/11, additional_properties empty.
21322138
self.assertEqual(aggregate.stack_settings.linux_container_settings.additional_properties, [])
21332139
stack = self._java_se_stack([aggregate] + self._patch_minors())
2134-
self.assertEqual(self._java_se_configs(stack), self.EXPECTED)
2140+
self.assertEqual(self._java_se_configs(stack), self.EXPECTED_CONFIGS)
21352141

21362142
def test_runtimes_array_entries_flagged_auto_update(self):
21372143
# Entries derived from the aggregate must be flagged auto-update so they

0 commit comments

Comments
 (0)