Hi.
I've created an Azure function 'Echo' and manually registered it with the Playfab account and confirmed that the system registers it. I did not upload a Cloudscript source file. Then, I've written a Python client to log in with a custom ID and call the cloudscript function.
When I call the function using the Playfab 'Execute Function' call, the call succeeds with the error:
{"Error": "CloudScriptNotFound", "Message": "No function named Echo was found to execute", "StackTrace": ""}
Here's the relevant Python test code...
async def main():
client = PlayfabClient(TITLE_ID_VIM_DUNGEON)
logging.info("Logging in as '{}'...".format(USER_ID))
logged_in = await client.login(USER_ID)
if logged_in:
logging.info("'{}' logged in (Playfab ID: {})".format(USER_ID, client.playfab_id))
else:
logging.error("Login failed.".format(USER_ID))
payload = {
"Test": 123}
logging.info("Calling Cloudscript 'Echo' with payload '{}'...".format(json.dumps(payload)))
success, failure = await client.call_cloudscript("Echo", payload)
if success:
logging.info("Cloudscript success: {}".format(json.dumps(success)))
else:
logging.error("Cloudscript failed: {}".format(json.dumps(failure)))
And here's the 'Execute Function' implementation:
async def call_cloudscript(self, function_name, fn_param=None):
if not self.logged_in:
return None, "Not logged in"callback_result = asyncio.get_running_loop().create_future()
def parse_results(success: dict, failure: dict):
if success:
script_error = success.get("Error")
if script_error is not None:
callback_result.set_result((None, script_error))
else:
callback_result.set_result((success["FunctionResult"], None))
returncallback_result.set_result((None, failure))
request = {
"FunctionName": function_name,"GeneratePlayStreamEvent": True,}
if fn_param is not None:
request["FunctionParameter"] = fn_param
PlayFabClientAPI.ExecuteCloudScript(request, parse_results)
return await callback_result
Any idea what's going wrong here?