Customize cost data visualizations with Azure Workbooks and Azure Cost Management

Published Jun 02 2021 03:00 AM 3,008 Views
Contributor

Azure Workbooks have become a standard data visualization tool inside Azure. After starting in Azure Monitor, they now are also in Azure Sentinel, and Azure Security Center. Workbooks are incredibly dynamic, allowing you to create parameters that can be used throughout the workbook to both control what is seen by a user as well as inside queries. There are many things you can query from logs and metrics to Azure Resource Graph to Azure Resource Manager(ARM). This post will show you how to query Cost Management by using the ARM data source. Then we will make our query to ARM dynamic, because that is what sets Workbooks apart from a regular old dashboard.

 

Why might you want to query Cost Management from Workbooks? Well first because we can do parameters we can set a top level Subscription parameter and quickly get costs for all subscriptions. But we can also use tags as I describe in the dynamic monitoring post linked to above, we can show costs for infrastructure based on tag, or resource type right along side with operational monitoring data.

 

Query Azure Cost Management

Like pretty much everything now, it all comes back to an API. Naturally, Cost Management has an API that we can query. To query Cost Management in Workbooks we'll need the URL example from the docs, and a subscription id.

 

In this screen grab I've already setup a Subscription parameter, we'll want to do a new query, then select Azure Resource Manager as our data source. The HTTP Method is POST, and finally the path is /subscriptions/{Subscription:id}/providers/Microsoft.CostManagement/query?

 

Where {Subscription:id} is from our subscription parameter.

 

workbooks-costmanagement-query.png

 You'll also need to declare the api version you are using, in this case 2019-11-01 is what we're using.

Now that we have this setup, we need a JSON body to POST to the API to tell Cost Management what information we want back. There are a number of examples on the API docs linked to above, I also recently wrote about JSON body examples here, with some more straight forward examples than what is given on the docs.

 

I'll be using a simple body that brings me back my month to date cost, by subscription.

workbooks-costmanagement-jsonbody.png

 

JSON Path

The result you'll get back is JSON, so if we want this in a more readable format we'll need to use JSON Path. Under Results Settings, change Result Format to JSON Path. Then put $.properties in JSON Path Table.

workbooks-costmanagement-jsonpath.png

  Now this will bring back our data in a slightly prettier format than JSON.

 

Make it Dynamic!

Now that we've successfully queried Cost Management and formatted the results. Its time to put the power of Workbooks to use. We'll add two parameters, one for our Environment tag, IE Prod, Non Prod, QA etc. And one for Aggregation type, where we specify how we want the cost to be aggregated. 

 

workbooks-costmanagement-tag.png

This Environment parameter uses Azure Resource Graph to query all resources that have been tagged with Demo_Environment, where we have Dev, QA and Prod as options.

 

 

workbooks-costmanagement-aggregation.png

 

Aggregation is a simple JSON drop down where we manually specify the options we want to be available in the drop down.

  

Once we have our parameters setup, we can then add them into the JSON body. For Demo Environment we have added a Filter for Tags. We have placed Aggregation at the bottom under Grouping.

 {
   "type": "Usage",
   "timeframe": "MonthToDate",
   "dataset": {
     "granularity": "None",
     "filter": {
                 "tags" : {
                     "name" : "Demo_Environment",
                     "operator" : "In",
                     "values" : [
                        {Environment}
                     ]
                 }
     },
     "aggregation": {
       "totalCost": {
         "name": "PreTaxCost",
         "function": "Sum"
       }
     },
     "grouping": [
       {
         "type": "Dimension",
         "name": "{Aggregation}"
       }
     ]
   }
 }
This allows us to aggregate based on Resource Group, Subscription or even Resource Type, while selecting any individual tag or all 3 tags at the same time. This will then be translated by the workbook and sent to the Cost Management API.
 
Cost by subscription for Prod, QA and Dev
workbooks-costmanagement-costbysub.png
 
 Cost by resource type for Prod, QA and Dev
workbooks-costmanagement-costbytype.png
 
