@madmax
The errors you are encountering indicate that the fields Properties and ClientApplicationName may not exist or are named differently in your AzureDiagnostics table. To resolve these issues, you will need to inspect the schema of your AzureDiagnostics table and adjust the queries accordingly. Here are some steps that might help you:
Inspect the Schema of AzureDiagnostics Table:
- Run a query to inspect the schema and understand the available fields.
AzureDiagnostics
| take 10
This will give you a glimpse of the columns in the AzureDiagnostics table, allowing you to identify the correct field names.
Adjust the Queries Based on the Actual Field Names:
- Once you have verified the structure of the
AzureDiagnostics table, you can adjust your queries. Here’s how you might modify the queries based on the findings:
Query to Identify Tables that Haven’t Been Used in the Last 30 Days:
Make sure to replace Properties with the actual field name that contains the table name. For example, if the field is named TableName instead of being nested in Properties, you would adjust the query as follows:
// Step 1: Get the list of all tables in your Analysis Services model
let allTables = AzureDiagnostics
| where ResourceType == "MICROSOFT.ANALYSISSERVICES/SERVERS" // Filter for AAS resource type
| where OperationName == "QueryEnd" // Filter for completed queries
| summarize by tableName = tostring(TableName); // Adjust this line based on actual field name
// Step 2: Get the list of tables accessed in the last 30 days
let accessedTables = AzureDiagnostics
| where ResourceType == "MICROSOFT.ANALYSISSERVICES/SERVERS" // Filter for AAS resource type
| where OperationName == "QueryEnd" // Filter for completed queries
| where TimeGenerated >= ago(30d) // Limit to logs from the last 30 days
| summarize by tableName = tostring(TableName); // Adjust this line based on actual field name
// Step 3: Find tables that haven’t been accessed in the last 30 days
allTables
| where tableName !in (accessedTables) // Find tables not in the accessed list
| project tableName // Display the table names
Verify and Adjust the ClientApplicationName Field:
- Check if the
ClientApplicationName field exists. If it's named differently, use the correct field name in your query.
Query to Identify Tables Accessed by Power BI Reports:
- Similarly, adjust the field name for
ClientApplicationName:
AzureDiagnostics
| where ResourceType == "MICROSOFT.ANALYSISSERVICES/SERVERS" // Filter for Azure Analysis Services logs
| where OperationName == "QueryEnd" // Focus on completed queries
| where ClientAppName contains "Power BI" // Adjust this line based on actual field name
| project TimeGenerated, tableName = tostring(TableName), ClientAppName // Adjust this line based on actual field name
| summarize AccessCount = count() by tableName, bin(TimeGenerated, 1d) // Count accesses per table, grouped by day
| order by TimeGenerated desc // Sort by most recent access time
Once you adjust your AzureDiagnostics table according to the actual schema, the queries should run smoothly.
I hope this information helps. Please do let us know if you have any further queries.
Thank you.