GithubHelp home page GithubHelp logo

rhadi2005 / azure-cost-mgt-elt Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gitpavleenbali/python-for-azure

0.0 0.0 0.0 32 KB

Helpful Python based explorations on Microsoft Azure

Python 100.00%

azure-cost-mgt-elt's Introduction

Python-for-Azure

Helpful Python based explorations on Microsoft Azure

Dynamic Cost Analysis and Alert (DCAA)

this works o, EA subscription (tested on VCF DEV) this doesnot work on CSP subscription (tested on OCBPS)

https://medium.com/python-for-azure/python-for-azure-dynamic-cost-analysis-alerts-dcaa-in-azure-cost-management-b05ab632e4a4

pip install -r requirements.txt

There is also a forecasted projection provided via Azure cost management but that is again based on “historical trends”, the main challenge here is to have “dynamic monitoring and alerts” for some unexpected, random and sudden high Azure resource “utilization spike” that can increases the cost of Azure consumption drastically.

In order to tackle this challenge, I have developed a custom solution via Python SDK for Azure especially using “Cost Management API” to make this cost management either for a list of “Resource Groups” or “Subscriptions” dynamic; so that some sudden high utilization abnormalities of Azure resources can be first identified and later handled via condition based alerting mechanism. In this workflow demo threshold-value is set to +20% i.e., if the current cost is 20% more than the total-cost of the cost incurred for the last-week, then the script will generate an exception with message, ‘“Cost Exceeded! Take Action!”

Workflow

  1. The script below demonstrates the usage of Python SDK for Azure for implementing the above said workflow i.e., setting up dynamic cost analysis and alert (DCAA) for the two scenarios as listed below:

Scenario I: Setting up DCAA for specific resource-groups under a similar or different subscription [Python Script] Scenario II: Setting up DCAA for a subscription or a list of subscriptions that we want to monitor [Python Script]

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.