question

Masashi Kobayashi avatar image
Masashi Kobayashi asked

How to use PlayFab API for transaction processing on Azure Functions

When creating a function in Azure Functions, I needed to call the PlayFab API several times and make changes to the user data.

If the PlayFab API call fails in the middle of the process, how can I roll back, what are the best practices?

CloudScript
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

·
Sarah Zhang avatar image
Sarah Zhang answered

Do you mean you update multiple user data K/V pairs in one Azure Function, and you want to undo all updates when one of the K/V pairs is not updated successfully? If so, for clarification, we don’t support one-click rollback of the user data. To make your data can be restored, you can create the temporary items to store the latest version’s data instead of replacing the old data with new data directly. In this way, you can verify the integrity of temporary data first, then determine whether you will update the persistent data with them or not to prevent the data from being updated incompletely.

10 |1200

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

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.