AZ_WEBSITE_CONTRIBUTOR
Summary
Forestall ACL Alias
AZ_WEBSITE_CONTRIBUTOR
Azure Alias
Website Contributor (Azure RBAC)
Affected Object Types
App Services, Function Apps, Static Web Apps
Exploitation Certainty
Certain
Azure RBAC Roles
Website Contributor (de139f84-1756-47ae-9be6-808fbbe84772}
Custom Role Actions:
Microsoft.Web/sites/*
Description
AZ_WEBSITE_CONTRIBUTOR represents the Azure RBAC Website Contributor role assignment. This role grants full control over Azure App Services and Function Apps, enabling:
Deploy code - publish arbitrary code that executes under the app identity.
Access publishing credentials - retrieve FTP/FTPS credentials and deployment tokens.
Modify app settings - access environment variables containing secrets.
List host keys - retrieve Function App keys for direct invocation.
Execute commands - SSH as root (Linux) or run commands via Kudu API.
This role includes Microsoft.Web/sites/publish/Action which enables command execution. See AZ_EXECUTE_COMMAND for detailed exploitation methods.
App Services and Function Apps commonly have:
Managed identities with access to Key Vaults, databases, and other resources.
Connection strings containing database credentials.
API keys and secrets in application settings.
Network access to internal resources via VNet integration.
Identification
PowerShell (Az Module)
Exploitation
This role grants Microsoft.Web/sites/publish/Action which enables command execution on App Services.
See AZ_EXECUTE_COMMAND for web-based exploitation methods.
SSH via Azure CLI (Linux App Services)
The CLI SSH commands require Website Contributor (or equivalent) role, not just publish/Action.
Azure CLI - Interactive shell

Azure CLI - SSH to Function App (Premium/Dedicated plans only)
Note: SSH is only available on Linux Function Apps running on Premium or Dedicated (App Service) plans. Consumption plan Function Apps do not support SSH.

Function App HTTP Trigger (.NET)
Deploy a .NET isolated Azure Function that uses Azure.Identity to request managed identity tokens.
Requirements:
.NET SDK 10.0+ installed
Azure Functions Core Tools (
npm install -g azure-functions-core-tools@4)Azure CLI authenticated with Website Contributor role
Target Function App running on .NET isolated worker
Step 1: Install .NET Function templates
Step 2: Create and initialize the function project
Step 3: Add Azure.Identity package
Step 4: Replace GetMIToken.cs with token acquisition code
For system-assigned managed identity (no client ID required):
Step 5: Deploy to target Function App

Step 6: Invoke the function to get the token

Enumerating User-Assigned Managed Identity Client IDs
If the Function App uses a user-assigned managed identity, you must first enumerate the client ID before requesting tokens.
Azure CLI:
PowerShell (Az Module):
Output example:
my-func-identity
a22986ea-7ae9-430f-af09-62ed5026b9db
8f3b1c2d-...
Use the ClientId value when constructing the ManagedIdentityCredential:
Mitigation
Minimize Website Contributor assignments
Use Website Reader for read-only access.
Scope assignments to specific apps.
Apply least privilege to managed identities
App managed identities should have minimal required permissions.
Secure app settings
Use Key Vault references instead of storing secrets in app settings.
Enable diagnostic logging
Send App Service logs to Log Analytics.
Detection
Use the Azure Portal:
Open Azure Portal -> App Services -> select the target app.
Open Activity log and filter Operation for
Publish Web App,List Publishing Credentials, andUpdate Config.Review Event initiated by, Timestamp, Resource, Status, and Change history for unexpected publishing or configuration changes.
Open Deployment Center and review deployment history and source.
Open Diagnose and solve problems to review app service activity from the portal.
References
Last updated
Was this helpful?