Peter Wyss
Peter Wyss

Reputation: 435

AKS start/stop cluster in PowerShell

Is it possible to run this two commands as a PowerShell cmdlet?

az aks stop --name myAKSCluster --resource-group myResourceGroup

az aks start --name myAKSCluster --resource-group myResourceGroup

I cannot find the PowerShell equivalent here: https://learn.microsoft.com/en-us/powershell/module/az.aks/?view=azps-6.2.1

The reason why I'm asking this:

Thanks for your help

Upvotes: 1

Views: 2082

Answers (2)

kunal
kunal

Reputation: 476

Usually if we use PowerShell then Automation runbook can work for us. Unfortunately I could not find PowerShell to start/ stop AKS. I found this marketplace solution that runs a VM and shuts down/ starts AKS cluster on the time specified. Refer this link for the deployment - https://azuremarketplace.microsoft.com/en-in/marketplace/apps/bowspritconsultingopcprivatelimited1596291408582.aksautomation2?tab=Overview

Upvotes: 0

AjayKumarGhose
AjayKumarGhose

Reputation: 4883

Using Powershell cmdlet you can run in Azure Automation runbook to start /stop AKS cluster here.

az aks stop --name myAKSCluster --resource-group myResourceGroup

az aks start --name myAKSCluster --resource-group myResourceGroup

You Can use this above command in Azure CLI to stop and start a Kubernetes Service Cluster.

To Start and Stop AKS Cluster using Powershell You need to use below example code:

Start-AzAksCluster -ResourceGroupName group -Name myCluster
Stop-AzAksCluster -ResourceGroupName group -Name myCluster

For further details please refer this Link.

Upvotes: 0

Related Questions