Skip to content

[App Service] Fix #15647, #17674, #29760, #12391: connection-string IDs, docker create params, public certs#33074

Closed
seligj95 wants to merge 1 commit intoAzure:devfrom
seligj95:fix/appservice-misc-features
Closed

[App Service] Fix #15647, #17674, #29760, #12391: connection-string IDs, docker create params, public certs#33074
seligj95 wants to merge 1 commit intoAzure:devfrom
seligj95:fix/appservice-misc-features

Conversation

@seligj95
Copy link
Copy Markdown
Contributor

Description

Fixes #15647, #17674, #29760, #12391

Issue #15647az webapp config connection-string list now supports --ids

  • Removed the id_part=None override on the connection-string list argument context, enabling the standard Azure CLI --ids parameter (auto-resolved from webapp_name_arg_type with id_part='name').
  • Cleaned up an incorrect explicit --ids argument with required=True on the connection-string group context that was conflicting with the framework's built-in ID resolution.

Issue #17674az webapp create supports --docker-registry-server-url

  • Added --docker-registry-server-url as a deprecated alias for --container-registry-url on webapp create (matching webapp config container set).
  • Fixed Linux container creation to set DOCKER_REGISTRY_SERVER_URL, DOCKER_REGISTRY_SERVER_USERNAME, and DOCKER_REGISTRY_SERVER_PASSWORD app settings when provided. Previously these were only set for Windows containers.

Issue #29760 — Improved --docker-container-logging help text

  • Enhanced parameter help to explain what filesystem and off mean.
  • Added long-summary to webapp log config help and replaced autogenerated examples with descriptive ones.

Issue #12391 — Public certificate management via CLI

  • Added az webapp config public-cert command group with upload, list, show, and delete subcommands.
  • Uses the SDK's PublicCertificate model and web_apps.create_or_update_public_certificate() / list_public_certificates() / delete_public_certificate() / get_public_certificate() operations.
  • Supports --slot for deployment slot operations.

Testing

  • All 29 existing mock tests pass (test_webapp_commands_thru_mock.py)
  • azdev style appservice passes (pylint + flake8)
  • azdev linter has a pre-existing batch module error (unrelated)

… connection-string IDs, docker create params, log help, public certs

- Azure#15647: Enable --ids support for 'az webapp config connection-string list' by
  removing id_part=None override and cleaning up incorrect explicit --ids arg
  with required=True on the connection-string argument context.

- Azure#17674: Add --docker-registry-server-url deprecated alias to 'webapp create'
  container_registry_url param. Also set DOCKER_REGISTRY_SERVER_* app settings
  during Linux container creation (previously only set for Windows containers).

- Azure#29760: Improve --docker-container-logging help text in _params.py and _help.py.
  Clarify 'filesystem' vs 'off' values and add long-summary to 'webapp log config'.

- Azure#12391: Add 'az webapp config public-cert' command group with upload, list,
  show, and delete subcommands for managing public certificates (.cer/.crt) on
  web apps via the PublicCertificate REST API.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 26, 2026 15:37
@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd bot commented Mar 26, 2026

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

@azure-client-tools-bot-prd
Copy link
Copy Markdown

Hi @seligj95,
Since the current milestone time is less than 7 days, this pr will be reviewed in the next milestone.

@azure-client-tools-bot-prd
Copy link
Copy Markdown

Validation for Breaking Change Starting...

Thanks for your contribution!

@github-actions
Copy link
Copy Markdown

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Mar 26, 2026

Thank you for your contribution! We will review the pull request and get back to you soon.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves the App Service module UX and capability by aligning parameters/help with existing CLI conventions and adding first-class public certificate management commands.

Changes:

  • Enable --ids support for az webapp config connection-string list and remove conflicting custom --ids wiring.
  • Add deprecated alias --docker-registry-server-url for az webapp create and adjust container registry app settings behavior.
  • Add new az webapp config public-cert {upload,list,show,delete} command group and expand logging/help text.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
