<p>I'm trying to increase the maximum node count in my aks managed cluster with an api call, but I am getting this error: <code>{"code":"BadRequest","message":"Changing property 'identity' is not allowed."}</code></p>

<p>My url looks like this: 
<code>https://management.azure.com/subscriptions/my_subscription_id/resourceGroups/my_resource_group/providers/Microsoft.ContainerService/managedClusters/my_aks_cluster?api-version=2020-02-01</code></p>

<p>The data I'm trying to send:<br>
<code>{"location":"My Location", "properties":{"agentPoolProfiles":[{"name":"agentpool_name","maxCount":3}]}}</code></p>

Daniel
<p>You miss a few properties in the JSON you pass to the API.I capture the traffic using fiddler and this is what the server except to get:</p>

<pre class="lang-sh prettyprint-override"><code>{
    "id": "/subscriptions/%SUBSCRIPTION_ID%/resourcegroups/%RESOURCE_GROUP%/providers/Microsoft.ContainerService/managedClusters/%CLUSTER_NAME%/agentPools/%NODE_POOL_NAME%",
    "name": %NODE_POOL_NAME%,
    "type": "Microsoft.ContainerService/managedClusters/agentPools",
    "properties": {
        "count": 3,
        "vmSize": "Standard_D2s_v3",
        "osDiskSizeGB": 100,
        "vnetSubnetID": "/subscriptions/%SUBSCRIPTION_ID%resourceGroups/%VNET_RESOURCE_GROUP%/providers/Microsoft.Network/virtualNetworks/%CLUSTER_NAME%/subnets/%VNET_SUBNET_NAME%",
        "maxPods": 30,
        "type": "VirtualMachineScaleSets",
        "enableAutoScaling": false,
        "provisioningState": "Succeeded",
        "orchestratorVersion": "1.15.10",
        "enableNodePublicIP": false,
        "mode": "User",
        "osType": "Linux"
    }
}
</code></pre>

<p>Update the fields with your input (Be aware of the variables wrap with <code>% %</code> ).</p>

<p>The full command should look like that:</p>

<pre class="lang-sh prettyprint-override"><code>curl -X PUT -H "Authorization: Bearer [TOKEN]" -H "Content-Type: application/json" -d 'ABOVE_JSON' https://management.azure.com/subscriptions/%SUBSCRIPTION_ID%/resourceGroups/%RESOURCE_GROUP%/providers/Microsoft.ContainerService/managedClusters/%CLUSTER_NAME%/agentPools/%NODE_POOL_NAME%?api-version=2020-03-01
</code></pre>
