The Wayback Machine - https://web.archive.org/web/20241128003416/https://www.geeksforgeeks.org/microsoft-azure-starting-stopping-a-azure-kubernetes-service-cluster/
Open In App

Microsoft Azure – Starting & Stopping a Azure Kubernetes Service Cluster

Last Updated : 31 Mar, 2023
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

In this article, we will learn how to stop and start Azure Kubernetes Service(AKS) clusters. You can stop your entire Azure Kubernetes Service cluster to save costs. To follow along, you will need an existing Azure Kubernetes service that is running. 

To use start and stop for AKS, we need the AKS preview extension for the Azure CLI.  It can be installed using the below command:

extension add --name aks-preview

Let’s make sure that we have the latest version of that using the below command:

az extension update --name aks-preview

Next, we need to register the start/stop preview feature using the below command:

az feature register --namespace "Microsoft.ContainereService" --name "StartStopPreview"

 This can take a while. After a couple of minutes, check if the feature is registered with the below command:

az feature list -o table --query 
    "[?contains(name,'Microsoft.ContainereService/StartStopPreview')].{Name:name,
    State:properties.state}"

Now we need to refresh the container resource provider using the below command:

az provider register --namespace Microsoft.ContainerService

That’s all the preview stuff out of the way. Now, it could be that you don’t need to do all of this when this feature is generally available.

Let’s stop our AKS cluster with the below command:

az aks stop --name YOUR_CLUSTE_NAME --resource-group YOUR_RESOURCE_GROUP

It’s as simple as that. This will result in something like below if we use the below command:

az aks show

The power state is stopped, so the cluster is stopped.

We can just as easily start it up again using the below command:

az aks start --name YOUR_CLUSTE_NAME --resource-group YOUR_RESOURCE_GROUP

We’ll use AKS show to check if it is running as shown below:

Stopping an Azure Kubernetes Service cluster is a great way to save money. You can easily start and stop AKS with an Azure CLI command, which you can, for instance, automate to stop when this surface isn’t used and start during business hours. 


Previous Article
Next Article

Similar Reads

