Home / Data Platform / Data Factory

Data PlatformRunbookIntermediate

Sev1: ADF pipelines fail with 403 after the storage firewall was enabled or public access disabled

A network hardening change locked Azure Data Factory out of the lake. Copy activities fail with 403 AuthorizationFailure. Find the change, open the right path for each integration runtime, and avoid a blanket rollback.

Deepak Bhardwaj6 min read

Applies toAzure Data Factory and Synapse pipelines; Azure Storage / ADLS Gen2 network rules; Azure, managed VNet and self-hosted integration runtimes; Azure CLI 2.x with the datafactory extension

Symptoms

  • Copy, Lookup, Get Metadata and Delete activities against Blob or ADLS Gen2 start failing at the same time. They fail with HTTP 403 and a message such as This request is not authorized to perform this operation (AuthorizationFailure). The exact wording varies by connector.
  • Test connection on the linked service fails too, even though the credentials have not changed.
  • Pipelines on a self-hosted IR may fail while those on the Azure IR work, or the other way round.

A 403 with AuthorizationFailure usually comes from the storage firewall. A 403 with AuthorizationPermissionMismatch comes from RBAC or ACLs, which need a different fix. Compare the error codes before you change anything.

1. Confirm it is the network rules

ACCT=stlakeprod; RG=rg-data

az storage account show --name $ACCT --resource-group $RG --query "{
  publicNetworkAccess: publicNetworkAccess,
  defaultAction: networkRuleSet.defaultAction,
  bypass: networkRuleSet.bypass,
  ipRules: networkRuleSet.ipRules[].ipAddressOrRange,
  vnetRules: networkRuleSet.virtualNetworkRules[].virtualNetworkResourceId,
  resourceRules: networkRuleSet.resourceAccessRules,
  privateEndpoints: privateEndpointConnections[].{name:name, state:privateLinkServiceConnectionState.status}
}"

Then find the change and who made it:

az monitor activity-log list --resource-id $(az storage account show -n $ACCT -g $RG --query id -o tsv) \
  --offset 48h --query "[?operationName.value=='Microsoft.Storage/storageAccounts/write'].{time:eventTimestamp, caller:caller, status:status.value}" -o table

Line up the failures with the change in Log Analytics:

ADFActivityRun
| where TimeGenerated > ago(24h) and Status == "Failed"
| where ErrorMessage has "403" or ErrorMessage has "AuthorizationFailure"
| summarize failures = count(), first = min(TimeGenerated) by PipelineName, ActivityName
| order by first asc

2. Pick the fix per integration runtime

Each kind of integration runtime reaches storage by a different network path, so each needs a different rule.

Integration runtime Why it now fails Fix
Azure IR (public, AutoResolve) Traffic comes from shared Azure IPs that aren't on your allow list Allow trusted Azure services and switch the linked service to managed identity auth, or add a resource instance rule
Managed VNet Azure IR No managed private endpoint to this account, or it is still pending Create and approve a managed private endpoint for dfs (and blob if used)
Self-hosted IR on-premises Its public egress IP isn't in ipRules Add the egress IP or range, or use a private endpoint reachable from on-premises
Self-hosted IR on an Azure VM IP rules don't apply to traffic from Azure services in the same region Add a VNet rule (service endpoint) for the VM subnet, or use a private endpoint
publicNetworkAccess = Disabled Every public route is closed, including trusted services Only private endpoints work: managed VNet IR or a SHIR with private DNS

Warning

The trusted-services exception only works for linked services that use the factory's managed identity (system- or user-assigned). Linked services that use account keys, SAS tokens or a service principal secret still get 403. Switching auth also needs an RBAC grant, such as Storage Blob Data Contributor, for the factory identity.

Azure IR: trusted services or resource instance rule

# Let trusted Azure services through (keep existing bypass values like Logging,Metrics)
az storage account update --name $ACCT --resource-group $RG --bypass AzureServices Logging Metrics

# Narrower: allow only this factory by resource instance
ADF_ID=$(az datafactory show --name adf-prod --resource-group rg-data --query id -o tsv)
az storage account network-rule add --account-name $ACCT --resource-group $RG \
  --resource-id $ADF_ID --tenant-id $(az account show --query tenantId -o tsv)

# Grant the factory identity data access
az role assignment create --role "Storage Blob Data Contributor" \
  --assignee-object-id $(az datafactory show -n adf-prod -g rg-data --query identity.principalId -o tsv) \
  --assignee-principal-type ServicePrincipal \
  --scope $(az storage account show -n $ACCT -g $RG --query id -o tsv)

Role assignments can take a few minutes to take effect. Then change the linked service authentication to System-assigned managed identity and publish.

Managed VNet IR: managed private endpoint

STG_ID=$(az storage account show -n $ACCT -g $RG --query id -o tsv)

az datafactory managed-private-endpoint create --factory-name adf-prod --resource-group rg-data \
  --managed-virtual-network-name default --name mpe-stlakeprod-dfs \
  --group-id dfs --private-link-resource-id $STG_ID

# Approve on the storage side
az network private-endpoint-connection list --id $STG_ID \
  --query "[?properties.privateLinkServiceConnectionState.status=='Pending'].id" -o tsv |
while read -r cid; do
  az network private-endpoint-connection approve --id "$cid" --description "ADF managed PE"
done

Create a separate endpoint with --group-id blob if any dataset uses the Blob connector against the same account. Mapping data flows on a managed VNet IR use the same managed private endpoints.

Self-hosted IR

# On-premises SHIR: allow the proxy or NAT egress address
az storage account network-rule add --account-name $ACCT --resource-group $RG --ip-address 203.0.113.40

# SHIR on an Azure VM: allow the subnet (needs Microsoft.Storage service endpoint on it)
az storage account network-rule add --account-name $ACCT --resource-group $RG \
  --vnet-name vnet-shir --subnet snet-shir

If you use a private endpoint, run nslookup stlakeprod.dfs.core.windows.net on the SHIR node. It must resolve to the private IP, not the public one.

3. Emergency rollback (last resort)

If the business impact can't wait for per-runtime fixes, you can temporarily set the default action back to Allow:

az storage account update --name $ACCT --resource-group $RG --default-action Allow

Caution

This exposes the account to every network again. Get the security owner's approval, record it in the incident, and set a time limit. Re-apply --default-action Deny as soon as the targeted rules above are in place.

4. Verify

RUN=$(az datafactory pipeline create-run --factory-name adf-prod --resource-group rg-data \
  --name pl_copy_orders --query runId -o tsv)
az datafactory pipeline-run show --factory-name adf-prod --resource-group rg-data --run-id $RUN \
  --query "{status:status, message:message}"
  • Test connection passes on every linked service that points at the account.
  • One pipeline per integration runtime type completes.
  • Failed runs from the incident window are rerun, and downstream refreshes have caught up.

Prevent it next time

  • Before you change a storage network setting, inventory every consumer: ADF and Synapse IRs, Databricks, Fabric shortcuts, Power BI gateways and Event Hubs Capture. Add their rules first, then switch the default action.
  • Use managed identity for all storage linked services, so trusted-service and resource instance rules can be used.
  • Stage the change: put the account in Azure Policy audit mode first, apply to non-production, then to production in a change window.
  • Alert on Microsoft.Storage/storageAccounts/write for lake accounts with an Activity log alert routed to the data platform on-call.
  • For Databricks access through the same firewall, see ADLS firewall with access connectors.