I check the players username, password and email in cloud script before I call function AddUsernamePasswordFromCloudScript because not all characters are supported in my game. Would it be possible to replace the cloud script function AddUsernamePasswordFromCloudScript with an Azure function that does exactly the same thing?
How can I call an Azure Function in CloudScript? What API can I use?
Cloud script function that I want to replace:
function AddUsernamePasswordFromCloudScript(sessionticket, email, username, password, playFabId) { var contentBodyTemp = { "PlayFabId": playFabId, "Email": email, "Username": username, "Password": password }; let url = "https://E5E2C.playfabapi.com/Client/AddUsernamePassword"; let method = "POST"; let contentBody = `{"PlayFabId": "${playFabId}", "Email": "${email}", "Username": "${username}", "Password": "${password}"}`; let contentType = "application/json"; let headers = { "X-Authentication": sessionticket }; let responseString = http.request(url, method, contentBody, contentType, headers); let responseJSONObj = JSON.parse(responseString); return (responseJSONObj); if (responseJSONObj.Error == null) return "true"; else { log.info("Error code: " + responseJSONObj.error.toString()); return responseJSONObj.error; } }