Skip to content

Getting Cost Management related information and send it via e-mail

License

Notifications You must be signed in to change notification settings

lpassig/CostManagementFunction

Repository files navigation

Description

Getting Cost Management related information from Azure and send it via e-mail.

Find my detailed description on coding.blog -> https://lennart.coding.blog/AzureCostManagementFunction :)

Potential Problems and Solutions

Problem: Body malformated or wrong parameters

It might be the case that you get an error like: Invoke-WebRequest : {"error":{"code":"400","message":"The remote server returned an error: (400) Bad Request."} when you are calling "$response = Invoke-WebRequest -Uri $uriCostManagement -Method Post -H ... This usuablly happens if the body is malformated or if the parameters used in the body are not correct.

Solution: Body malformated or wrong parameters

Try changing the parameters (e.g EUR to USD or the other way around) and have a look at the prerequisites:
#Name of the budget that exists on the subscription (Must exist)
$budgetname = "testbudget"
#Name of the Resource Tag that can be used to group costs (CostCenter Tag would be ideal; Tag must exist)
$costCenterTag = "costcenter"
#Abbreviation of the currency the Enterprise Agreement has been created under (for most German Customers it will be "EUR" instead of "USD")
$currency = "USD"

About

Getting Cost Management related information and send it via e-mail

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published