question

zensoftstudio avatar image
zensoftstudio asked

Invocation Azure Function return 'connection refuse' error message

Hi every body, im new to playfab and currently stuck a Azure Function invocation from client.

I have filled TITLE_ID and SECRET_KEY into function app.

here is my client code:

async Task ExecuteFunction(string functionName, object parameter) {
  var req = new ExecuteFunctionRequest {
    FunctionName = functionName,
    FunctionParameter = parameter,
    AuthenticationContext = new PlayFabAuthenticationContext() {
      EntityToken = loginResult.EntityToken.EntityToken
    }
  };
  
  PlayFabResult<ExecuteFunctionResult> execResult = await PlayFabCloudScriptAPI.ExecuteFunctionAsync(req);
  Console.WriteLine(execResult?.Error.ErrorMessage);
}

ErrorMessage: "connection refuse". did i miss anything?

Thanks!

CloudScript
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.

Seth Du avatar image Seth Du ♦ commented ·

It can be Azure Function implementation issue. Would you try to reproduce this issue via RESTful testing tools like Postman? If this issue can be reproduced in Postman, please compare your implementation process with PlayFab CloudScript using Azure Functions Quickstart Guide - PlayFab | Microsoft Docs.

0 Likes 0 ·

1 Answer

·
zensoftstudio avatar image
zensoftstudio answered

i find it out, it a nice bug. can only know when you debug the client code all the way down to sdk code. i follow playfab instruction to start debug locally so playfabSetting.localApiServer is point to localhost. but i forgot to delete the playfab.local.settings.json. So each time i invoke the function i not actually invoke the cloud function but instead the local function. and i didnt run any function locally T___T. I think it will be nice if playfab sdk output some log to let us know it use remote or local API when starting the client session!

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.

Seth Du avatar image Seth Du ♦ commented ·

Thanks for the update.

0 Likes 0 ·

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.