---
title: Scale an Azure Kubernetes Service (AKS) agent pool
source: https://docs.newrelic.com/docs/workflow-automation/setup-and-configure/actions-catalog/azure/azure-aks-scalepool
---

The Azure Kubernetes Service (AKS) actions let you manage your AKS clusters directly from your workflows.

## Scale an AKS agent pool [#azure-aks-scalepool]

This action scales an AKS agent pool by updating the node count using the [Agent Pools - Create Or Update - REST API](https://learn.microsoft.com/en-us/rest/api/aks/agent-pools/create-or-update?view=rest-aks-2026-03-01&tabs=HTTP).

### Inputs

| Input field         | Optionality | Type    | Description                                                                                                                                                                                       |
| ------------------- | ----------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `clientId`          | Required    | String  | An Azure Service Principal `clientID`. Must be passed as a secret. See how to [register an Azure app](https://learn.microsoft.com/en-us/azure/azure-monitor/logs/api/register-app-for-token).     |
| `clientSecret`      | Required    | String  | An Azure Service Principal `clientSecret`. Must be passed as a secret. See how to [register an Azure app](https://learn.microsoft.com/en-us/azure/azure-monitor/logs/api/register-app-for-token). |
| `tenantId`          | Required    | String  | The Azure tenant identifier. Can be passed as a secret.                                                                                                                                           |
| `subscriptionId`    | Required    | String  | The Azure subscription identifier (for example, `"12345678-1234-1234-1234-123456789abc"`).                                                                                                        |
| `resourceGroupName` | Required    | String  | The name of the resource group that contains the AKS cluster. For example, `"my-demo-rg"`.                                                                                                        |
| `clusterName`       | Required    | String  | The name of the AKS cluster.                                                                                                                                                                      |
| `agentPoolName`     | Required    | String  | The name of the specific agent pool (node pool) within the AKS cluster that you want to scale.                                                                                                    |
| `count`             | Required    | Integer | The desired number of nodes (virtual machines) to scale the agent pool.                                                                                                                           |
| `selectors`         | Optional    | List    | A list of selectors used to extract specific values from the response. For example, `[{"name": "statusCode", "expression": ".response.status_code"}]`.                                            |

### Outputs

| Output field        | Type    | Description                                                                                                                                                                                                             |
| ------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `success`           | Boolean | Indicates whether the action succeeded. Returns `true` or `false`.                                                                                                                                                      |
| `errorMessage`      | String  | Contains the failure reason as a message.                                                                                                                                                                               |
| `response`          | Object  | The Azure API body response. For more information, see the [Agent Pools - Create Or Update - REST API](https://learn.microsoft.com/en-us/rest/api/aks/agent-pools/create-or-update?view=rest-aks-2026-03-01&tabs=HTTP). |
| `asyncResponseUrl`  | String  | Optional for long running operation. The URL to poll for status.                                                                                                                                                        |
| `finalResponseUrl`  | String  | Optional for long running operation. The URL that returns the final result once the operation completes.                                                                                                                |
| `retryAfterSeconds` | Integer | Optional for long running operation. The number of seconds to wait before polling the async URL.                                                                                                                        |
| `eTag`              | String  | Optional. Used for concurrency control when updating a resource to avoid overwriting someone else's changes.                                                                                                            |

### Example

```yaml
name: scaleAzureAksPool
description: 'This Workflows scales azure aks scale pool'
steps:
  - name: azure_aks_scalePool_1
    type: action
    action: azure.aks.scalePool
    version: 1
    inputs:
      clientId: ${{ :secrets:azure-client-id }}
      clientSecret: ${{ :secrets:azure-client-secret }}
      tenantId: ${{ :secrets:azure-client-tenant }}
      subscriptionId: "12345678-1234-1234-1234-123456789abc"
      resourceGroupName: "my-resource-group"
      clusterName: test-cluster
      agentPoolName: agentpool
      count: 4
    next: end
```
