> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PlayFab CloudScript using Azure Functions

> Overview of PlayFab CloudScript on Azure Functions for serverless C# and JavaScript backend code with Visual Studio debugging and queued long-running functions.

PlayFab CloudScript using Azure Functions is a new feature that enables serverless compute on demand in the language of your choice.  In order to do this we leverage Azure Functions and provide you with a tight integration via Visual Studio Code.

Using Azure Functions to run cloud code that is bound to a PlayFab title gives you the power of C# and strongly typed code. It also gives you the ability to leverage any number of Azure features such as CosmosDB.

Basing CloudScript on Azure Functions brings a few key improvements:

1. Ability to write Cloudscript in C# as well as Javascript and the [other supported Azure Functions languages](https://learn.microsoft.com/en-us/azure/azure-functions/supported-languages)
2. Ability to locally debug Cloudscript using [Visual Studio](https://visualstudio.microsoft.com/) or [Visual Studio Code](https://code.visualstudio.com/).  In addition, we have released an open sourced [Visual Studio Code Extension for PlayFab](https://github.com/PlayFab/vscode-playfab-explorer) that makes it easier to create CloudScript using Azure Functions.
3. Ability to write queued Cloudscript functions that can run for extended periods of time since we asynchronously wait for it to complete.
4. No limits to the number of API calls within the Azure Function code.

> **NOTE:** For more information about Azure Functions please visit the [Azure Functions documentation](https://learn.microsoft.com/en-us/azure/azure-functions/)

### Types of Cloud Script using Azure Functions

One of the major new capabilities of CloudScript is the ability to have long running CloudScript.  This is introduced by having a new type of Cloud Script based on Azure Functions queued storage triggered Cloud Script.  With this new type of CloudScript, you will need to decide the type of CloudScript to use for each CloudScript you create.

For more information about the advantages and limitations of each type of function you can read the Azure documentation of each:

* [HTTP Triggered Cloud Script](https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-http-webhook?tabs=csharp)

* [Queued Triggered Cloud Script](https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-queue)

### Pricing

To use this feature, you **must** bring your own Azure subscription. This means that usage charges will apply to your Azure subscription the same as if you used Azure Functions without a PlayFab integration. For more information about pricing, see [Azure Function pricing](https://azure.microsoft.com/pricing/details/functions/) on the Azure site.

### Getting Started

To get started with CloudScript using Azure Functions read our [quickstart guide](/services/playfab/live-service-management/service-gateway/automation/cloudscript-af/quickstart) and watch our [getting started video](https://youtu.be/apQbkDn1lNo).


## Related topics

- [PlayFab CloudScript using Azure Functions Quickstart Guide](/services/playfab/live-service-management/service-gateway/automation/cloudscript-af/quickstart.md)
- [PlayFab CloudScript using Azure Functions Context Models](/services/playfab/live-service-management/service-gateway/automation/cloudscript-af/CloudScript-af-context.md)
- [PFCloudScriptExecuteFunctionAsync](/services/playfab/api-references/c/pfcloudscript/functions/pfcloudscriptexecutefunctionasync.md)
- [Leaderboards with PlayStream and Telemetry](/services/playfab/community/leaderboards/leaderboards-with-playstream-and-telemetry.md)
- [Statistics with PlayStream and Telemetry](/services/playfab/player-progression/statistics/statistics-with-playstream-and-telemetry.md)
