October 15, 2025
Updated: November 5, 2026
How to scope and run an Azure penetration test: Microsoft rules of engagement, Entra ID enumeration, common attack paths, test cases and tools.
Hazem El-Sayed

Azure penetration testing is an authorized, simulated attack on the Azure subscriptions and Microsoft Entra ID tenant your organization owns, run to find the misconfigurations and identity paths a real attacker could use. A typical engagement has six phases: scope and written authorization, external reconnaissance, identity and configuration review, attack-path validation, a detection check, and a report with retest. Microsoft has not required pre-approval since June 15, 2017, but every test must follow its rules of engagement, which ban denial-of-service testing and testing tenants you do not own.
Cloud security is a cornerstone of modern enterprise defense, and Azure penetration testing has become a top priority for organizations relying on Microsoft’s cloud ecosystem. Unlike traditional on-prem infrastructures, Azure environments present a complex mix of identity-based security controls, network segmentation, SaaS integrations, and PaaS services. For penetration testers and security professionals, mastering these nuances is crucial to simulate real-world adversaries effectively. Teams also running on AWS can compare the best AWS penetration testing companies.
This comprehensive guide provides a structured methodology to conduct Azure cloud penetration testing—from initial enumeration to exploitation and post-exploitation—designed for intermediate to senior security professionals.
Azure penetration testing is an authorized simulation of attacks against the Azure resources and Microsoft Entra ID tenant an organization owns. It focuses on identities and permissions, exposed services, storage, containers, serverless functions and the paths an attacker could use to move from one foothold to sensitive data or control of a subscription.
Microsoft has not required pre-approval since June 15, 2017, but every test must follow the Microsoft Cloud Unified Penetration Testing Rules of Engagement. Denial-of-service testing, testing tenants you do not own and using credentials that are not your own are prohibited. Microsoft summarizes the rules on its Azure penetration testing page.
Many large enterprises run critical workloads and identities on Azure and Microsoft Entra ID, making them a prime target for threat actors. While Microsoft provides robust security controls, misconfigurations, weak identity management, and excessive permissions remain the biggest attack surfaces. Experienced Azure consulting specialists can help organizations design secure cloud architectures, strengthen access controls, and reduce configuration-related risks.
For U.S. organizations testing Azure environments, regular penetration testing should be a non-negotiable part of cloud security programs that need to validate permissions, configurations, identity paths, and exposed services.
Penetration testing Azure environments helps organizations:
Before launching any testing activity, clear rules of engagement must be established to remain compliant with Microsoft’s Cloud Penetration Testing Rules.
Tip: Use a signed Rules of Engagement (RoE) document to protect both the testing team and the client, and if you're outsourcing the work, check how the leading cloud penetration testing companies define scope before you commit.
A solid understanding of Azure’s structure is essential to identify attack vectors. Azure resources are organized in a hierarchical model:
For UK teams validating Azure identity and access controls, Microsoft Entra ID controls access across Azure, M365, and connected SaaS applications, making privilege boundaries and permissions central to security review.
Most Azure engagements follow six phases, whatever the tooling. Each phase narrows what the next one tests, and the test cases later in this guide fit into phases 2 to 4.
List the tenants, subscriptions and resource groups in scope and name what is out of scope. Agree testing windows, contacts and the starting access: external only, a standard user, or an assumed-breach account. For the configuration review, testers usually get read-only roles such as Reader on the subscriptions and Global Reader in Microsoft Entra ID. Keep the written authorization on file; you will need it if Azure flags the activity.
Start without credentials. Confirm the tenant ID from public OpenID metadata, map internet-facing endpoints under Azure DNS suffixes such as blob.core.windows.net, azurewebsites.net and vault.azure.net, and check for anonymously readable storage. Keep this phase read-only. Resolve and inventory, but do not brute-force or fuzz at volume, because the Microsoft rules of engagement prohibit network-intensive testing.
Identity is the main Azure attack surface, so this phase usually produces the most findings. Review privileged Entra ID roles and Privileged Identity Management (PIM), Conditional Access exclusions, guest and default user permissions, app registrations with powerful Microsoft Graph permissions, and Azure RBAC assignments at broad scopes. Compare settings with the Microsoft cloud security benchmark or the CIS Microsoft Azure Foundations Benchmark.
A misconfiguration matters when it leads somewhere. Show whether a finding chains into higher access, such as a managed identity that can read Key Vault secrets or a Contributor role that allows VM Run Command. Stop at proof of concept and leave production data alone. Our guide to privilege escalation explains the underlying technique.
For each step, check whether the Azure Activity Log recorded the control-plane operation, whether Entra ID sign-in and audit logs captured the identity changes, and whether Microsoft Defender for Cloud or Microsoft Sentinel raised an alert. Microsoft’s rules explicitly encourage testing your own tenant’s detection.
Write each issue up with evidence, impact, remediation and the log operation to watch, then rerun the same checks after fixes.

