How to create an Azure AKS service through ARM Template

8/8/2018

I am working on Azure Kubernetes service. I am creating AKS through portal successfully. But, I need to do it through the ARM Templates.

How to create AKS with help of ARM Templates?

For this, I followed link

But, here am receiving an issue like:

Code : InvalidTemplate

Message : Deployment template validation failed: 'The template resource 'AKSsubnet/Microsoft.Authorization/36985XXX-XXXX-XXXX-XXXX-5fb6b7ebXXXX' for type 'Microsoft.Network/virtualNetworks/subnets/providers/roleAssignments' at line '53' and column '9' has incorrect segment lengths. A nested resource type must have identical number of segments as its resource name. A root resource type must have segment length one greater than its resource name. Please see https://aka.ms/arm-template/#resources for usage details.'.

-- Mani
arm-template
azure
kubernetes

3 Answers

12/6/2019

I suspect you have provided the incorrectly formatted string in the "name" field of the resource. It should follow the pattern like this- "{resource-name}/Microsoft.Authorization/{role-assign-GUID}"

More on this here- https://docs.microsoft.com/en-us/azure/role-based-access-control/role-assignments-template#resource

-- Suneet Nangia
Source: StackOverflow

3/22/2019

Old thread but here is why the AKS Advanced Networking ARM Template is not working for you.

One of the steps in the deployment assigns the SP as a contributor to the newly created AKS subnets so that the SP can work its advanced networking magic.

In order to assign a role in a RG one needs to have Owner permissions on that RG.

-- old_newb
Source: StackOverflow

8/9/2018

How to create AKS with help of ARM Templates?

One of the most direct methods, navigate to creating AKS page in the portal, fill the attributes, click Download a template for automation, then you will get the template.

enter image description here

You could test the template in the Custom deployment, it will work fine.

enter image description here

-- Joy Wang
Source: StackOverflow