sg3-141-592 / AzStartStop

Self service user interface for starting and stopping VMs on demand
https://vmstartstopdemo.compactcloud.co.uk/
MIT License
22 stars 2 forks source link
automation azure cost-optimization

Az. Start Stop

Az. Start Stop provides a simple interface to define schedules for stopping and starting your Virtual Machines, helping you reduce your compute cost.

Try it out here!

This solution has been created to address the following key requirements

Example image of Azure Start Stop User Interface

Deployment

Azure (Public)

Deploy to Azure

After installation you'll need to provide VM Contributor and Cost Management Reader permissions to the User Assigned Managed Identity created during deployment.

Enable Authentication

You can lock down access to Az. Start Stop to limit who can change your schedules to users in your Active Directory. In the deployed Function App, open the Authentication blade and select "Add identity provider".

Select Identity Provider "Microsoft". The default settings are fine to limit access to users in your Tenant.

License

This project is licensed under MIT

Contributor Notes

# Rebuild frontend styles
cd styles
npm install
npm run css-build

# Run the frontend
cd frontend
npm run serve

# Run function app
npm install -g azurite
azurite -l /tmp/azurite
func start

# Needed if you want to try out commands from the Azure Portal
az functionapp cors add --name compactcloud-startstop-1 --resource-group compactcloud-startstoptestdeploy --allowed-origins https://portal.azure.com

### How to create a new build
# Build the frontend content
# Note there seems to be an issue building with npm 9.8.0, node v20.5.1,
# I've been building using v18.7.1
npm run build
# We have to do this to bundle the front-end with the function app
cp -r frontend/dist/ app/dist
# Carry out the build locally creating a full .squashfs build of the app
func azure functionapp publish compactcloud-startstop-1 --build local --build-native-deps