question

dylan-1 avatar image
dylan-1 asked

Azure Func testing from Unreal fails (but works np from POSTman)

EDIT1: Repro'd the bug -- To Repro:

  1. Local file in %temp% and Azure Func.

  2. Add https://github.com/PlayFab/pf-af-devfuncs/blob/main/csharp/ExecuteFunction.cs to your proj.

  3. Start debugging: There are no registered /CloudScript/ExecuteFunction endpoints.

  4. Open Fiddler (enable ssl decryping in opts) -> Debug your Unreal game in editor

  5. Call a cloud func -- it'll forward to localhost, but via a bad url.

Goes to: POST http://localhost:7071/api/CloudScript/ExecuteFunction HTTP/1.1

Expected: POST http://localhost:7071/api/MyCloudScriptName HTTP/1.1

The URL is probably prepped to call PlayFab's endpoint to be Proxy'd, not directly to Azure or localhost.

EDIT2:

Partially the reason is a Rider bug, but the other reason is that PF does not pass enough info to ExecuteFunction when testing locally, thus the helper can't do its job.

So if locally testing from Unreal => What's the point of ExecuteFunction helper class if there's not enough data to use it? Feels like I'm missing some critical info. From Unreal to localhost, it only includes:

{
    "FunctionName": "HelloWorld",
    "FunctionParameter": {
        "testArgStr": "Hello World!"
    }
}

and nothing else, since it skips the proxy forward with extra data.

Since this still sends to ExecuteFunction, there's not enough data (expected from playstream extra info) - the entity token in header is !enough. I then get a 500 err. I can step through and see it happen.


Getting the same errs as this issue and this, except with working syntax and where local debugging works no prob from POSTman,

I'm having trouble debugging locally from Unreal.

  • If I call a cloud script live, it works np.

  • If I place the playfab.local.settings.json file in %temp% and call a cloud script locally while debugging, I get the same err as from the other post:

Executing 'ExecuteFunction' (Reason='This function was programmatically called via the host APIs.', Id=Foo-Bar)

Executed 'ExecuteFunction' (Failed, Id=Foo-Bar, Duration=149ms)
System.Private.CoreLib: Exception while executing function: 

ExecuteFunction. System.Net.Http: The requested name is valid, but no data of the requested type was found. (playfabapi.com:443). 

System.Net.Sockets: The requested name is valid, but no data of the requested type was found.

If I set a breakpoint at the top, the rest of the body doesn't really matter - just the entry point. Since this works live and works from POSTman -- and since live works from Unreal but not local -- one can deduct that there's an issue with the way the Unreal SDK communicates with localhost. Is it forcing SSL, for example?

Is there anyone here that can confirm local debugging actually working when called from Unreal?

Since it works in POSTman, that already deducts syntax is np. Since the same code works live from Unreal, that also proves compatibility where syntax isn't an issue. Since I have these err logs, this proves the forwarding to localhost also worked.

I'm still testing it - it could be something on my end, but since I saw others with this issue, I thought I may as well get the ball rolling.

apissdksCloudScriptunrealdocumentation
1 comment
10 |1200

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

Simon Cui avatar image Simon Cui commented ·

May I know what UnrealMarketplacePlugin version are you using and what is your %temp% path? I suggest that you debug the localApiServer in Unreal to check if it is valid to get correct path of "playfab.local.settings.json". Besides, you can double check if you set "PLAYFAB_TITLE_ID" and "PLAYFAB_DEV_SECRET_KEY" correctly in local.settings.json file, referring to: Local debugging for Cloudscript using Azure Functions - PlayFab | Microsoft Learn
5689-image.png

0 Likes 0 ·
image.png (132.6 KiB)

0 Answers

·

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.