Securing Azure App Service
This lesson covers transport settings, authentication, network access and secrets for App Service.
Learning outcomes
After completing this lesson, you will be able to:
- Identify baseline settings.
- Describe Easy Auth.
- Distinguish access restrictions, private endpoints and virtual network integration.
- Explain Key Vault references.
Shared responsibility on App Service
Azure App Service hosts web applications and APIs, and Microsoft manages the operating system and runtime patches. The customer remains responsible for application code, its configuration, access, and how the app is exposed. Some settings are not secure by default, so an engineer should check each one. Every app gets a public hostname by default, at APP.azurewebsites.net, and that address is reachable from the internet until it is restricted.
Transport and deployment settings
Several settings should be applied to every app.
- HTTPS Only: redirects HTTP to HTTPS. It is not on by default.
- Minimum TLS version: the default is TLS 1.2, and TLS 1.3 is supported. Set it for both the app and the SCM site.
- Basic authentication: disable it for FTP and SCM, so that deployments use Microsoft Entra identities.
- FTP state: set it to Disabled, or FTPS only.
- Remote debugging: keep it off in production.
- Client certificates: enable them when mutual TLS is required.
The SCM site, or Kudu, at APP.scm.azurewebsites.net, is a management endpoint for deployment and diagnostics. It can have separate access restrictions, and it deserves at least the same protection as the app.
App Service defaults
Authentication with Easy Auth
App Service authentication, known as Easy Auth, adds sign-in with no code change. A platform module intercepts requests before they reach the app, and handles Microsoft Entra ID, Microsoft accounts, Google, Facebook and X. It can redirect unauthenticated users to sign in, or return HTTP 401 for an API.
It is a strong option for an app with no built-in authentication. For a more detailed authorization need, the app can read claims from the headers that the platform injects. Combine this with a Conditional Access policy that targets the app's registration, so that MFA or a compliant device can be demanded.
The following diagram shows the platform module in front of the app.

Network access
Inbound and outbound network controls are separate features, and exam questions often test whether a candidate can tell them apart.
An app can use a private endpoint and virtual network integration together, to be fully private in both directions. A service tag in an access restriction can limit traffic to Azure Front Door, for instance with AzureFrontDoor.Backend, and an HTTP header check on the Front Door ID makes sure that the traffic comes from your own profile. App Service Environment is a dedicated, single-tenant deployment in your virtual network, which provides the strongest isolation.
Inbound or outbound control?
Secrets and identity
An app should not hold credentials in its settings. Use a managed identity to reach resources, and Key Vault references in application settings where a secret is unavoidable. A reference has this form: @Microsoft.KeyVault(SecretUri=https://VAULT.vault.azure.net/secrets/NAME/). The app's identity needs Key Vault Secrets User. App settings are encrypted at rest, but anyone with sufficient rights can view them, so a reference limits that exposure. If the vault is behind a firewall, the app must reach it through virtual network integration.
Defender for App Service is the workload protection plan, which uses the platform's view of requests to detect attacks such as scanning, and dangling DNS. A dangling DNS record is one that points to a deleted app, which an attacker could reclaim in order to take over the subdomain.
App secrets and threats
Locking an app to Front Door
An App Service app sits behind Azure Front Door with a WAF. Testers have found that the app can be reached directly at its azurewebsites.net address, which bypasses the WAF. The app must reach an Azure SQL database that has public access disabled. What should you configure?
Add an access restriction with the AzureFrontDoor.Backend service tag, along with a header check on X-Azure-FDID, so that only your profile can reach the app. Alternatively, use Front Door Premium with Private Link to the app, and disable public access. For the database, use virtual network integration with a private endpoint on the database.
The service tag alone would admit other customers' Front Door profiles. A private endpoint on the app is an inbound feature, so it would not help the app to reach the database.
Does virtual network integration make an app private to inbound callers?
Show answer
No. It is for outbound traffic. A private endpoint gives private inbound access.
Exam Tips
Remember for the exam
- HTTPS Only is not on by default.
- Private endpoint is inbound; virtual network integration is outbound.
- A Front Door service tag needs a header check to limit it to your profile.
- Use Key Vault references rather than secrets in app settings.