Cost by Resource Group for Prod
workbooks-costmanagement-rgprod.png
 
You can add more filters for other tags or even resource types in the JSON Body. Almost everything in the body can be parameterized. For instance, you can make a TimeFrame parameter to bring back cost for a specific cycle, like Week to date, the Last Billing cycle etc.
workbooks-costmanagement-timeframe.png
 
workbooks-costmanagement-lastbillingmonth.png
 
The only thing we can't make truly dynamic is querying subscription, because were sending a request to the API it can only be for one subscription at a time.
 
This workbook is on my github, so you don't have to recreate the wheel.
 
 

Summary

With the ability to query a number of different sources, Workbooks allow you to truly customize your data visualization across your Azure environment.  The ability to show Cost Management along side your resources and slice and dice it anyway you want or need is what Azure Workbooks are all about!

%3CLINGO-SUB%20id%3D%22lingo-sub-2387779%22%20slang%3D%22en-US%22%3ECustomize%20cost%20data%20visualizations%20with%20Azure%20Workbooks%20and%20Azure%20Cost%20Management%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2387779%22%20slang%3D%22en-US%22%3E%3CP%3EAzure%20Workbooks%20have%20become%20a%20standard%20data%20visualization%20tool%20inside%20Azure.%20After%20starting%20in%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fazure-monitor%2Fvisualize%2Fworkbooks-overview%3FWT.mc_id%3Dmodinfra-27678-socuff%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3EAzure%20Monitor%3C%2FA%3E%2C%20they%20now%20are%20also%20in%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fsentinel%2Ftutorial-monitor-your-data%3FWT.mc_id%3Dmodinfra-27678-socuff%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3EAzure%20Sentinel%3C%2FA%3E%2C%20and%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fsecurity-center%2Fcustom-dashboards-azure-workbooks%3FWT.mc_id%3Dmodinfra-27678-socuff%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3EAzure%20Security%20Center%3C%2FA%3E.%20Workbooks%20are%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fitops-talk-blog%2Fdynamic-monitoring-with-azure-monitor-workbooks-and-resource%2Fba-p%2F1244329%3FWT.mc_id%3Dmodinfra-27678-socuff%22%20target%3D%22_self%22%3Eincredibly%20dynamic%3C%2FA%3E%2C%20allowing%20you%20to%20create%20parameters%20that%20can%20be%20used%20throughout%20the%20workbook%20to%20both%20control%20what%20is%20seen%20by%20a%20user%20as%20well%20as%20inside%20queries.%20There%20are%20many%20things%20you%20can%20query%20from%20logs%20and%20metrics%20to%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fitops-talk-blog%2Fazure-resource-graph-zero-to-hero%2Fba-p%2F2303572%3FWT.mc_id%3Dmodinfra-27678-socuff%22%20target%3D%22_self%22%3EAzure%20Resource%20Graph%3C%2FA%3E%20to%20Azure%20Resource%20Manager(ARM).%20This%20post%20will%20show%20you%20how%20to%20query%20Cost%20Management%20by%20using%20the%20ARM%20data%20source.%20Then%20we%20will%20make%20our%20query%20to%20ARM%20dynamic%2C%20because%20that%20is%20what%20sets%20Workbooks%20apart%20from%20a%20regular%20old%20dashboard.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWhy%20might%20you%20want%20to%20query%20Cost%20Management%20from%20Workbooks%3F%20Well%20first%20because%20we%20can%20do%20parameters%20we%20can%20set%20a%20top%20level%20Subscription%20parameter%20and%20quickly%20get%20costs%20for%20all%20subscriptions.%20But%20we%20can%20also%20use%20tags%20as%20I%20describe%20in%20the%20dynamic%20monitoring%20post%20linked%20to%20above%2C%20we%20can%20show%20costs%20for%20infrastructure%20based%20on%20tag%2C%20or%20resource%20type%20right%20along%20side%20with%20operational%20monitoring%20data.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%226%22%3EQuery%20Azure%20Cost%20Management%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%20data-unlink%3D%22true%22%3ELike%20pretty%20much%20everything%20now%2C%20it%20all%20comes%20back%20to%20an%20API.%20Naturally%2C%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Frest%2Fapi%2Fcost-management%2Fquery%2Fusage%3FWT.mc_id%3Dmodinfra-27678-socuff%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3ECost%20Management%20has%20an%20API%3C%2FA%3E%26nbsp%3Bthat%20we%20can%20query.%20To%20query%20Cost%20Management%20in%20Workbooks%20we'll%20need%20the%20URL%20example%20from%20the%20docs%2C%20and%20a%20subscription%20id.%3C%2FP%3E%0A%3CP%20data-unlink%3D%22true%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20data-unlink%3D%22true%22%3EIn%20this%20screen%20grab%20I've%20already%20setup%20a%20Subscription%20parameter%2C%20we'll%20want%20to%20do%20a%20new%20query%2C%20then%20select%20Azure%20Resource%20Manager%20as%20our%20data%20source.%20The%20HTTP%20Method%20is%20POST%2C%20and%20finally%20the%20path%20is%26nbsp%3B%2Fsubscriptions%2F%7BSubscription%3Aid%7D%2Fproviders%2FMicrosoft.CostManagement%2Fquery%3F%3C%2FP%3E%0A%3CP%20data-unlink%3D%22true%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20data-unlink%3D%22true%22%3EWhere%20%7BSubscription%3Aid%7D%20is%20from%20our%20subscription%20parameter.%3C%2FP%3E%0A%3CP%20data-unlink%3D%22true%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22workbooks-costmanagement-query.png%22%20style%3D%22width%3A%20922px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F283888i27961CCF94222BF0%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22workbooks-costmanagement-query.png%22%20alt%3D%22workbooks-costmanagement-query.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%E2%80%83You'll%20also%20need%20to%20declare%20the%20api%20version%20you%20are%20using%2C%20in%20this%20case%202019-11-01%20is%20what%20we're%20using.%3C%2FP%3E%0A%3CP%3ENow%20that%20we%20have%20this%20setup%2C%20we%20need%20a%20JSON%20body%20to%20POST%20to%20the%20API%20to%20tell%20Cost%20Management%20what%20information%20we%20want%20back.%20There%20are%20a%20number%20of%20examples%20on%20the%20API%20docs%20linked%20to%20above%2C%20I%20also%20recently%20wrote%20about%20JSON%20body%20examples%20%3CA%20href%3D%22https%3A%2F%2Fwww.cloudsma.com%2F2021%2F03%2Fazure-cost-management-json-body-examples%2F%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehere%2C%3C%2FA%3E%26nbsp%3Bwith%20some%20more%20straight%20forward%20examples%20than%20what%20is%20given%20on%20the%20docs.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI'll%20be%20using%20a%20simple%20body%20that%20brings%20me%20back%20my%20month%20to%20date%20cost%2C%20by%20subscription.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22workbooks-costmanagement-jsonbody.png%22%20style%3D%22width%3A%20849px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F283893i3798B5A603E8ABFF%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22workbooks-costmanagement-jsonbody.png%22%20alt%3D%22workbooks-costmanagement-jsonbody.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%225%22%3EJSON%20Path%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%224%22%3EThe%20result%20you'll%20get%20back%20is%20JSON%2C%20so%20if%20we%20want%20this%20in%20a%20more%20readable%20format%20we'll%20need%20to%20use%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fazure-monitor%2Fvisualize%2Fworkbooks-jsonpath%3FWT.mc_id%3Dmodinfra-27678-socuff%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3EJSON%20Path%3C%2FA%3E.%20Under%20Results%20Settings%2C%20change%20Result%20Format%20to%20JSON%20Path.%20Then%20put%20%24.properties%20in%20JSON%20Path%20Table.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22workbooks-costmanagement-jsonpath.png%22%20style%3D%22width%3A%20981px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F283894i10BC8DB8ECFB1A36%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22workbooks-costmanagement-jsonpath.png%22%20alt%3D%22workbooks-costmanagement-jsonpath.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%E2%80%83%E2%80%83Now%20this%20will%20bring%20back%20our%20data%20in%20a%20slightly%20prettier%20format%20than%20JSON.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--442858001%22%20id%3D%22toc-hId--442858002%22%3E%3CFONT%20size%3D%226%22%3EMake%20it%20Dynamic!%3C%2FFONT%3E%3C%2FH2%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3ENow%20that%20we've%20successfully%20queried%20Cost%20Management%20and%20formatted%20the%20results.%20Its%20time%20to%20put%20the%20power%20of%20Workbooks%20to%20use.%20We'll%20add%20two%20parameters%2C%20one%20for%20our%20Environment%20tag%2C%20IE%20Prod%2C%20Non%20Prod%2C%20QA%20etc.%20And%20one%20for%20Aggregation%20type%2C%20where%20we%20specify%20how%20we%20want%20the%20cost%20to%20be%20aggregated.%26nbsp%3B%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22workbooks-costmanagement-tag.png%22%20style%3D%22width%3A%20868px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F283904i8E76E66DAF789F03%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22workbooks-costmanagement-tag.png%22%20alt%3D%22workbooks-costmanagement-tag.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EThis%20Environment%20parameter%20uses%20Azure%20Resource%20Graph%20to%20query%20all%20resources%20that%20have%20been%20tagged%20with%20Demo_Environment%2C%20where%20we%20have%20Dev%2C%20QA%20and%20Prod%20as%20options.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22workbooks-costmanagement-aggregation.png%22%20style%3D%22width%3A%20927px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F283905i7E06B0320D95D960%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22workbooks-costmanagement-aggregation.png%22%20alt%3D%22workbooks-costmanagement-aggregation.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAggregation%20is%20a%20simple%20JSON%20drop%20down%20where%20we%20manually%20specify%20the%20options%20we%20want%20to%20be%20available%20in%20the%20drop%20down.%3C%2FP%3E%0A%3CP%3E%E2%80%83%E2%80%83%3C%2FP%3E%0A%3CP%3EOnce%20we%20have%20our%20parameters%20setup%2C%20we%20can%20then%20add%20them%20into%20the%20JSON%20body.%20For%20Demo%20Environment%20we%20have%20added%20a%20Filter%20for%20Tags.%20We%20have%20placed%20Aggregation%20at%20the%20bottom%20under%20Grouping.%3C%2FP%3E%0A%3CDIV%3E%0A%3CDIV%3E%3CPRE%20class%3D%22lia-code-sample%20language-json%22%3E%3CCODE%3E%20%7B%0A%20%20%20%22type%22%3A%20%22Usage%22%2C%0A%20%20%20%22timeframe%22%3A%20%22MonthToDate%22%2C%0A%20%20%20%22dataset%22%3A%20%7B%0A%20%20%20%20%20%22granularity%22%3A%20%22None%22%2C%0A%20%20%20%20%20%22filter%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22tags%22%20%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22name%22%20%3A%20%22Demo_Environment%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22operator%22%20%3A%20%22In%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22values%22%20%3A%20%5B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7BEnvironment%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%22aggregation%22%3A%20%7B%0A%20%20%20%20%20%20%20%22totalCost%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%22name%22%3A%20%22PreTaxCost%22%2C%0A%20%20%20%20%20%20%20%20%20%22function%22%3A%20%22Sum%22%0A%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%22grouping%22%3A%20%5B%0A%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%22type%22%3A%20%22Dimension%22%2C%0A%20%20%20%20%20%20%20%20%20%22name%22%3A%20%22%7BAggregation%7D%22%0A%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%5D%0A%20%20%20%7D%0A%20%7D%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3EThis%20allows%20us%20to%20aggregate%20based%20on%20Resource%20Group%2C%20Subscription%20or%20even%20Resource%20Type%2C%20while%20selecting%20any%20individual%20tag%20or%20all%203%20tags%20at%20the%20same%20time.%20This%20will%20then%20be%20translated%20by%20the%20workbook%20and%20sent%20to%20the%20Cost%20Management%20API.%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3ECost%20by%20subscription%20for%20Prod%2C%20QA%20and%20Dev%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22workbooks-costmanagement-costbysub.png%22%20style%3D%22width%3A%20870px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F283908i6FB5B76FE0657604%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22workbooks-costmanagement-costbysub.png%22%20alt%3D%22workbooks-costmanagement-costbysub.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3BCost%20by%20resource%20type%20for%20Prod%2C%20QA%20and%20Dev%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22workbooks-costmanagement-costbytype.png%22%20style%3D%22width%3A%20897px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F283909i2335D4B2FA30F58D%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22workbooks-costmanagement-costbytype.png%22%20alt%3D%22workbooks-costmanagement-costbytype.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3ECost%20by%20Resource%20Group%20for%20Prod%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22workbooks-costmanagement-rgprod.png%22%20style%3D%22width%3A%20916px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F283907iD228A0B913F6A419%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22workbooks-costmanagement-rgprod.png%22%20alt%3D%22workbooks-costmanagement-rgprod.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3EYou%20can%20add%20more%20filters%20for%20other%20tags%20or%20even%20resource%20types%20in%20the%20JSON%20Body.%20Almost%20everything%20in%20the%20body%20can%20be%20parameterized.%20For%20instance%2C%20you%20can%20make%20a%20TimeFrame%20parameter%20to%20bring%20back%20cost%20for%20a%20specific%20cycle%2C%20like%20Week%20to%20date%2C%20the%20Last%20Billing%20cycle%20etc.%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22workbooks-costmanagement-timeframe.png%22%20style%3D%22width%3A%20921px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F283918iC9D1CAFCA958C603%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22workbooks-costmanagement-timeframe.png%22%20alt%3D%22workbooks-costmanagement-timeframe.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22workbooks-costmanagement-lastbillingmonth.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F283921i14DC706915009880%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22workbooks-costmanagement-lastbillingmonth.png%22%20alt%3D%22workbooks-costmanagement-lastbillingmonth.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3EThe%20only%20thing%20we%20can't%20make%20truly%20dynamic%20is%20querying%20subscription%2C%20because%20were%20sending%20a%20request%20to%20the%20API%20it%20can%20only%20be%20for%20one%20subscription%20at%20a%20time.%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3EThis%20workbook%20is%20on%20my%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fscautomation%2FWorkbook-CostManagement-Example%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3Egithub%3C%2FA%3E%2C%20so%20you%20don't%20have%20to%20recreate%20the%20wheel.%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CH2%20id%3D%22toc-hId-2044654832%22%20id%3D%22toc-hId-2044654831%22%3E%3CFONT%20size%3D%226%22%3ESummary%3C%2FFONT%3E%3C%2FH2%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3EWith%20the%20ability%20to%20query%20a%20number%20of%20different%20sources%2C%20Workbooks%20allow%20you%20to%20truly%20customize%20your%20data%20visualization%20across%20your%20Azure%20environment.%26nbsp%3B%20The%20ability%20to%20show%20Cost%20Management%20along%20side%20your%20resources%20and%20slice%20and%20dice%20it%20anyway%20you%20want%20or%20need%20is%20what%20%3C%2FFONT%3EAzure%20Workbooks%20are%20all%20about!%3C%2FP%3E%0A%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-2387779%22%20slang%3D%22en-US%22%3E%3CP%3EHow%20to%20use%20ARM%20endpoint%20in%20Azure%20Workbooks%20to%20query%20Azure%20Cost%20Management%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Costs.jpeg%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F285046i3953F8F0009CDA2F%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Costs.jpeg%22%20alt%3D%22Costs.jpeg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2387779%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EBilly%20York%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Co-Authors
Version history
Last update:
‎May 30 2021 09:51 PM
Updated by: