Skip to content

[App Service] Fix #30030, #10043, #29147, #28987: monitoring, logging, and infrastructure improvements#33073

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

[App Service] Fix #30030, #10043, #29147, #28987: monitoring, logging, and infrastructure improvements#33073
seligj95 wants to merge 1 commit intoAzure:devfrom
seligj95:fix/appservice-infra-features

Conversation

@seligj95
Copy link
Copy Markdown
Contributor

Description

This PR addresses four App Service infrastructure/monitoring issues:

Fix #30030: Application Insights CLI guidance

  • Added comprehensive help text and examples to az webapp config appsettings set showing how to enable Application Insights monitoring via APPLICATIONINSIGHTS_CONNECTION_STRING (recommended) and APPINSIGHTS_INSTRUMENTATIONKEY (legacy).

Fix #10043: Web server logging to Azure Blob Storage

  • Added azureblobstorage option to --web-server-logging parameter in az webapp log config.
  • Added new --web-server-log-sas-url and --web-server-log-retention parameters.
  • Implemented AzureBlobStorageHttpLogsConfig support in config_diagnostics().
  • Resolves the long-standing TODO (tracked as webapp: Fix --web-server-logging param to accept storage option #4764) for blob storage HTTP log support.

Fix #29147: Traffic routing restart warning

  • Added a logger.warning() message in set_traffic_routing() to inform users that updating traffic routing may cause a brief restart (known platform behavior).
  • Enhanced help text for az webapp traffic-routing set documenting this limitation.

Fix #28987: Backup/restore VNet guidance

  • Added detailed VNet/private endpoint guidance to help text for az webapp config backup create and az webapp config backup restore, documenting requirements for storage accounts behind VNets.
  • Added restore examples.

Testing

  • All 32 existing + 3 new unit tests pass in test_webapp_commands_thru_mock.py
  • azdev style appservice passes (pylint + flake8)
  • azdev linter appservice has pre-existing crash in batch module (not related to this PR)

Files Changed

  • _help.py — Enhanced help text and examples for all four issues
  • _params.py — Added blob storage logging params (--web-server-log-sas-url, --web-server-log-retention, azureblobstorage enum value)
  • custom.py — Implemented blob storage HTTP logging, added traffic routing warning
  • test_webapp_commands_thru_mock.py — Added 3 new unit tests

… monitoring, logging, and infrastructure improvements

- Azure#30030: Add Application Insights connection string and instrumentation key
  examples to `webapp config appsettings set` help with guidance on enabling
  App Insights monitoring via app settings.

- Azure#10043: Add Azure Blob Storage support for web server logging via
  `--web-server-logging azureblobstorage` with new `--web-server-log-sas-url`
  and `--web-server-log-retention` parameters in `webapp log config`.

- Azure#29147: Add warning message and documentation to `webapp traffic-routing set`
  about potential app restart when updating traffic routing configuration
  (known platform behavior).

- Azure#28987: Add VNet/private endpoint guidance to `webapp config backup create`
  and `webapp config backup restore` help text, documenting requirements for
  backup/restore with storage accounts behind VNets.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 26, 2026 15:32
@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

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

⚠️AzureCLI-BreakingChangeTest
⚠️appservice
rule cmd_name rule_message suggest_message
⚠️ 1006 - ParaAdd webapp log config cmd webapp log config added parameter web_server_log_retention
⚠️ 1006 - ParaAdd webapp log config cmd webapp log config added parameter web_server_log_sas_url
⚠️ 1010 - ParaPropUpdate webapp log config cmd webapp log config update parameter web_server_logging: updated property choices from ['filesystem', 'off'] to ['azureblobstorage', 'filesystem', 'off']

@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.

@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>

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 (appservice) command module by adding user guidance and support for blob-backed web server logging, plus a user-facing warning about potential restarts when configuring traffic routing.

Changes:

  • Extend az webapp log config to support --web-server-logging azureblobstorage with new SAS URL + retention parameters, and implement corresponding SDK configuration in config_diagnostics().
  • Add a warning in set_traffic_routing() about possible brief restarts when updating ramp-up rules.
  • Expand help text/examples for Application Insights app settings guidance and for backup/restore scenarios involving VNet/private endpoint storage, and add unit tests covering the new behaviors.

Reviewed changes

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

File Description
src/azure-cli/azure/cli/command_modules/appservice/custom.py Implements Azure Blob Storage HTTP logs configuration and adds traffic routing restart warning.
src/azure-cli/azure/cli/command_modules/appservice/_params.py Adds new CLI args for blob-backed web server logs and expands the --web-server-logging enum.
src/azure-cli/azure/cli/command_modules/appservice/_help.py Adds/updates long summaries and examples for monitoring/logging/backup guidance and traffic routing caveats.
src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_webapp_commands_thru_mock.py Adds unit tests for blob logging argument requirements and traffic routing warning emission.

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


mock_site_op.assert_called_once()
call_args = mock_site_op.call_args
site_log_config = call_args[0][5]
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.

This test inspects the 6th positional argument of _generic_site_operation (call_args[0][5]) to get site_log_config, which is brittle if _generic_site_operation's signature changes. Prefer asserting against mock_site_op.call_args.args[-1] (or kwargs) and/or asserting the expected operation name/slot explicitly to make the test less order-dependent.

Suggested change
site_log_config = call_args[0][5]
site_log_config = call_args.args[-1]

Copilot uses AI. Check for mistakes.
Comment on lines 5463 to 5464
# TODO: expose new blob support
def config_diagnostics(cmd, resource_group_name, name, level=None,
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.

The TODO comment about "expos[ing] new blob support" is now outdated since this PR adds the azureblobstorage option and related parameters. Please remove or update the TODO to avoid misleading future maintainers.

Copilot uses AI. Check for mistakes.
Comment on lines +5509 to +5513
blob_log_config = AzureBlobStorageHttpLogsConfig(
sas_url=web_server_log_sas_url,
retention_in_days=retention,
enabled=True)
http_logs = HttpLogsConfig(file_system=filesystem_log_config, azure_blob_storage=blob_log_config)
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.

web_server_log_sas_url is a credential-bearing SAS URL (contains sig=) and will likely be echoed back in the SiteLogsConfig returned from _generic_site_operation, which means az webapp log config output can leak the SAS token to the console/logs. Consider redacting/masking the SAS URL in the returned object (or returning a sanitized response) while still sending the full value in the request.

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

Projects

None yet

4 participants