Why it matters: By default, any user can browse the Azure portal surface and enumerate some tenant objects and app connections.
Check
Mitigation
Goal: Find accidentally exposed services by fuzzing common Azure DNS zones (read-only checks only).
Targets
.blob.core.windows.net, .file.core.windows.net, .queue.core.windows.net, .table.core.windows.net.azurewebsites.net, SCM: .scm.azurewebsites.net.vault.azure.net.database.windows.net, .documents.azure.com (Cosmos).azurecontainer.io, .azurecr.io.azureedge.net, .azure-api.net, .search.windows.netSafe triage
# Resolve candidate hostnames without sending requests to app paths
dig +short myapp.azurewebsites.net
dig +short mystorage.blob.core.windows.net
Mitigation
Goal: Detect publicly listable/READable containers.
Safe check
# Inventory
az graph query -q "Resources | where type=='microsoft.storage/storageaccounts' | project name,rg=resourceGroup,allowBlobPublicAccess=properties.allowBlobPublicAccess"
# Spot-test (anonymous listing; no credentials)
curl -s "https://<acct>.blob.core.windows.net/<container>?restype=container&comp=list"
# An XML blob list means anonymous listing is enabled; stop, don't download data.Mitigation
allowBlobPublicAccess=false, require SAS with short expiry, enable logging.Goal: Identify tenant ID and endpoints safely.
curl -s https://login.microsoftonline.com/<org-domain>/.well-known/openid-configuration | jq '.issuer,.authorization_endpoint,.token_endpoint'What to expect: Tenant (GUID) revealed via issuer; use only for scoping. Mitigation: None needed—public metadata by design. Use branding and monitoring to reduce phishing utility.
Goal: Confirm who can use Cloud Shell and whether token use from it would be noticed. A Cloud Shell session carries the signed-in user’s full permissions.
# Read-only checks: no token is requested, printed or exported
# 1. Privileged identities whose Cloud Shell session would be valuable to an attacker
az role assignment list --all --query "[?roleDefinitionName=='Owner' || roleDefinitionName=='Contributor'].{who:principalName, role:roleDefinitionName, scope:scope}" -o table
# 2. Conditional Access policies that should cover Azure management sign-ins (names and state only)
az rest --method get --url "https://graph.microsoft.com/v1.0/identity/conditionalAccess/policies" --query "value[].{name:displayName, state:state}" -o table
# Detection: Entra ID sign-in logs for Azure CLI / Cloud Shell sign-ins from unusual locations;
# Entra ID Protection and Defender for Cloud alerts on anomalous token use
# Fix: limit Cloud Shell to admins, require MFA and sign-in frequency through Conditional Access
Evidence: the privileged users who can open Cloud Shell and any Conditional Access gaps that apply to them. Mitigation: Disable Cloud Shell for non-admins, enforce re-auth, monitor Cloud Shell app sign-ins, shorten token lifetimes.
Risk patterns
Checks
az acr show -n <registry> -g <rg> --query "{adminUserEnabled:adminUserEnabled, policies:policies}"
az role assignment list --scope $(az acr show -n <registry> --query id -o tsv) -o table
What to look for
adminUserEnabled: trueMitigation
Goal: Confirm whether the ACR admin account is enabled and who could read its password (high impact if someone left it on).
# Read-only: is the admin user enabled? (does not reveal the password)
az acr show -n <registry> --query "{adminUserEnabled:adminUserEnabled, anonymousPullEnabled:anonymousPullEnabled}"
# Who could read the admin credentials (Owner and Contributor include listCredentials)
az role assignment list --scope $(az acr show -n <registry> --query id -o tsv) --include-inherited -o table
# Detection: Activity Log operation Microsoft.ContainerRegistry/registries/listCredentials/action
# Fix: az acr update -n <registry> --admin-enabled false, then rotate any password that was exposed
Mitigation
adminUserEnabled=false, rotate any leaked creds, prefer MSI/OIDC for CI.Goal: Check who can obtain cluster credentials and whether local (non-Entra) accounts are still enabled.
# Read-only: how does the cluster authenticate users?
az aks show -g <rg> -n <aks> --query "{entraManaged:aadProfile.managed, azureRbac:aadProfile.enableAzureRbac, localAccountsDisabled:disableLocalAccounts, kubernetesRbac:enableRbac}"
# Who can list cluster credentials (admin or user) on this cluster
az role assignment list --scope $(az aks show -g <rg> -n <aks> --query id -o tsv) --include-inherited -o table
# Detection: Activity Log operations Microsoft.ContainerService/managedClusters/listClusterAdminCredential/action
# and .../listClusterUserCredential/action; Defender for Containers alerts
# Fix: disable local accounts, use Entra ID authentication with Azure RBAC or Kubernetes RBAC
What to expect: If local accounts are enabled or Entra ID/RBAC is weak, anyone with credential-listing rights can reach cluster-admin or broad namespace access. Mitigation: Enforce Azure AD for AKS, granular Kubernetes RBAC, and least-priv on get-credentials.
Goal: Check whether the storage account behind a Function app, which can hold its host keys, is open to too many identities.
# Read-only: where does the Function app keep its keys? (setting names only, no values)
az functionapp config appsettings list -g <rg> -n <func> --query "[?name=='AzureWebJobsSecretStorageType' || name=='AzureWebJobsStorage'].name" -o tsv
# How is the backing storage account protected?
az storage account show -g <rg> -n <func_storage_acct> --query "{sharedKeyAccess:allowSharedKeyAccess, publicNetworkAccess:publicNetworkAccess, defaultAction:networkRuleSet.defaultAction}"
az role assignment list --scope $(az storage account show -g <rg> -n <func_storage_acct> --query id -o tsv) --include-inherited -o table
# Detection: Activity Log operation Microsoft.Storage/storageAccounts/listKeys/action;
# storage resource logs for reads of the azure-webjobs-secrets container
# Fix: Key Vault for secret storage, disable shared key access, private endpoints, rotate function keys
Mitigation
Goal: Find app registrations and service principals where an attacker could gain persistence through credentials, owners or permissions.
Common abuse paths
Read-only checks
# Credentials on an app registration (metadata only: key IDs, names, expiry; no secret values)
az ad app credential list --id <APP_ID> -o table
# Owners, who can add new credentials
az ad app owner list --id <APP_ID> --query "[].userPrincipalName" -o tsv
# Requested API permissions and existing grants
az ad app permission list --id <APP_ID> -o table
az ad app permission list-grants --id <APP_ID> --show-resource-name -o table
# Detection: Entra ID audit log activities "Update application - Certificates and secrets management",
# "Add owner to application", "Add app role assignment to service principal" and "Consent to application"
# Fix: restrict who can register apps and grant consent, use PIM for application admin roles,
# alert on new credentials and owners
Mitigation
Goal: Find VMs with managed identities and measure what a token for that identity could reach, without requesting one.
# Read-only: which managed identity does the VM have? (no token is requested from IMDS)
az vm identity show -g <rg> -n <vm>
# What can that identity reach? Use the principalId from the output above
az role assignment list --assignee <principalId> --all -o table
# Detection: Entra ID managed identity sign-in logs from unexpected resources;
# Defender for Cloud alerts on anomalous managed identity activity
# Fix: least-privilege scopes, user-assigned identities, no identity where none is needed
Mitigation
Goal: Find identities that can run commands as root (Linux) or NT AUTHORITY\SYSTEM (Windows) through Microsoft.Compute/virtualMachines/runCommand/action, which Contributor includes.
# Read-only: who holds roles that include Run Command on this VM? (no command is executed)
az role assignment list --scope $(az vm show -g <rg> -n <vm> --query id -o tsv) --include-inherited -o table
# Custom roles and their actions, to spot Microsoft.Compute/virtualMachines/runCommand/action
az role definition list --custom-role-only true --query "[].{role:roleName, actions:permissions[].actions}" -o json
# Detection: Activity Log operation Microsoft.Compute/virtualMachines/runCommand/action;
# Defender for Servers alerts on suspicious Run Command use
# Fix: custom roles without runCommand, just-in-time VM access, Azure Bastion for maintenance
Mitigation
Goal: Check who can export managed disks through a SAS URL and whether exports are restricted.
# Read-only: can this disk be exported, and how? (no SAS URL is generated)
az disk show -g <rg> -n <diskName> --query "{networkAccessPolicy:networkAccessPolicy, publicNetworkAccess:publicNetworkAccess, dataAccessAuthMode:dataAccessAuthMode}"
# Who can call beginGetAccess on it (Owner and Contributor include it)
az role assignment list --scope $(az disk show -g <rg> -n <diskName> --query id -o tsv) --include-inherited -o table
# Detection: Activity Log operation Microsoft.Compute/disks/beginGetAccess/action
# Fix: networkAccessPolicy DenyAll or AllowPrivate, dataAccessAuthMode AzureActiveDirectory, narrower roles
Mitigation
grant-access operations.Goal: Check whether the SCM (Kudu) site and its settings are reachable with weak authentication.
# Read-only: is basic authentication (publishing credentials) allowed for SCM/Kudu and FTP?
az resource show -g <rg> -n scm --namespace Microsoft.Web --resource-type basicPublishingCredentialsPolicies --parent sites/<app> --query properties.allow
az resource show -g <rg> -n ftp --namespace Microsoft.Web --resource-type basicPublishingCredentialsPolicies --parent sites/<app> --query properties.allow
# Access restrictions on the SCM site
az webapp config access-restriction show -g <rg> -n <app> --query "{scmUsesMainRules:scmIpSecurityRestrictionsUseMain, scmRules:scmIpSecurityRestrictions}"
# App settings that are not Key Vault references (names only, no values)
az webapp config appsettings list -g <rg> -n <app> --query "[?!starts_with(to_string(value), '@Microsoft.KeyVault')].name" -o tsv
# Detection: Activity Log operations Microsoft.Web/sites/publishxml/action and Microsoft.Web/sites/config/list/action
# Fix: disable basic auth, restrict SCM access, move secrets to Key Vault references
Mitigation
Use this checklist to scope a test or to check that a provider’s proposal covers the areas attackers use most.
| Area | What to check | Common finding |
|---|---|---|
| Entra ID tenant settings | Default user permissions, guest access, who can register apps and grant consent | Any user can register apps or consent to risky permissions |
| Privileged roles and PIM | Standing Global Administrator and other privileged roles; PIM activation rules | Permanent admins with no just-in-time activation |
| Conditional Access and MFA | Policy coverage, exclusions, legacy authentication | Service or emergency accounts excluded from MFA without monitoring |
| App registrations and service principals | Owners, credentials, Microsoft Graph application permissions | Non-admin owner of an app with high-privilege Graph permissions |
| Azure RBAC | Owner, Contributor and User Access Administrator at broad scopes; custom roles | Contributor at subscription scope for many users |
| Managed identities | Which resources have identities and what those identities can reach | VM identity with Contributor on the whole subscription |
| Storage accounts | Anonymous blob access, shared key access, SAS lifetime, network rules | Container listable without authentication |
| Key Vault | Permission model, who can read secrets, network access, purge protection | Broad secret read access through a legacy access policy |
| Network exposure | Public IPs, NSG rules, management ports, private endpoints | RDP or SSH open to the internet |
| Compute | VM Run Command, disk export through SAS, VM extensions | Contributor users can run commands as SYSTEM or root |
| Containers (ACR and AKS) | ACR admin user, anonymous pull, AKS authentication and Kubernetes RBAC | ACR admin user enabled; local accounts on AKS |
| App Service and Functions | SCM (Kudu) access, basic auth publishing, secrets in app settings | Publishing credentials enabled; secrets in plain app settings |
| Logging and detection | Activity Log retention and export, Entra ID logs, Defender for Cloud plans, Sentinel rules | Logs kept but no alert on role or credential changes |
For the cluster layer inside AKS, our Kubernetes penetration testing guide goes deeper. Name Microsoft 365 workloads such as Exchange Online or SharePoint in the scope explicitly if you want them tested.
| Tool | Usage | Link |
|---|---|---|
| ROADtools (ROADrecon) | Azure AD / Entra ID enumeration | https://github.com/dirkjanm/ROADtools |
| AADInternals | Advanced Entra ID / Azure AD PowerShell toolkit | https://github.com/Gerenios/AADInternals |
| AzureHound | Azure data exporter for BloodHound (collection) | https://github.com/SpecterOps/AzureHound |
| BloodHound | Graph-based attack-path analysis | https://github.com/SpecterOps/BloodHound |
| MicroBurst | Automated Azure attack & escalation scripts | https://github.com/NetSPI/MicroBurst |
| Azure CLI (azure-cli) | Authenticated Azure enumeration & management | https://github.com/Azure/azure-cli |
| Azure PowerShell (azure-powershell / Az) | Authenticated Azure enumeration and management from PowerShell | https://github.com/Azure/azure-powershell |
| Azure Storage Explorer | GUI for browsing and copying Azure Storage data | https://github.com/microsoft/AzureStorageExplorer |
| ScoutSuite | Multi-cloud security posture auditing | https://github.com/nccgroup/ScoutSuite |
| CloudSploit (Aqua / cloudsploit) | Cloud configuration / CSPM checks | https://github.com/aquasecurity/cloudsploit |
| Impacket | Post-exploitation / AD lateral movement | https://github.com/fortra/impacket |
| NetExec (successor to CrackMapExec) | Network and Active Directory credential testing and lateral movement | https://github.com/Pennyw0rth/NetExec |
| PowerZure | PowerShell Azure reconnaissance & exploitation | https://github.com/hausec/PowerZure |
For a wider comparison of tools across AWS, Azure and Google Cloud, see our cloud penetration testing tools guide.
An Azure penetration testing report should let leadership see the risk and let engineers reproduce and fix every issue. Beyond the executive summary, it needs Azure-specific detail:
Example finding: Contributor role allows command execution on production VMs. Evidence: a read-only role assignment review shows a broad group of users with Contributor on the production subscription, and that role includes Microsoft.Compute/virtualMachines/runCommand/action, which runs commands as SYSTEM or root. Detection: no alert rule watches that Activity Log operation. Remediation: a custom role without Run Command, plus just-in-time access.
For report structure, severity scoring and how to read a report you receive, see our guide to the penetration testing report. If you want the test done for you, DeepStrike’s cloud penetration testing services cover Azure environments, including identity and access management, privilege escalation testing and retesting of fixed findings.
No. Microsoft has not required pre-approval for penetration testing of Azure resources since June 15, 2017. You must still follow the Microsoft Cloud Unified Penetration Testing Rules of Engagement, and you may only test resources you own or are explicitly authorized to test.
Microsoft prohibits denial-of-service testing of any kind, testing tenants or data you do not own, using credentials or secrets that are not your own, network-intensive fuzzing, phishing Microsoft employees, and post-exploitation against Microsoft online services beyond an initial proof of concept.
A typical test covers Microsoft Entra ID users, roles and app registrations; Azure RBAC and managed identities; storage accounts and Key Vault; containers (ACR, AKS); Functions and App Service; network exposure; and whether logging and detection catch the attack paths found.
Yes. Consulting firms, managed security providers and red teams can test Azure resources with explicit written authorization from the resource owner, documented in the service agreement before testing begins.
Agree scope and testing windows in writing, use dedicated test accounts, start with read-only enumeration, avoid any denial-of-service or high-volume traffic, and keep the signed authorization ready in case Azure flags the activity.
A scope record (tenant, subscriptions, test accounts, dates and source IP addresses), an executive summary, attack-path narratives, findings with affected resource IDs, evidence, severity and remediation, the log event or alert each step should trigger, and retest results after fixes.
No. A security or configuration assessment compares settings with a benchmark such as the Microsoft cloud security benchmark or CIS. A penetration test goes further and shows which of those weaknesses an attacker can chain into real access, with evidence. Most Azure engagements combine both.
Yes, if they belong to your tenant and are named in your written scope. Microsoft’s rules of engagement cover its cloud services and encourage testing Conditional Access and your own detection, while still prohibiting testing other tenants, using credentials that are not yours and phishing Microsoft employees.
Expert Sources Referenced

Stay secure with DeepStrike penetration testing services. Reach out for a quote or customized technical proposal today
Contact Us