Queries for the ACSBillingUsage table
For information on using these queries in the Azure portal, see Log Analytics tutorial. For the REST API, see Query.
Get long calls
Retrive all the calls that lasted longer than an hours.
ACSBillingUsage
| tolower(UsageType) == "audio" // only look at records that are calls
| extend Length = EndTime - StartTime
| where Length > 1h // return if the call is greater than an hour
Usage breakdown
Get the total usage for each mode per hour (note that the first and last hours displayed will represent partial data).
ACSBillingUsage
| summarize Usage=sum(Quantity) by UsageType, bin(TimeGenerated, 1h) // count the number of units for each type of usage, per hour
| render columnchart
Record count breakdown
Get the unique number of usage records for each mode per hour (note that the first and last hours displayed will represent partial data).
ACSBillingUsage
| summarize Occurences=dcount(RecordId) by UsageType, bin(TimeGenerated, 1h) // count the number of unique records for each type of usage, per hour
| render columnchart
Participant Phone Numbers
Lists the phone numbers of the participants in the call. (Phone numbers come from ACSBillingUsage table).
ACSCallSummary
// Get the calls with CallType as Group
| where CallType == 'Group'
| project CorrelationId, ParticipantId, ParticipantStartTime, ParticipantDuration, EndpointType, CallType, CallStartTime, PstnParticipantCallType
// Join with ACSBillingUsage data on ParticipantId
| join kind=leftouter (ACSBillingUsage
| where isnotempty(ParticipantId)
| project ParticipantId, UserIdA, UserIdB, StartTime, Quantity)
on ParticipantId
// Combine with calls of CallType P2P
| union (ACSCallSummary
| where CallType == 'P2P'
| project CorrelationId, ParticipantId, ParticipantStartTime, ParticipantDuration, EndpointType, CallType, CallStartTime, PstnParticipantCallType
// Join with ACSBillingUsage data on CorrelationId
| join kind=leftouter (ACSBillingUsage
| where isnotempty(ParticipantId)
| project CorrelationId, ParticipantId, UserIdA, UserIdB, StartTime, Quantity)
on CorrelationId)
| order by CallStartTime, ParticipantStartTime