<p>Unable to add spot node pool to Azure Kubernetes Cluster</p>
<p>AWS-CLI</p>
<pre><code>azure-cli                         2.12.0

core                              2.12.0
telemetry                          1.0.6

Extensions:
aks-preview                       0.4.63
</code></pre>
<p>Following the instructions on Microsoft site: <a href="https://learn.microsoft.com/en-us/azure/aks/spot-node-pool" rel="nofollow noreferrer">https://learn.microsoft.com/en-us/azure/aks/spot-node-pool</a></p>
<p>Ran the following</p>
<pre><code># Create a resource group in East US
az group create --name myResourceGroup --location westus2

# Create a basic single-node AKS cluster
az aks create \
    --resource-group myResourceGroup \
    --name myAKSCluster \
    --vm-set-type VirtualMachineScaleSets \
    --node-count 1 \
    --generate-ssh-keys \
    --load-balancer-sku standard

az aks get-credentials --resource-group myResourceGroup --name myAKSCluster

az aks nodepool add \
    --resource-group myResourceGroup \
    --cluster-name myAKSCluster \
    --name spotnodepool \
    --priority Spot \
    --spot-max-price -1 \
    --eviction-policy Delete \
    --node-vm-size Standard_D2as_v4 \
    --node-count 1
</code></pre>
<p>Got the following error:
Error code:</p>
<pre><code>ValidationError: Operation failed with status: 'Bad Request'. Details: Provisioning of resource(s) for Agent Pool spotnodepool failed. Error: {
  &quot;code&quot;: &quot;InvalidTemplateDeployment&quot;,
  &quot;message&quot;: &quot;The template deployment failed with error: 'The resource with id: '/subscriptions/REDACTED/resourceGroups/MC_myResourceGroup_myAKSCluster_westus2/providers/Microsoft.Compute/virtualMachineScaleSets/aks-REDACTED-vmss' failed validation with message: 'The requested size for resource '/subscriptions/REDACTED/resourceGroups/MC_myResourceGroup_myAKSCluster_westus2/providers/Microsoft.Compute/virtualMachineScaleSets/aks-REDACTED-vmss' is currently not available in location 'westus2' zones '' for subscription 'REDACTED'. Please try another size or deploy to a different location or zones. See https://aka.ms/azureskunotavailable for details.'.'.&quot;
 }
</code></pre>
<p>I have tried other AZ region, useast, uswest2, etc but with no luck</p>
<p>If I run the following it will work:</p>
<pre><code>az aks nodepool add \
    --resource-group myResourceGroup \
    --cluster-name myAKSCluster \
    --name mynodepool \
    --node-count 1
</code></pre>
<p>Is spot node pool not supported? It is in the official docs: <a href="https://learn.microsoft.com/en-us/cli/azure/ext/aks-preview/aks/nodepool?view=azure-cli-latest" rel="nofollow noreferrer">https://learn.microsoft.com/en-us/cli/azure/ext/aks-preview/aks/nodepool?view=azure-cli-latest</a></p>

gpaw
<p>I just realised that this is not a AKS or Spot issue. This is a subscription issue.
In the docs (<a href="https://learn.microsoft.com/en-us/azure/virtual-machines/spot-vms#limitations" rel="nofollow noreferrer">https://learn.microsoft.com/en-us/azure/virtual-machines/spot-vms#limitations</a>) it says that only Pay-As-You-Go subscription are allowed to use spot instances. I just recently upgraded to Pay-As-You-Go model but my offerID is still stuck as &quot;Free Trial&quot; - I just need to be patient for it to change over</p>
