只有跑在windows上的app才能使用blob storage保持log,在Linux上的只能保持到file system。

az webapp log config --application-logging true --level verbose --name <app-name> --resource-group <resource-group-name>
# There is currently no way to disable application logging by using Azure CLI commands; however, the following command resets file system logging to error-level only.
az webapp log config --application-logging false --name <app-name> --resource-group <resource-group-name>
# To view the current logging status for an app, use this command.
az webapp log show --name <app-name> --resource-group <resource-group-name>

要使用blob storage需要storage account,还要生成container。

# 显示log
az webapp log tail  --resource-group <resource-group-name> --name <app-name>

下载log

  • az cli
az webapp log download --log-file contosofashions.zip  --resource-group <resource-group-name> --name <app-name>
  • Kudu
    App Services --> Advanced Tools (Development Tools) --> select Go --> Kudu Services window appears --> CMD (Debug console) --> select LogFiles --> Download

  • Azure Blob Storage
    Storage accounts --> Storage Explorer (preview) --> BLOB CONTAINERS --> 选container