Get Azure Resource Utilization by using azure COSTMANAGEMENT-API - azure

Is there any way to get Cost and Utilization(CPU, Memory, DTU) trend of azure resources by using azure cost management apis.

If you check this Azure Cost Management documentation, then you will find that -
The Azure Cost Management APIs provide the ability to explore cost and usage data by creating customized filters and expressions allowing you to answer consumption-related questions for your Azure resources.
But note that these APIs are currently available for Azure Enterprise customers. So you can use it if you have the Enterprise Subscription.
To solve your problem you can use the Azure Consumption APIs. These APIs support Enterprise Enrollments and also some Web Direct Subscriptions. The Azure Consumption APIs give you programmatic access to cost and usage data for your Azure resources.
You should use Balances API, to get a monthly summary of information on balances, new purchases, Azure Marketplace service charges, adjustments, and overage charges.
And use Budgets API, to to create either cost or usage budgets for resources, resource groups, or billing meters.
Use the Usage Details API to get charge and usage data for all Azure 1st party resources you have.
Currently Balances API and Budgets API is only for Enterprise Customers only.

Related

"Cost management data is unavailable for subscription" AZURE cost usage API

I'm trying to retrieve Azure cost data for the management group using azure cost usage API.
https://learn.microsoft.com/en-us/rest/api/cost-management/query/usage
But Im getting below error.
"Cost management data is unavailable for subscription xxxxxxxxxxx. The offer MS-AZR-xxxxP is not supported. (Request ID: xxxxx-xxxxx-xxx-xxx-xxxxx)"
Request URL
https://management.azure.com/providers/Microsoft.Management/managementGroups/xxxxxxxxxx/providers/Microsoft.CostManagement/query?api-version=2019-11-01&$top=5000
Is there any way to skip such subsciptions and get data for supported subscriptions using above API.Please assist.
Reason you may be seeing this message is because Azure Cost Management is not supported for all Azure Offer types.
Please check this link for supported/unsupported Azure Offer types for Azure Cost Management: https://learn.microsoft.com/en-us/azure/cost-management-billing/costs/understand-cost-mgt-data#supported-microsoft-azure-offers.

Azure API Management vs Logic Apps

New to Azure and would like to know what the difference between Azure API Management and Logic Apps is.
Some pros and cons would be nice. Also what the costing for each of these is like.
Thanks
Seems you want to know about Azure API Management and Azure Logic Apps
Well let me help you what that actually are...
Azure API Management
Azure API Management allows organizations to publish APIs more securely, reliably, and at scale. Use API Management to drive API consumption among internal teams, partners, and developers while benefiting from business and log analytics available in the admin portal
Pros are
Consistent and modern API gateways for existing back-end services
Verifies API keys, JWT tokens, certificates, and other credentials
Help you to publish APIs to external, partner, and internal
developers to unlock the potential of their data and services
High availability Responds to requests to perform operations at
least 99.9% of the time.
Analytics, metrics and many more
For further details you could have a look on official docs
Pricing
There are different categories of pricing available based on type and uses. See the below screen shot:
You even can read more details about pricing here
Logic Apps:
Azure Logic Apps is a cloud service that helps you schedule, automate, and orchestrate tasks, business processes, and workflows when you need to integrate apps, data, systems, and services across enterprises or organizations. Logic Apps simplifies how you design and build scalable solutions for app integration, data integration, system integration
Pros are
Maximum automation with hassle free service
Process and route orders across on-premises systems and cloud
services
Can move uploaded files from an SFTP or FTP server to Azure Storage
Help you connect legacy, modern, and cutting-edge systems more
easily and quickly by providing prebuilt APIs as Microsoft-managed
connectors
Pricing
Usually two categories of pricing you may have Consumption pricing model which depends on how much you consume and have to pay as per your consumption.
another one Fixed pricing model. See the screen shot:
You can have a look more details on official docs
Hope this would help you.

How to prevent provisioning of expensive services

I have an Azure subscription and there are a number of services available.
If I configure VM, web apps, application. etc.,
there are few high-end resources which are very expensive.
In order to avoid unwanted billing,
I want to create a policy that allows only a few services and lower configuration resources.
Is there an Azure policy that can do that?
If I configure VM, web apps, application.. etc there are few high-end
resources which prices are high. In order to avoid unwanted billing, I
want to create policy there allow only a few services and lower
configuration resources
Do take a look at Azure Policy. In short, Azure Policies enables Cloud Governance and by defining proper policies, you can restrict creation of certain kinds of resources, disallow certain SKUs for resources and more.
However, as a good practice, you should have only few people in your organization who have the capability to provision resources and there should be a formal procedure for provisioning resources. One of my friend burned $180,000 in Azure in just 3 months because every developer in his team has the capability to create resources in the company's Azure Subscription. The developers in the team created resources as they pleased without thinking about pricing implication.

Azure Rate Card reserved instance pricing

Is there an API provided by Azure providing information about Azure Rate Card pricing ?
The usual rate card doesn't seem to have any such information.
You could use Azure Billing APIs to predict and manage your costs, refer to this article.
Use Azure Billing APIs to pull usage and resource data into your preferred data analysis tools. The Azure Resource Usage and RateCard APIs can help you accurately predict and manage your costs.
Azure Invoice Download API: download invoices
Azure Resource Usage API: get your estimated Azure consumption data
Azure Resource RateCard API: get the list of available Azure resources and estimated pricing information for each

In azure Logic Apps do we have to create separate logic app for each integration

In Azure Logic Apps do we have to create the separate logic app for each integration, if we create separate then how cost is applied?
In azure Logic Apps the how price calculated is somewhat confusing.
I asked the above question as I don't know whether it'll charge for storage of each logic apps.
Please if possible Provide explanation for pricing
In Azure logic apps, pricing is calculated based on the total number of executions, connectors used and data retention. Values of all the logic apps under an Azure Subscription will be considered for calculating the cost. Azure Integration account is for maintaining the availability and security for the resources mapped to it.
Logic apps can be created and used with out Integration Accounts. Integration Accounts are suggested for large scale enterprise business integrations.
As pricing is calculated based on the consolidated usage, any number of logic apps can be created. Only the Logic App executions decides the cost.
In Azure Logic Apps do we have to create the separate logic app for each integration, if we create separate then how cost is applied?
You don't have to create the separate logic app for each integration account, but you can just use only one account and you can change it (integration account must be the same region as the logic app).
If you create separate logic app, they will cost by Data Retention as $0.12 Per GB/month.
Please if possible Provide explanation for pricing
You could refer to the pricing details and use the Pricing calculator of Logic App, it will be helpful.

Resources