0

We use the "Azure App Service deploy" task in a Azure Dev Ops Release pipeline.

This results in a deployed App Service with WEBSITE_RUN_FROM_PACKAGE = 1. On the whole this is fine but WEBSITE_RUN_FROM_PACKAGE set to 1 makes the contents of AppService uneditable via Kudu. That then means we cannot chnage LogLevel on the fly.

Surely being able to dynamically change LogLevel for AppInsights is standard requirement therefore it looks like we cannot use ZipDeploy.

Should we look into how we deploy the code to Azure Blob Storage? Do we really have to do that to be able to be able to change LogLevels without a redeploy?

Pat Long - Munkii Yebee
  • 3,592
  • 2
  • 34
  • 68
  • And what about setting log level via Configuration and ENV variable on the portal https://learn.microsoft.com/en-us/aspnet/core/fundamentals/logging/?view=aspnetcore-7.0#set-log-level-by-command-line-environment-variables-and-other-configuration – Krzysztof Madej Aug 03 '23 at 11:53
  • You can set the LogLevel in the ApplicationSettings - manually or by using Azure CLI.Use `az webapp config appsettings set -g "MyResourceGroupName" -n "MyAppName" --settings LogLevel=Information` command to set the [LogLevel](https://i.stack.imgur.com/Md2HG.png).Try this once and check. – Harshitha Aug 03 '23 at 13:57
  • Will these both affect the AppInsights LoggingLevel? That is the logging level I want to change. For now i have gone with setting ASPNETCORE_ENVIRONMENT and appsettings.json files for each environment DEV,TEST and PROD – Pat Long - Munkii Yebee Aug 04 '23 at 09:09
  • Application Insights traces change based on your Logging Level. – Harshitha Aug 07 '23 at 05:06
  • This Q&A and my recent experience suggests that APIN LogLevel is very specific to APIN, https://stackoverflow.com/questions/61636868/why-is-the-app-insight-loglevel-in-appsettings-being-ignored – Pat Long - Munkii Yebee Aug 07 '23 at 15:12

1 Answers1

0

As I have mentioned, we can change the Log Level of the deployed App using the Azure CLI Command.

az webapp config appsettings set -g "MyResourceGroupName" -n "MyAppName" --settings LogLevel=Information

enter image description here

  • Setting the log level from Portal changes the log Level of the Production Environment.

Will these both affect the AppInsights LoggingLevel?

  • Yes, the logging level effects the type of request/traces to be logged.

Refer this SOThread which explains the logging configuration for a WebApp.

Should we look into how we deploy the code to Azure Blob Storage?

  • Yes,based on your requirement you can opt for an Azure Blob Storage and use Azure App Service deploy task.
Harshitha
  • 3,784
  • 2
  • 4
  • 9