How to get the billing details of an azure subscription using the power shell script.

%3CLINGO-SUB%20id%3D%22lingo-sub-532740%22%20slang%3D%22en-US%22%3EHow%20to%20get%20the%20billing%20details%20of%20an%20azure%20subscription%20using%20the%20power%20shell%20script.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-532740%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20All%2C%3C%2FP%3E%3CP%3EPlease%20Provide%20a%20power%20shell%20script%20that%20will%20help%20me%20to%20get%20the%20billing%20details%20of%20an%20azure%20subscription.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-532740%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAnalytics%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAzure%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMonitoring%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EVirtual%20Network%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-534362%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20get%20the%20billing%20details%20of%20an%20azure%20subscription%20using%20the%20power%20shell%20script.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-534362%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F141516%22%20target%3D%22_blank%22%3E%40Prashant%20Sharma%3C%2FA%3EHere%20is%20a%20link%20to%20a%20script%20I%20wrote%20that%20pulls%20billing%20consumption%20data%20from%20a%20subscription%20you%20could%20use%20as%20a%20reference.%26nbsp%3B%20It%20then%20writes%20that%20data%20to%20a%20Log%20Analytics%20Workspace.%26nbsp%3B%20That%20data%20could%20be%20written%20someplace%20else%20using%20whatever%20method%20you%20need.%20%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20requires%20the%20Azure%20Consumption%20PowerShell%20Module.%20%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CFONT%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Ftsrob50%2FSendCostDataLogAnalytics%2Ftree%2Fmaster%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Ftsrob50%2FSendCostDataLogAnalytics%2Ftree%2Fmaster%3C%2FA%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CFONT%3EThanks%3C%2FFONT%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Contributor

Hello All,

Please Provide a power shell script that will help me to get the billing details of an azure subscription.

1 Reply
Highlighted

@Prashant SharmaHere is a link to a script I wrote that pulls billing consumption data from a subscription you could use as a reference.  It then writes that data to a Log Analytics Workspace.  That data could be written someplace else using whatever method you need.  

 

It requires the Azure Consumption PowerShell Module.  

 

https://github.com/tsrob50/SendCostDataLogAnalytics/tree/master

 

Thanks