> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/azure.md). Agents can also search and read this documentation through its [MCP server](https://developer.harness.io/~gitbook/mcp).

# Azure

Azure chaos faults that stop, stress, or disrupt virtual machines, AKS node pools, managed disks, App Service web apps, and Service Bus queues.

Azure faults act on Azure resources through the Azure Resource Manager API. Stress faults run their workload inside the VM with Azure Run Command. All Azure faults run on a Kubernetes chaos infrastructure, which can sit in AKS or in any cluster that can reach the Azure API.

***

## Before you begin

* **Chaos infrastructure:** A Kubernetes chaos infrastructure that can reach the Azure Resource Manager endpoint (`management.azure.com`). Go to [Get started](https://developer.harness.io/resilience-testing/chaos-testing/get-started.md) to install one.
* **Authentication:** The faults need an Azure identity: a service principal in a Harness file secret, workload identity, or a managed identity. Go to [Azure fault authentication](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/azure/authentication.md) to set one up.
* **Permissions:** The identity needs the Azure RBAC actions each fault uses on the target subscription or resource group. Go to [Azure fault permissions](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/azure/permissions.md) for the combined role.
* **Subscription:** Each fault sets the target subscription in `AZURE_SUBSCRIPTION_ID` and the resource group in `RESOURCE_GROUP`.

***

## Supported environments

Azure faults target resources in any Azure public cloud region. A fault page lists any environment below that it does not support.

| Environment                                                                  | Faults that target it                                                                                                                                                                                                                                    |
| ---------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Standalone Linux and Windows VMs                                             | Instance stop, instance CPU, memory, and IO stress, and disk loss. Stress faults run Linux commands; use the [Windows faults](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/windows.md) for in-guest stress on Windows VMs. |
| Virtual Machine Scale Set instances                                          | The same faults, with `SCALE_SET` set to `enable`                                                                                                                                                                                                        |
| AKS node pools backed by scale sets                                          | AKS node down, and VM faults with `SCALE_SET` set to `enable`                                                                                                                                                                                            |
| Managed data disks, including Ultra Disk and Premium SSD v2                  | Disk loss. OS disks are not supported.                                                                                                                                                                                                                   |
| App Service web apps and Function Apps, including App Service Environment v3 | Web app stop and web app access restrict                                                                                                                                                                                                                 |
| Service Bus Standard and Premium queues                                      | Service Bus queue state change. Topics, subscriptions, and the Basic tier are not supported.                                                                                                                                                             |

***

## Faults

| Fault                                                                                                                                                            | What it does                                                              | Failure type | Reversible |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------ | ---------- |
| [Azure AKS node down](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/azure/azure-aks-node-down.md)                                   | Deallocates a percentage of the scale set instances behind AKS node pools | State        | Yes        |
| [Azure disk loss](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/azure/azure-disk-loss.md)                                           | Detaches managed data disks from their VMs                                | Storage      | Yes        |
| [Azure instance CPU hog](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/azure/azure-instance-cpu-hog.md)                             | Consumes CPU on Azure VMs                                                 | Resource     | Yes        |
| [Azure instance IO stress](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/azure/azure-instance-io-stress.md)                         | Generates disk IO load on a mount path of Azure VMs                       | Resource     | Yes        |
| [Azure instance memory hog](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/azure/azure-instance-memory-hog.md)                       | Consumes memory on Azure VMs                                              | Resource     | Yes        |
| [Azure instance stop](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/azure/azure-instance-stop.md)                                   | Stops and deallocates Azure VMs                                           | State        | Yes        |
| [Azure Service Bus queue state change](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/azure/azure-service-bus-queue-state-change.md) | Disables sending, receiving, or both on Service Bus queues                | State        | Yes        |
| [Azure web app access restrict](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/azure/azure-web-app-access-restrict.md)               | Adds an access restriction rule to App Service web apps                   | Network      | Yes        |
| [Azure web app stop](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/azure/azure-web-app-stop.md)                                     | Stops App Service web apps                                                | State        | Yes        |

***

## Troubleshooting

<details>

<summary>An Azure fault fails with an AuthorizationFailed error</summary>

The identity the fault authenticates as does not have an action the fault calls on the target scope. The error names the action and the scope. Assign a role that includes it at the subscription or resource group, or assign the combined role. Go to [Azure fault permissions](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/azure/permissions.md) for the actions each fault needs.

</details>

<details>

<summary>An Azure fault cannot find credentials</summary>

The fault has no file secret set in `AZURE_AUTHENTICATION_SECRET`, and the chaos pod has no workload identity or managed identity to fall back to. Configure one of the three. Go to [Azure fault authentication](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/azure/authentication.md) for each method.

</details>

<details>

<summary>An Azure fault reports that a resource was not found</summary>

The resource is in a different subscription or resource group than the fault is looking in. Check `AZURE_SUBSCRIPTION_ID` and `RESOURCE_GROUP`. For AKS node down, the scale sets live in the node resource group (`MC_<resource-group>_<cluster>_<region>`), which the fault resolves from `AKS_RESOURCE_GROUP` and `AKS_CLUSTER_NAME`.

</details>

***

## Next steps

* Go to [Azure fault authentication](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/azure/authentication.md) to give faults access to your subscription.
* Go to [Azure fault permissions](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/azure/permissions.md) to grant the actions the faults use.
* Go to [Azure instance stop](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/azure/azure-instance-stop.md) to start with the most common Azure fault.

{% @harness-feedback/feedback %}