Kubernetes Cluster Autoscaler: Dynamically Adjusting Cluster Size
Kubernetes cluster autoscaler allows automatically expanding or decreasing the number of nodes or altering pod resources based on demand. When demand rises, the cluster can add nodes or allocate more resources to pods when demand falls, Kubernetes can remove nodes or assign fewer resources to a pod. This can assist optimize resource utilization and
4 min read
Microsoft Azure - Availability Zones For Kubernetes Cluster
In this article, we will learn how to create a highly available Kubernetes cluster with availability zones. When you create an Azure Kubernetes service or AKS cluster in Azure, its nodes and storage all reside in the same datacenter. The cluster is protected from hardware failure and maintenance within the data center because the nodes and storage
2 min read
Kubernetes Cluster Components with Emphasis on AWS Elastic Kubernetes Services
Four out of ten enterprise companies included in the Cloud Native Computing Foundation’s biannual survey reported that they’re running Kubernetes in production environments. As more and more organizations move to microservice and cloud-native architectures that make use of containers, they’re looking for strong, proven platforms. Practitioners are
8 min read
How to Deploy a Kubernetes Cluster in Azure Virtual Machines?
Azure Kubernetes Service provides a platform for managing containers with the help of Kubernetes. It also provides an easy and managed way for the deployment and scaling of containerized applications. Containerized applications are deployed in the Kubernetes cluster in Azure. But we can also manually set up a Kubernetes cluster in Azure. Let's see
5 min read
Microsoft Azure - Create App Service Plan for Windows Service using CLI
Pre-requisite:- Azure An App Service Plan is a subscription model for hosting apps on Azure. It allows you to host multiple apps on a single server without paying for each app separately. This article will show you how to deploy an Azure App Service Plan with Windows service type using Azure CLI (Command Line Interface) from Azure Portal using Clou
2 min read
Microsoft Azure - Using Github Action in Azure App Service
In this article, we will learn how to use GitHub Actions from Azure App Service. GitHub Actions enables us to automate builds and deployments which results in better quality software. For the purpose of demonstration, let's use it from this Azure App Service Web App that we've already created. This is a new web app, and we haven't deployed an app i
2 min read
Microsoft Azure - Azure App Service Managed Certificates
In this article, we will learn what you can do with the Azure CLI Interactive Mode. You can do a lot of powerful things with the Azure CLI like create web apps and VMs and you can do even more with the CLI when you use its interactive mode. Let's try that. We'll try that in the Azure Cloud Shell, but you can also use an Azure CLI that is installed
3 min read
Microsoft Azure - Create App Service Plan For Linux (Azure CLI)
An app service plan is a subscription model for hosting apps on Azure. It allows you to host multiple apps on a single server without having to pay for each app separately. In this article, we will show you how to deploy an Azure App Service Plan for Linux service type using Azure CLI (Command Line Interface) from Azure Portal in simple easy steps.
2 min read
Microsoft Azure - Azure Media Service
Azure Media Service is a cloud-based platform that enables you to build media-based solutions. Examples like OTT (Over-The-Top Media Service), Live Streaming Apps like Youtube, Vimeo, Facebook live stream,...etc. Encoding Videos for different formats for different platforms. Encoding Services – Indexer, Hyperlapse, Face Detector and Face Redaction,
4 min read
Microsoft Azure - Mount Azure Storage in Container App In App Service
In this article, we are going to learn how to mount Azure Storage as a local share for App Services Linux web apps. Implementation: So to start the process of connecting to Azure Storage mount, you should click on configuration. Once you are inside the configuration blade, click on path mappings. Start by giving it a name. For eg name it s1share. A
3 min read
Microsoft Azure - Working with Files in Azure App Service
Azure App Service is an HTTP-based service for hosting web applications, REST APIs, and mobile back ends. In this article, we will look into the process of working with files in the Azure App service using an example. Console Access to my App Services:We can go to the Azure Portal and select my App Services and click on the console under Developmen
2 min read
Microsoft Azure- Add Extensions in Azure App Service
In this article, we will learn how to add extensions to web applications in the Azure App service. We can add additional functionality to Azure app services by using extensions. Adding Extensions to Azure App Service: To do so follow the below-given steps: Step 1: Click on an "Instance" in my Azure app services application. Step 2: Look for "Extens
1 min read
Microsoft Azure - Using Azure Service Bus Queues
In this article, we will learn how to use Azure Service Bus Queues. We can use Azure Service Bus Queues to decouple applications and make them more scalable and available. Applications send messages to an Azure Service Bus Queue. Messages stay there until they are deleted or expire. Receiving applications, reading and deleting messages from the que
2 min read
Microsoft Azure - Azure Application Service Environments v2 Private PaaS Environments in the Cloud
Pre-requisite: Azure Microsoft Azure is a Cloud Computing Platform and Infrastructure created by Microsoft for building, deploying, and managing applications and services through a global network of Microsoft-managed data centers. Azure Application Service Environments (ASE) v2 is a private Platform as a Service (PaaS) environment in the cloud that
5 min read
Microsoft Azure - Getting started with Azure Machine Learning Service
Pre-requisite: Azure Azure is a cloud computing service created by Microsoft for building, testing, deploying, and managing applications and services. Azure Machine Learning is a fully managed cloud service to do the following tasks: Cloud-based predictive analytics service. Provides tools to create complete machine-learning solutions in the cloud.
6 min read
Microsoft Azure - Get Unused App Service Plans and Resource Groups in Azure Portal
Pre-requisite: AZURE In this article, we will be using the resource graph query to find the unused Azure App Service Plans and unused Azure Resource Groups. For this will be using the Resource Graph Explorer which is an Azure native tool that can be accessed from Azure Portal with ease. To run the KQL resource graph query one should have the minimu
3 min read
What is Azure Kubernetes Service?
Kubernetes is an open-source platform for automating the deployment, scaling, and management of containerized applications. It has become the de facto standard for managing containers in production and is used by organizations of all sizes to improve the speed and reliability of their application deployments. Azure Kubernetes Service (AKS)Azure Kub
6 min read
How To Use Azure Kubernetes Service For Container Orchestration ?
Azure Kubernetes Service provides a platform for managing containers with the help of Kubernetes. It also provides an easy and managed way for the deployment and scaling of containerized applications. Containerized applications are deployed in the Kubernetes cluster in Azure. Let's see how to use the Azure Kubernetes Service for deploying container
4 min read
Microsoft Azure - Get Azure VM Properties using Azure PowerShell
The purpose of using the Azure PowerShell Commands is to quickly analyze the overall properties of VM/VMs at once the filtering the with select and where conditions. To find the properties of an Azure VM, you can perform the following commands in Azure Cloud Shell to get the details. Command: Get-AzVM Output: 1. Get all properties of an Azure Virtu
2 min read
Microsoft Azure - RDP to Azure Virtual Machines using Azure Bastion
In this article, we will learn how to do RDP(Remote Desktop Protocol) / SSH(Secure Shell) Connection to an Azure VM using Azure Bastion. First, let's discuss Azure Bastion. The Azure Bastion service is a fully platform-managed PaaS service that you provision inside your virtual network. It provides secure and seamless RDP/SSH connectivity to your v
3 min read
Microsoft Azure - Configure Azure SQL with Azure CLI
In this article, we're going to take a closer look at how you can configure something like connectivity using the Azure CLI. What we have here is we are in Azure Data Studio and similar to the SQL notebook we are actually using a PowerShell notebook. That just means all our code cells are going to run PowerShell and we are just connecting to localh
4 min read
Microsoft Azure - Archive Azure VM to Azure Storage Account
In this article, we will be implementing a solution to archive a select azure VM snapshot to a select storage account for archiving using azure cloud shell. For implementation, we will be using Azure CLI commands. Prerequisite:VM SnapshotA storage account is neededUser needs "Storage Blob Contributor Data" IAM Role Access on Archiving Storage Accou
2 min read
Microsoft Azure - Check Status of Azure VM using Azure PowerShell
The following Azure PowerShell command helps you to find the Azure VM Config and properties details of Os Name, Os Version, Hyper V Generation, Disks properties, Extensions properties of Type Handler Version, Status and Message, VM Agents properties of Type Handler Version, Status and Message and also VM Power Status Codes, Messages, Plugins, Time
3 min read
Microsoft Azure - Azure VM Disk Space in Percentage using Azure KQL
Here we'll be using the Azure Insights Metric Query to find the free disk space in percentage using KQL. The purpose of this query is to find disk drive free space of all the Azure VMs without logging into every server. You can Run the following KQL log Queries in Azure Monitor or Azure VM Logs or Log Analytics Workspace. Note: VM Insights Agent sh
1 min read
Microsoft Azure - Enable Azure Monitor VM Insights Agent For Azure VM
Azure Monitor VM Insights Agent enables you to get more visibility into the health and performance of your Azure VM. Here we'll see how we can enable Azure Monitor VM Insights to monitor the health, performance, and dependencies of azure virtual machines. Implementation: Follow the below steps to enable Azure Monitor VM insights agents for an Azure
2 min read
Microsoft Azure - Azure CLI Commands to Manage Azure VMs
Azure Command-line interface is used to manage or to create Azure resources. By using the simple AZ CLI command we can manage Azure VM quickly and at a Scale. Let's get started by using a few important Azure CLI commands to manage Azure Virtual Machines. 1. Start a Specific Stopped VM in a Select Resource Group Use the below command to start a spec
2 min read
Microsoft Azure - Manage Azure VMs using Azure PowerShell Commands
Here we are using Azure PS Commands to manage azure resources from Azure Cloud Shell or by using Windows PowerShell. By using the simple AZ PS command we can manage Azure VM Quicks without any efforts of navigating in Azure Portal and at Scale. Let's get started by using the major Azure PS commands to manage Azure Virtual Machine. 1. Start a Specif
2 min read
Microsoft Azure - Query Azure Storage Logs in Azure Monitor Log Analytics
Pre-requisite:- Azure Log Analytics is a tool offered by Azure, which is used to edit and run log queries against data in the Azure Monitor Logs store and helps interactively analyze their results. One can easily use Log Analytics queries to retrieve records that match particular criteria, identify trends, analyze patterns, and provide various insi
5 min read
Microsoft Azure - Install Azure Command Line Interface (Azure CLI)
Azure CLI is a very powerful tool that can be used to automate tasks, create, update, manage or delete azure resources or to troubleshoot problems with az module cmdlets. By installing az modules on your system or on your development system you and your development team can easily create, update or manage Azure AD and Azure resources such as manage
4 min read
Microsoft Azure - Get CPU Utilization Data of a Azure VM in Azure Portal
Azure Virtual Machines (VM) is one of several types of on-demand, scalable computing resources that Azure offers. In this article, we will look into the process of getting the CPU Utilization data of an Azure VM in Azure Portal. Implementation:Follow the steps to get the CPU Utilization of an Azure VM in Azure Portal: Step 1: Log in to your Azure P
2 min read
three90RightbarBannerImg