> ## Documentation Index
> Fetch the complete documentation index at: https://docs.keephq.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Azure AKS

> Azure AKS provider to view kubernetes resources.

## Connecting with the Provider

To connect to Azure AKS, follow below steps:

1. Log in to your [Azure](https://azure.microsoft.com/) account.
2. Go to your kubernetes service page and click on `Connect` button and then click on `Open Cloud Shell`.
3. Run `az ad sp create-for-rbac --role owner --scopes /subscriptions/<YOUR_SUBSCRIPTION_ID>` in the cloud shell, you will get response similar to:
   ```
    {
      "appId": "xxxxxx-xxxxx-xxxxxx-xxxx",
      "displayName": "azure-cli-2023-11-06-13-00-52",
      "password": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
      "tenant": "xxxxx-xxxxx-xxxx-xxxxx"
    }
   ```
   In above JSON object, the `appId` is `client_id`, `password` is `client_secret` and `tenant` is `tenant_id`

## Notes

* This provider allows you to interact with Azure AKS to query resources in kubernetes cluster.

## Authentication

This provider requires authentication.

* **subscription\_id**: The azure subscription id (required: True, sensitive: True)
* **client\_id**: The azure client id (required: True, sensitive: True)
* **client\_secret**: The azure client secret (required: True, sensitive: True)
* **tenant\_id**: The azure tenant id (required: True, sensitive: True)
* **resource\_group\_name**: The azure aks resource group name (required: True, sensitive: True)
* **resource\_name**: The azure aks cluster name (required: True, sensitive: True)

## In workflows

This provider can be used in workflows.

As "step" to query data, example:

```yaml theme={null}
steps:
    - name: Query aks
      provider: aks
      config: "{{ provider.my_provider_name }}"
      with:
        command_type: {value}  # The command type to operate on the k8s cluster (`get_pods`, `get_pvc`, `get_node_pressure`).
```

Check the following workflow example:

* [aks\_basic.yml](https://github.com/keephq/keep/blob/main/examples/workflows/aks_basic.yml)

## Useful Links

* [Azure AKS List Cluster User Creds](https://learn.microsoft.com/en-us/rest/api/aks/managed-clusters/list-cluster-user-credentials?view=rest-aks-2023-08-01\&tabs=HTTP)
* [Azure AKS Doc](https://learn.microsoft.com/en-us/azure/aks/)
