Azure App Service Access Restrictions Skip the SCM Endpoint
Overview
A single Access Restrictions panel implies one rule set. Azure App Service actually keeps two, and the deployment surface is usually the one left open.
At a glance
- Symptom
- An Azure App Service that was deliberately restricted to a corporate IP range still allows unrestricted network access to its deployment surface.
- Likely cause
- Azure App Service exposes two distinct HTTP surfaces under one resource: the production site and the SCM/Kudu management site used for Git deployment, ZIP…
- Impact
- An open SCM endpoint exposes deployment tooling to any network that can reach the public internet path to that App Service.
- Verification signal
- Treat the fix as unverified until both hostnames have been tested from both an allowed and a disallowed network.From the disallowed network, request the SCM hostname and confirm…
- Safe correction
- Close the gap by giving the SCM site an explicit, equivalent restriction rather than assuming inheritance.
- Rollback or recovery
- Add an Allow rule for the blocked pipeline's source range before removing anything: removing the only rule from the SCM collection returns the SCM site to allowing all…
Symptom
An Azure App Service that was deliberately restricted to a corporate IP range still allows unrestricted network access to its deployment surface. The production hostname (APP_NAME.azurewebsites.net) correctly returns a blocked response from outside the allowed range, but the SCM/Kudu hostname (APP_NAME.scm.azurewebsites.net) responds normally from any network, including the Kudu console, deployment endpoints and diagnostic tooling, which are then protected by authentication alone.
False Assumption
The team assumed that configuring Access Restrictions once, in the App Service networking blade, applies a single rule set to every inbound path exposed by that App Service resource. The portal presents Access Restrictions as one panel, which reinforces the belief that the production site and the SCM/Kudu management site share the same allow/deny logic.
Root Cause
Azure App Service exposes two distinct HTTP surfaces under one resource: the production site and the SCM/Kudu management site used for Git deployment, ZIP deploy, the Kudu console and diagnostic APIs. Each surface holds its own access-restriction rule collection. Unless the SCM rule collection is explicitly populated, or the same-restrictions option is turned on, the SCM surface keeps its own default state, which, with no rules and no unmatched rule action set, permits all inbound traffic. So restricting only the production site leaves the SCM surface exactly as it was before any restriction work began, however tightly the main site is locked down.
Impact
An open SCM endpoint exposes deployment tooling to any network that can reach the public internet path to that App Service. Depending on authentication settings, this can allow password-guessing against deployment credentials, inspection of environment variables through the Kudu console, or code push through Git/ZIP deploy if publishing credentials are later disclosed or brute-forced. The exposure is easy to miss because the production site’s restriction appears to have worked, and nothing in the standard portal view highlights the mismatch between the two rule collections.
Diagnosis
Confirm the split before changing anything. Retrieve both rule collections for the resource and compare them, then test both hostnames from a network outside the intended allow list.
- List the current rule collections for the App Service and inspect
ipSecurityRestrictions(production site) alongsidescmIpSecurityRestrictions(SCM site). - From a network that is not in the intended allow list, request the production hostname and confirm it is blocked.
- From the same disallowed network, request the SCM hostname and check whether it responds instead of being blocked.
Correction
Give the SCM site an explicit restriction that matches the main site’s, and do not rely on inheritance. Add a rule scoped to the SCM site that matches the intended allow list, or enable the platform’s same-restrictions option (Use main site rules in the portal, or az webapp config access-restriction set --use-same-restrictions-for-scm-site true) so the SCM collection mirrors the production collection going forward.
az webapp config access-restriction add \
--name APP_NAME \
--resource-group RESOURCE_GROUP \
--rule-name allow-corp-range \
--action Allow \
--ip-address CORP_CIDR \
--priority 100 \
--scm-site true
Check az webapp config access-restriction add --help for the flags in your CLI version.
Validation
The fix is not proven until you have tested both hostnames from an allowed network and from a disallowed one.
- From the disallowed network, request the SCM hostname and confirm the connection is refused or returns an access-denied response rather than a normal Kudu response.
- From the allowed corporate range, request the SCM hostname and confirm it still returns a normal authenticated response, so deployment tooling has not been broken.
- Re-list the SCM rule collection and confirm it contains only the intended entries, and check that the SCM site’s unmatched rule action (scmIpSecurityRestrictionsDefaultAction) is not set to Allow: with one or more rules and no explicit setting, unmatched traffic is denied.
Rollback
If the new SCM restriction blocks a legitimate deployment pipeline or break-glass access path, first add an Allow rule for that pipeline’s source range rather than removing the corporate rule. Removing the only rule from the SCM collection returns the SCM site to allowing all access unless its unmatched rule action is set to Deny, which re-exposes Kudu to the internet; if you must remove it, treat the site as exposed until a replacement rule is in place.
az webapp config access-restriction remove \
--name APP_NAME \
--resource-group RESOURCE_GROUP \
--rule-name allow-corp-range \
--scm-site true
Before any rollback, capture the current main-site and SCM rule collections as evidence. If deployment access is still blocked after the pipeline’s range is allowed, the restriction is not the cause, so stop and escalate to the resource owner before making further network changes.
Prevention
Review the SCM/Kudu surface as a control point in its own right, rather than expecting production-site hardening to cover it.
- Add SCM-scoped restriction rules to the same infrastructure-as-code template that defines the production site rules, so they cannot drift apart.
- Include the SCM hostname explicitly in any external exposure scan or firewall test used to sign off App Service network changes.
- Document the two-collection behaviour where App Service network settings are reviewed, so the assumption is visible to the next engineer who touches Access Restrictions.
Related reading
Apply the safer control
Before you change production
Confirm the affected scope, export the current configuration, and test the replacement control in a non-production environment first.
Fix commands and configuration
ipSecurityRestrictionsscmIpSecurityRestrictionsaz webapp config access-restriction set --use-same-restrictions-for-scm-site trueWhen to escalate
Validation and rollback are covered in the sections above.
Escalate
Escalate when the blast radius is uncertain, the control cannot be tested safely, or remediation requires an outage or security exception.
Fixed? Get the next one before it hits you: The KBY Brief
Practical fixes for the systems you run, by email about twice a week. Unsubscribe at any time.
About this page
Credited to
Dates
Published
Last updated
Corrections
- : The validation step looked for a "residual allow-all default rule", which App Service does not have; it now checks the SCM site's unmatched rule action. The rollback said to remove the added rule without warning that removing the only SCM rule opens the deployment site to all traffic again; it now says to allow the blocked pipeline first, and to capture the rules before any rollback. Details
- : Corrected during a review of published articles. Details
Was this useful?
Reports go to the site owner and are used to correct pages. Corrections are listed at /corrections.