Custom meter API on Azure - azure

Is there an easy way to count calls, or specific items within a call in Azure?
If not, is there an easy way to count the amount of data transferred to the cloud service?

The data-transfer-In\out for a cloud service will be part of monthly Azure bill. There is an API available for Enterprise Azure customers (https://automaticbillingspec.blob.core.windows.net/spec/UsageDownloadRestfulSampleClient.zip) but not yet for Credit Card (CC) Customers\non-EA. For CC customer the bill is downloadable as CSV from the management portal

Related

Get Azure Resource Utilization by using azure COSTMANAGEMENT-API

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.

How to send Azure costs and usage data to log analytics workspace or directly to azure metrics?

I need to build a dashboard which will visuallize the usage and cost of many azure subscriptions. accounts, departments.
My plan was:
Send the data that is 'behind' the Azure Cost Analysis view, to the log analytics workspace.
In the log analytics workspace, perform custom aggregations / filters.
Display those aggregations as charts in Azure Metrics or directly in Azure Dashboard.
Problem is with step 1, I dont know how to send the data that is 'behind' the Azure Cost Analysis view, to the log analytics workspace.
I thought of two solutions:
Fetching the data from azure cost & billing API.
Schedule Export cost analysis data to a storage account, and then somehow moving the data from the storage account to the log analytics workspace.
Both solutions seems to me a bit 'overkilling' - is there a more direct approach to send the cost analysis data to log analytics workspace?
If there is no option such as that, I would be happy to know how would you suggest moving the exported data from the storage account to the log analytics, or do you have some other idea?
Thank you!
The only native solution is, to schedule from the Costs-Blade an export of the Costs as CSV into a StorageAccount. If you want to load the Data into a Log-Analytics-Workspace, Azure Automation and a scheduled Script would work.
I believe a direct approach is currently not available but I see this feature request raised in UserVoice / feedback forum for the same requirement. If interested, you may upvote it because in general the responsible Azure product / feature team would triage / start checking feasibility and prioritizing a received feedback based on various factors like number of votes a feedback receives, feasibility, open prioritized backlog items, etc.
I would suggest you to fetch the data from azure cost & billing API and send that data to Log Analytics from a REST API client by using the HTTP Data Collector API. For more information and illustration with examples, refer this Azure document. Or else if you want to fetch the data from azure cost & billing API and store it in a machine then you may go with custom logs. For more information w.r.t it, refer this Azure document.
Other related references:
Use cost alerts to monitor usage and spending
Supported metrics with Azure Monitor

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.

Limit API Calls, Microsoft Cognitive Services Bing News API

I signed up for the paid Microsoft Cognitive Services Bing News API.
Is there a way in the Cognitive Services API's to limit calls so billing doesn't get out of control?
For example it would be great if the account shut down at 100k calls a month VS the default which allows the calls to go over and charges me overages of $30 per 10k.
There are no built-in throttle mechanisms in the Cognitive Services API's (aside from the free tier which limits monthly access).
You'll need to build some type of metering into your app to be aware of call counts (and how you accomplish that is really up to you).

Resources