Skip to content

Commit 704326a

Browse files
authored
[App Service] az webapp config appsettings set: Fix SyntaxWarning invalid decimal literal (#32136)
1 parent 5236eb7 commit 704326a

File tree

6 files changed

+1663
-1304
lines changed

6 files changed

+1663
-1304
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1775,7 +1775,7 @@
17751775

17761776
helps['webapp deployment container show-cd-url'] = """
17771777
type: command
1778-
short-summary: Get the URL which can be used to configure webhooks for continuous deployment.
1778+
short-summary: Get the URL which can be used to configure webhooks for continuous deployment. Requires SCM Basic Auth Publishing Credentials to be enabled.
17791779
examples:
17801780
- name: Get the URL which can be used to configure webhooks for continuous deployment (autogenerated)
17811781
text: az webapp deployment container show-cd-url --name MyWebApp --resource-group MyResourceGroup --slot staging

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,17 @@ def update_app_settings(cmd, resource_group_name, name, settings=None, slot=None
514514
# pylint: disable=too-many-nested-blocks
515515
for src, dest, setting_type in [(settings, result, "Settings"), (slot_settings, slot_result, "SlotSettings")]:
516516
for s in src:
517+
# Check if this looks like a simple key=value pair without JSON/dict syntax
518+
# If so, parse it directly to avoid unnecessary warnings from ast.literal_eval
519+
if ('=' in s and not s.lstrip().startswith(('{"', "[", "{")) and
520+
not s.startswith('@')): # @ indicates file input
521+
try:
522+
setting_name, value = s.split('=', 1)
523+
dest[setting_name] = value
524+
continue
525+
except ValueError:
526+
pass # Fall back to JSON parsing if split fails
527+
517528
try:
518529
temp = shell_safe_json_parse(s)
519530
if isinstance(temp, list): # a bit messy, but we'd like accept the output of the "list" command

0 commit comments

Comments
 (0)