src/azure-cli/azure/cli/command_modules/appservice/custom.py Adds Linux container registry app settings during create; implements public cert CRUD operations.
src/azure-cli/azure/cli/command_modules/appservice/commands.py Registers the new webapp config public-cert command group and subcommands.
src/azure-cli/azure/cli/command_modules/appservice/_params.py Adds the deprecated alias for registry URL; wires arguments for public-cert; enables --ids for connection-string list.
src/azure-cli/azure/cli/command_modules/appservice/_help.py Updates examples/help text for connection-string listing, docker container logging, and adds help for public-cert commands.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +287 to +295
if container_registry_url:
site_config.app_settings.append(NameValuePair(name="DOCKER_REGISTRY_SERVER_URL",
value=container_registry_url))
if container_registry_user:
site_config.app_settings.append(NameValuePair(name="DOCKER_REGISTRY_SERVER_USERNAME",
value=container_registry_user))
if container_registry_password:
site_config.app_settings.append(NameValuePair(name="DOCKER_REGISTRY_SERVER_PASSWORD",
value=container_registry_password))
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

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

In create_webapp (Linux), the registry app settings are only set in the container_image_name branch. If the user creates a Linux multi-container webapp (--multicontainer-config-type/--multicontainer-config-file) with private registry credentials, those DOCKER_REGISTRY_SERVER_* settings still won't be applied, which is the main scenario in #17674. Consider moving the DOCKER_REGISTRY_SERVER_URL/USERNAME/PASSWORD app-setting logic so it also runs for the multicontainer path (and any other Linux container paths that need registry auth).

Copilot uses AI. Check for mistakes.
Comment on lines +5896 to +5899
import base64
cert_blob = base64.b64encode(cert_contents)
public_cert = PublicCertificate(
blob=cert_blob,
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

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

upload_public_cert base64-encodes the certificate bytes before assigning to PublicCertificate(blob=...). Other appservice certificate uploads (e.g., Certificate(pfx_blob=cert_contents)) pass raw bytes and let the SDK serializer handle base64 encoding for bytearray fields. As written, this risks double-encoding the cert and sending invalid content to the service. Prefer passing the raw cert_contents (or, if the SDK field is actually a string, explicitly .decode('utf-8') after base64 encoding) but avoid sending base64 bytes.

Suggested change
import base64
cert_blob = base64.b64encode(cert_contents)
public_cert = PublicCertificate(
blob=cert_blob,
public_cert = PublicCertificate(
blob=cert_contents,

Copilot uses AI. Check for mistakes.
help='The name of the public certificate.')
c.argument('slot', options_list=['--slot', '-s'],
help='The name of the slot. Default to the productions slot if not specified')
with self.argument_context(scope + ' config public-cert upload') as c:
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

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

public_certificate_name is defined only as an optional flag (--public-certificate-name) and is not marked required. For upload/show/delete, this parameter is mandatory; without required=True (or making it positional), the CLI will accept the command without it and fail later when calling the SDK with None. Suggest marking it required for the specific subcommands (override in ... public-cert list to keep it optional there).

Suggested change
with self.argument_context(scope + ' config public-cert upload') as c:
with self.argument_context(scope + ' config public-cert upload') as c:
c.argument('public_certificate_name', options_list=['--public-certificate-name'],
help='The name of the public certificate.', required=True)

Copilot uses AI. Check for mistakes.
Comment on lines +206 to +211
with self.command_group('webapp config public-cert') as g:
g.custom_command('upload', 'upload_public_cert')
g.custom_command('list', 'list_public_certs')
g.custom_show_command('show', 'show_public_cert')
g.custom_command('delete', 'delete_public_cert', confirmation=True)

Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

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

New webapp config public-cert commands are added, but there don't appear to be any tests covering them in the existing appservice test suite (no references in test_webapp_commands*.py). Given these commands are new surface area, please add at least mock tests for upload/list/show/delete (and slot variants) to prevent regressions and to validate the request payload shape (e.g., the blob encoding and public_certificate_location).

Copilot uses AI. Check for mistakes.
@seligj95
Copy link
Copy Markdown
Contributor Author

Consolidated into #33066

@seligj95 seligj95 closed this Mar 26, 2026
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.

Webapp:Can't list webapp connection-string settings by ID but you can set and delete them?

4 participants