Hello @shohei_kobayashi Thank you for contacting us on Microsoft Q&A platform. Happy to assist you!
From the tile of the post, I understand that you want to know if it is possible to trigger notification to Slack when the subscription fee ratio changes rapidly.
I have not tried this personally, you may want to give a shot:
Create a log alert rule in Azure Monitor to monitor the changes in subscription fees and configure an action group to send notifications to Slack. Here are the steps to create a log alert rule:
- Go to the Azure portal and navigate to the Azure Monitor service.
- Click on "Alerts" in the left-hand menu and then click on "New alert rule".
- In the "Scope" section, select the subscription that you want to monitor.
- In the "Condition" section, select "Signal logic" and then select "Custom log search".
- In the "Custom log search" section, enter the following query to calculate the subscription fee ratio:
AzureConsumption | where ResourceType == "subscriptions" | where TimeGenerated >= ago(30d) | summarize TotalCost = sum(Cost) by SubscriptionId | extend Ratio = TotalCost / toscalar(TotalCost)
This query calculates the subscription fee ratio for the last 30 days.
- In the "Alert logic" section, set the threshold for the subscription fee ratio. For example, you can set the threshold to 0.5 if you want to be notified when the subscription fee ratio for a service exceeds 50%.
- In the "Action group" section, configure an action group to send notifications to Slack. You can follow the instructions in this article to create an action group that sends notifications to Slack: https://docs.microsoft.com/en-us/azure/azure-monitor/platform/action-groups#create-an-action-group
Regarding your question about the "Anomaly" alert type, it is not available for billing accounts because it requires a machine learning model to detect anomalies in the data. This feature is only available for subscriptions, not billing accounts.
Hope this helps!