Add app settings and watch the logs

Azure Portal, Hands On10 minutesFreeSteps checked 22 October 2026By Cloud Hands On

In this task you'll add app settings and read a web app's logs.

App settings are values your code reads when it runs, such as a feature switch or a database address. Keeping them in the portal, not in your code, means you can change them without redeploying, and keep secrets out of your files.

When something goes wrong, the logs tell you why. App Service logs switches logging on, and Log stream shows new lines as they happen.

Example. SS Kaiser's shop reads SALE_BANNER=on from its app settings. Marketing switches the banner off at midnight by changing the setting, with no new release.

Before you start

You need: Website Contributor or Contributor. Time: 10 minutes.

Where to look

  1. App Services
  2. app-practice
  3. Settings
  4. Environment variables

Steps

  1. Open app-practice and select Environment variables under Settings. It has two tabs: App settings and Connection strings.
  2. On App settings, select + Add. In the pane, set Name to GREETING and Value to hello, leave Deployment slot setting unticked, and select Apply.The setting isn't saved yet: it's only on the list.
  3. Select Apply at the bottom of the page. A Save changes message warns that the app will restart: select Confirm.Saving settings restarts the app, so do it at a quiet time on a real site.
  4. Select App Service logs under Monitoring. Turn Application logging to File System, leave Quota (MB) at 35, set Retention Period (Days) to 1, and select Save.
  5. Select Log stream and open the site's address in another tab. Watch new lines appear. The options at the top switch between Runtime and Platform logs, the instance, and how far back to look.

Commands

# Add or change an app setting (the app restarts)
az webapp config appsettings set --resource-group rg-portal-practice --name <app name> --settings GREETING=hello

# List settings
az webapp config appsettings list --resource-group rg-portal-practice --name <app name> --output table

# Turn on file system logging, then stream the log
az webapp log config --resource-group rg-portal-practice --name <app name> --application-logging filesystem
az webapp log tail --resource-group rg-portal-practice --name <app name>

Watch out for

Cost
Settings and file system logs are free. Sending logs to a Log Analytics workspace or storage costs money for the data kept.
Security
Anyone with read access to the app can see plain-text settings. For passwords and keys, store them in Key Vault and use a Key Vault reference, with the app's managed identity allowed to read them.
Common mistakes
Forgetting the final Apply, so nothing is saved. Leaving verbose logging on for weeks on a busy site. Not realising that changing a setting restarts the app.

Clean up

  1. app-practice
  2. Environment variables

Delete the GREETING setting with its bin icon and select Apply, or simply delete the resource group at the end of this section.

Words to know

App setting
A name and value given to your app as an environment variable.
Connection string
A special kind of setting holding how to reach a database.
Key Vault reference
An app setting whose value is fetched from Key Vault instead of being stored in plain text.

Tick off each step and track your progress in the guide.

Open this task in Azure Portal, Hands On

Keep going