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

<p>How to create AKS with help of ARM Templates? </p>

<p>For this, I followed <a href="https://github.com/neumanndaniel/armtemplates/blob/master/container/aks.json" rel="nofollow noreferrer">link</a></p>

<p>But, here am receiving an issue like:</p>

<blockquote>
  <p>Code    : InvalidTemplate</p>
  
  <p>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 <a href="https://aka.ms/arm-template/#resources" rel="nofollow noreferrer">https://aka.ms/arm-template/#resources</a> for usage details.'.</p>
</blockquote>

Mani
<blockquote>
  <p>How to create AKS with help of ARM Templates?</p>
</blockquote>

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

<p><a href="https://i.stack.imgur.com/UUpTb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UUpTb.png" alt="enter image description here"></a></p>

<p>You could test the template in the <strong>Custom deployment</strong>, it will work fine.</p>

<p><a href="https://i.stack.imgur.com/2ktg3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2ktg3.png" alt="enter image description here"></a></p>
