question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

webapp:Unable to set WebApp Slot logging using az webapp log config --ids [webapp slot id]

See original GitHub issue

az feedback auto-generates most of the information requested below, as of CLI version 2.0.62

Describe the bug

The command “az webapp log config” when used with the parameter “–ids [appServiceSlotID]” configure the main AppService instead of the specified AppService Slot.

To Reproduce

  1. Create a Resource Group, say “resourceGroupName”.
  2. Create an AppService in the newly created Resource Group, say “appServiceName”.
  3. Add an AppService Slot to the newly created AppService, say “appServiceSlotName”.
  4. Run the following command:
az webapp log config \
--docker-container-logging "filesystem" \
--ids "/subscriptions/[subscriptionID]/resourceGroups/[resourceGroupName]/providers/Microsoft.Web/sites/[appServiceName]/slots/[appServiceSlotName]"

Expected behavior

The specified AppService Slot/AppService Logs is enabled with the following default parameters:

  • Application Logging: filesystem
  • Quota (MB): 100
  • Retention Period (Days): 3

Observed behavior

The AppService/AppService Logs is enabled with the following default parameters:

  • Application Logging: filesystem
  • Quota (MB): 100
  • Retention Period (Days): 3

Environment summary

Install Method: apt CLI version: 2.27. OS version : Ubuntu 20.04.2 LTS Shell Type: bash

Additional context

The following equivalent command works as expected:

az webapp log config \
--docker-container-logging "filesystem" \
--resouce-group [resourceGroupName] \
--name [appServiceName] \
--slot [appServiceSlotName]

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Kotasudhakarreddycommented, Nov 29, 2021

@PatrickMessierGoC Agree with your suggestion. But this is not the problem with only webapp this is the same behavior with all the other azure resources too. So we will take it into CLI core team to handle this at root level instead of individual module level.

0reactions
PatrickMessierGoCcommented, Nov 26, 2021

As mentionned on Sept 10th, I now understand that. My point is that - based on the command documentation on the [–ids] parameter - “It should be a complete resource ID containing all information of ‘Resource Id’ arguments. You should provide either --ids or other ‘Resource Id’ arguments.” make me (and probably some other people) believe that we can either provide a full resource ID (an App Service Slot has a Resource ID) or the other resource Id arguments which are namely the [–subscription], the [–resource-group], the App Service [–name], and the [–slot] name. In other words, we should not mix [–Ids] and [–slot] parameters.

A meaningfull warning or error message would have been appreciated. That’s all.

Read more comments on GitHub >

github_iconTop Results From Across the Web

az webapp log - Microsoft Learn
Default to the productions slot if not specified. --subscription. Name or ID of subscription. You can configure the default subscription using az account...
Read more >
Azure Web Apps deployment tutorial - Harness.io Docs
Harness can deploy a Docker image or non-containerized artifact for your Azure Web App. You can deploy to slots, perform traffic shifting, and...
Read more >
Change Exisitng Web App to use a New Custom Domain
Host the new custom domain web app in a new slot (suppose: Production Slot) Using ... az webapp config hostname add [--hostname] [--ids] ......
Read more >
azurerm_app_service_slot | Resources | hashicorp/azurerm
When using Slots - the app_settings , connection_string and site_config ... The ID of the App Service Plan within which to create this...
Read more >
azure.azcollection.azure_rm_webappslot module – Manage ...
Configure web app slot application settings. Suboptions are in key value pair format. app_state. string. Start/Stop/Restart the slot. Choices:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found