GithubHelp home page GithubHelp logo

wlxapatil / aks-start-stop-automation Goto Github PK

View Code? Open in Web Editor NEW

This project forked from latamocptechteam/aks-start-stop-automation

0.0 0.0 0.0 10 KB

Automation to start/stop AKS cluster using Azure Automation Powershell Scripts

License: Apache License 2.0

PowerShell 100.00%

aks-start-stop-automation's Introduction

AKS Start/Stop Automation

Azure Automation to start/stop AKS cluster using Azure Automation Powershell Script

How to Use It

1. Create an Azure Automation Account

Create an Azure Automation Account through Azure Portal.

Make sure that the 'Create Azure Run As account' flag is active

2. Give the Automation Account the proper permissions

Once your Automation account is created with the flag 'Create Azure Run As account' a new Service Principal will be created with the same name of your Automation Account plus a unique hash.

You should give Contributor permissions for this Service Principal in the AKS Clusters that you want to start/stop

3. Create your Runbooks

Open your newly created Azure Automation account > Go to the Runbooks Tab and create a new 'Powershell Runbook' called AKS Start. In your Runbook details page, click edit to open the editor and paste the contents of the StartCluster.ps1 file.

In the line 4, change the parameters and fill the values with your AKS Service Name, AKS Service Resource Group and AKS Service Subscription. You can add multiple lines to Start/Stop multiple clusters.

After that, hit Save and Publish.

Next, create a new Runbook called AKS Stop and do the same process, but this time using the StopCluster.ps1 file(Don't forget to change the script with your AKS values), then again, hit Save and Publish.

4. Test your Script

The next step is to test if the script is running fine, go first to the AKS Stop Runbok and hit Start, check if any errors are shown in the logs and if your AKS Cluster is now in the Stopped/Stopping State.

Now, go to the AKS Start Runbook and hit Start, check if any errors are shown in the logs and if your cluster is now on the Running/Starting state.

5. Create your Schedules

If you want to create an schedule to automatically Start/Stop your cluster go to the Schedule tab in your Azure Automation Account and Create a new Schedules, after that go to your Runbooks and Link them to your schedules.

aks-start-stop-automation's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.