0
0
Azurecloud~30 mins

App Service diagnostics and logging in Azure - Mini Project: Build & Apply

Choose your learning style9 modes available
App Service Diagnostics and Logging Setup
📖 Scenario: You are managing a web application hosted on Azure App Service. To keep the app healthy and troubleshoot issues quickly, you need to set up diagnostics and logging.This project will guide you through enabling application logging, setting a log retention period, and viewing the logs.
🎯 Goal: Enable application diagnostics logging on an Azure App Service, configure log retention, and display the log file path.
📋 What You'll Learn
Create a variable with the App Service name
Create a variable with the resource group name
Enable application logging to file system
Set the log retention period to 7 days
Print the path where logs are stored
💡 Why This Matters
🌍 Real World
Setting up diagnostics and logging is essential for monitoring and troubleshooting web applications running on Azure App Service.
💼 Career
DevOps engineers and cloud administrators often configure logging to maintain application health and quickly resolve issues.
Progress0 / 4 steps
1
Set up App Service and Resource Group variables
Create two variables: app_service_name with the value "myappservice123" and resource_group with the value "myresourcegroup".
Azure
Need a hint?

Use simple assignment statements to create the variables with exact names and values.

2
Enable application logging to file system
Create a variable called enable_logging_command that contains the Azure CLI command string to enable application logging to the file system for the app service named app_service_name in the resource group resource_group.
Azure
Need a hint?

Use an f-string to insert the variables into the Azure CLI command that enables application logging to the file system.

3
Set log retention period to 7 days
Create a variable called set_retention_command that contains the Azure CLI command string to set the log retention period to 7 days for the app service named app_service_name in the resource group resource_group.
Azure
Need a hint?

Use an f-string to create the Azure CLI command that sets log retention to 7 days.

4
Print the log file path
Print the exact string "Logs are stored in /LogFiles/Application/" to show where the logs are saved on the App Service.
Azure
Need a hint?

Use a print statement with the exact string to show the log location.