A Microsoft offering that enables tracking of cloud usage and expenditures for Azure and other cloud providers.
Hi Abrar Adil S
Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.
You can use the Azure Cost Management REST API to get cost and usage data by logging in and calling the correct endpoints.
After getting the cost data, you can send it to your Log Analytics Workspace using the to add custom log data.
In the Azure portal, go to Cost Management + Billing > Cost Management > Export. From there, you can schedule cost data to be automatically exported in CSV format to an Azure Storage Account.
After exporting the data, you can use an Azure Function or Logic Apps to automatically move the CSV file from your storage account to your Log Analytics Workspace.
For automation, you can use Azure Automation with a PowerShell script that runs on a schedule. The script will get cost data and send it to Log Analytics.
If you have any further queries, do let us know.
thanks,
Pranay