Are there any docs/examples of how to properly forward CloudScript FunctionParameter values to an Azure Function? I'm using NodeJS w/ Azure Functions and wondering how to access those values.
Are there any docs/examples of how to properly forward CloudScript FunctionParameter values to an Azure Function? I'm using NodeJS w/ Azure Functions and wondering how to access those values.
Could you specify what do you mean by accessing function parameter from CloudScript in Azure Functions? Do you mean calling Azure Function inside CloudScript? Or do you mean calling the CloudScript API ExecuteFunction?
If it is former, I would suggest that it is not necessary to call Azure Function inside CloudScript. You could Write a PlayFab CloudScript using Azure Functions.
If it is the latter, the Function parameters from ExecuteFunction API are passed in POST body. Here is an example of using the function parameters: Quickstart: Writing a PlayFab CloudScript using Azure Functions
For NodeJS in Azure Function, you could use req.body.FunctionArgument to retrieve the function parameters from calling ExecuteFunction API, for example:
module.exports = async function (context, req) {
context.log('JavaScript HTTP trigger function processed a request.');
const responseMessage = "Hello, "+req.body.FunctionArgument.name;
context.res = {
body: responseMessage
};
}
2 People are following this question.