Mani
Mani

Reputation: 1334

How to create an Azure AKS service through ARM Template

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.'.

Upvotes: 1

Views: 1625

Answers (3)

Suneet Nangia
Suneet Nangia

Reputation: 1670

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://learn.microsoft.com/en-us/azure/role-based-access-control/role-assignments-template#resource

Upvotes: 0

old_newb
old_newb

Reputation: 99

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.

Upvotes: 1

Joy Wang
Joy Wang

Reputation: 42043

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

Upvotes: 1

Related Questions