question

omerkhalid avatar image
omerkhalid asked

Photon webhooks with azure functions

Hi. I have integrated Photon with my playfab game(yaayyy). Now I want to write webhooks. Considering that azure functions can now be executed as cloudscript, is there a way to implement web hooks in azure functions? I can't seem to find any example or documentation for this. Thanks

CloudScriptphotonwebhooks
10 |1200

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

1 Answer

·
Rick Chen avatar image
Rick Chen answered

Depending on the version of Azure Function you are using, if it is 1.x, you could set the configurations in the function.json file, please refer to: https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-http-webhook-trigger?tabs=csharp#configuration.

If the version is 2.x or higher, the base HTTP trigger could work as webhook. Please refer to: https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-http-webhook-trigger?tabs=csharp#webhooks.

2 comments
10 |1200

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

omerkhalid avatar image omerkhalid commented ·

Thanks @Junjin Chen. I read the document and this is more like adding azure functions separately as web hooks. However, I want the call to come through playfab just like the new azure functions as cloudscript. From what i understand, I added webhook name as my function name but it isn't firing

0 Likes 0 ·
Rick Chen avatar image Rick Chen ♦ omerkhalid commented ·

Could you please explain what do you mean by you want the call to come through PlayFab? If you mean that you want to register the Azure Function in your PlayFab project, you could go to [Your Game Manager]->[Automation]->[Cloud Script] and choose the Functions (preview) and choose Register function. Then fill the Function name with your Azure Function name and the url with your Azure Function Http trigger url. Please refer to this document: Quickstart: Writing a PlayFab CloudScript using Azure Functions.

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.