© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
1 reply
ZBAGI

Azure app insights api query problem

Hi, I trying to query application insights via api by using provided nuget package - https://github.com/Azure/azure-sdk-for-net/blob/Azure.Monitor.Query_1.1.0/sdk/monitor/Azure.Monitor.Query/README.md everything works like in example. Except when I replace query
"AzureActivity | top 10 by TimeGenerated"
"AzureActivity | top 10 by TimeGenerated"
with what i need ie.
requests
requests
it seems to not understand
request
request
scope. This query works without any problem when used in azure portal, so why is it complaining in api ? I made sure i use correct workspace and credentials. Here is the code:
string workspaceId = "<redacted>";

var auth = new ClientSecretCredential("<redacted>", "<redacted>", "<redacted>");
var client = new LogsQueryClient(auth);

var response = await client.QueryWorkspaceAsync(
    workspaceId,
    "requests",
    new QueryTimeRange(TimeSpan.FromDays(1)));
string workspaceId = "<redacted>";

var auth = new ClientSecretCredential("<redacted>", "<redacted>", "<redacted>");
var client = new LogsQueryClient(auth);

var response = await client.QueryWorkspaceAsync(
    workspaceId,
    "requests",
    new QueryTimeRange(TimeSpan.FromDays(1)));

Azure.RequestFailedException: 'The request had some invalid properties
Status: 400 (Bad Request)
ErrorCode: BadArgumentError

Content:
{"error":{"message":"The request had some invalid properties","code":"BadArgumentError","correlationId":"<redacted>","innererror":{"code":"SemanticError","message":"A semantic error occurred.","innererror":{"code":"SEM0100","message":"'where' operator: Failed to resolve table or column expression named 'requests'"}}}}
Azure.RequestFailedException: 'The request had some invalid properties
Status: 400 (Bad Request)
ErrorCode: BadArgumentError

Content:
{"error":{"message":"The request had some invalid properties","code":"BadArgumentError","correlationId":"<redacted>","innererror":{"code":"SemanticError","message":"A semantic error occurred.","innererror":{"code":"SEM0100","message":"'where' operator: Failed to resolve table or column expression named 'requests'"}}}}

Any idea what is wrong ?
GitHub
azure-sdk-for-net/README.md at Azure.Monitor.Query_1.1.0 · Azure/az...
This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/dotnet/azure/ or our vers...
azure-sdk-for-net/README.md at Azure.Monitor.Query_1.1.0 · Azure/az...
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

App Insights vs Azure Monitor (OpenTelemetry)
C#CC# / help
17mo ago
❔ Publish the API app to Azure App Service
C#CC# / help
4y ago
Azure Static Web App (Blazor) problem with CORS
C#CC# / help
14mo ago
✅ Azure app service Web API project not running
C#CC# / help
2y ago