question

tarek avatar image
tarek asked

An error when Connecting Playfab Insights using Kusto C# SDK

Hi, I am calling and querying Playfab insights from an Azure function using the Kusto C# SDK.

Sometimes, it throws the following error:

Exception while executing function: PlayfabToBigqueryTimer Request is invalid and cannot be processed: {"error":{"code":"BadRequest","message":"An error occurred.","@message":"'project' operator: Failed to resolve table or column expression named '[\"events.all\"]'","@permanent":true}} {"error":{"code":"BadRequest","message":"An error occurred.","@message":"'project' operator: Failed to resolve table or column expression named '[\"events.all\"]'","@permanent":true}} 

I have noted in other questions in this community forum that error is caused by having a newline in the body of the query, but this is not my case.

This is my query FYI:

let users=dynamic(['A0711102A10B8FC4', '86EED972E9EEF454']); ['events.all'] | where Entity_Id in (users) | where EventData['EventName'] == 'LevelEndBubble' or EventData['EventName'] == 'offlineLevelEventsBubble' | project EntityId=Entity_Id, the_date = format_datetime(Timestamp, 'yyyy-MM-dd'), round=EventData['Round'], Playtime=todouble(EventData['PlayTime']) | summarize total_play_days = dcount(the_date), playtime_hrs = round(sum(Playtime)/3600), First_date_played = min(the_date), Last_date_played = max(the_date) by EntityId | join (['events.all'] | where Entity_Id in (users) | where EventData['EventName'] == 'LaunchData' or EventData['EventName'] == 'offlineLaunchEventsBubble' | project EntityId=Entity_Id, Timestamp | summarize total_launches=count() by EntityId) on EntityId | project-away EntityId1

Note: I am using an hourly TimerTrigger in the Azure function to execute my script.

Thanks,

Tarek

sdksdata
3 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

tarek avatar image tarek commented ·

Some info that may be helpful:


Path: https://insights.playfab.com/v1/rest/query

Remote dependency name: POST /v1/rest/query

Exception type: System.Exception

0 Likes 0 ·
Rick Chen avatar image Rick Chen ♦ commented ·

Could you please provide your title id for us to diagnose?

0 Likes 0 ·
tarek avatar image tarek Rick Chen ♦ commented ·

Title ID: C0DAE

0 Likes 0 ·
Rick Chen avatar image
Rick Chen answered

I have done a test using the query you provided, but I cannot reproduce the error you describe. Have you checked this Tutorial: Connecting Kusto C# SDK to Insights - PlayFab | Microsoft Docs?

Please note that there was an incident of Azure DNS Outage that may affect the event history during that time. Is this issue still happening? Did it happen occasionally or every time? If the issue is still happening, could you please provide a code snippet of your script for us to diagnose?

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

tarek avatar image
tarek answered

Sorry for the very late reply.

" .. Have you checked this Tutorial: Connecting Kusto C# SDK to Insights - PlayFab | Microsoft Docs? .." Yes I have followed this tutorial.

" .. could you please provide a code snippet of your script for us to diagnose?.." I couldn't do it because of the company policy.


However, I have been doing a lot of tests, and today the issue stopped happening (so far).
My code was sending 6 kusto queries to Playfab insights and issue was that some or all of the API calls would fail at sometimes.

The solution was to not send all the queries all at once.
I have changed the Azure function so that it would send 3 queries, then after 10 minutes it would send the other remaining 3 queries.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

tarek avatar image
tarek answered

Hi all, I want to share an update.
I can confirm that dividing the Kusto API calls in half has solved the problem.
Now I have 0 fails.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.