---
title: "Azure Serverless Application"
description: "Deploy a serverless application on Azure with Pulumi, Azure Functions, and Azure Blob Storage in TypeScript, Python, Go, C#, YAML, or HCL."
url: "https://www.pulumi.com/dev/templates/serverless-application/azure/"
image: "https://www.pulumi.com/assets/og/dev/templates/serverless-application/azure.png"
---

# Azure Serverless Application

Deploy a serverless application on Azure with Pulumi, Azure Functions, and Azure Blob Storage in TypeScript, Python, Go, C#, YAML, or HCL.

The Azure Serverless Application template scaffolds a Pulumi project that deploys an [Azure Blob Storage account](https://www.pulumi.com/registry/packages/azure-native/api-docs/storage/storageaccount/) configured for [static website hosting](https://www.pulumi.com/registry/packages/azure-native/api-docs/storage/storageaccountstaticwebsite/) and an [Azure Function](https://www.pulumi.com/registry/packages/azure-native/api-docs/web/webappfunction/) for the application backend. The template ships with placeholder web and function content so the project deploys end to end out of the box.

![An architecture diagram of the Azure Serverless Application template](./architecture.png)

## Using this template

To use this template to deploy your own serverless application, make sure you've [installed Pulumi](https://www.pulumi.com/docs/install/) and [configured your Azure credentials](https://www.pulumi.com/registry/packages/azure-native/installation-configuration#credentials), then create a new [project](https://www.pulumi.com/docs/iac/concepts/projects/) using the template in the language of your choice:

**TypeScript**

```bash
mkdir my-serverless-app && cd my-serverless-app
pulumi new serverless-azure-typescript
```

**Python**

```bash
mkdir my-serverless-app && cd my-serverless-app
pulumi new serverless-azure-python
```

**Go**

```bash
mkdir my-serverless-app && cd my-serverless-app
pulumi new serverless-azure-go
```

**C#**

```bash
mkdir my-serverless-app && cd my-serverless-app
pulumi new serverless-azure-csharp
```

**YAML**

```bash
mkdir my-serverless-app && cd my-serverless-app
pulumi new serverless-azure-yaml
```

**HCL**

```bash
mkdir my-serverless-app && cd my-serverless-app
pulumi new serverless-azure-hcl
```

Follow the prompts to complete the new-project wizard. When it's done, you'll have a complete Pulumi project that's ready to deploy and configured with the most common settings. Feel free to inspect the code in `index.ts` for a closer look.

## Deploying the project

The template requires no additional configuration. Once the new project is created, you can deploy it with [`pulumi up`](https://www.pulumi.com/docs/iac/cli/commands/pulumi_up):

```bash
$ pulumi up
```

When the deployment completes, Pulumi exports the following [stack output](https://www.pulumi.com/docs/iac/concepts/stacks/#outputs) values:

**TypeScript / Python / Go / C# / YAML**

**`siteURL`**

The HTTP URL of the static website.

**`apiURL`**

The HTTP URL of the serverless function endpoint.

**HCL**

**`origin_url`**

The HTTP URL of the static website.

**`api_url`**

The HTTP URL of the serverless function endpoint.

Output values like these are useful in many ways, most commonly as inputs for other stacks or related cloud resources. The computed website URL, for example, can be used from the command line to open the newly deployed website in your favorite web browser:

**TypeScript / Python / Go / C# / YAML**

```bash
$ open $(pulumi stack output siteURL)
```

**HCL**

```bash
$ open $(pulumi stack output origin_url)
```

## Customizing the project

Projects created with the Serverless Application template expose the following [configuration](https://www.pulumi.com/docs/iac/concepts/config/) settings:

**TypeScript / Python / Go / C# / YAML**

**`sitePath`**

The path to the folder containing the files of the website. Defaults to `www`, which is the folder included with the template.

**`appPath`**

The path to the folder containing the serverless functions to be deployed. Defaults to `app`, which is also included with the template.

**`indexDocument`**

The file to use for top-level pages. Defaults to `index.html`.

**`errorDocument`**

The file to use for error pages. Defaults to `error.html`.

**HCL**

**`site_path`**

The path to the folder containing the files of the website. Defaults to `./www`, which is the folder included with the template.

**`app_path`**

The path to the folder containing the serverless functions to be deployed. Defaults to `./app`, which is also included with the template.

**`index_document`**

The file to use for top-level pages. Defaults to `index.html`.

**`error_document`**

The file to use for error pages. Defaults to `error.html`.

All of these settings are optional and may be adjusted either by editing the stack configuration file directly (by default, `Pulumi.dev.yaml`) or by changing their values with [`pulumi config set`](https://www.pulumi.com/docs/iac/cli/commands/pulumi_config_set):

**TypeScript / Python / Go / C# / YAML**

```bash
$ pulumi config set sitePath ../my-existing-website/build
$ pulumi up
```

**HCL**

```bash
$ pulumi config set site_path ../my-existing-website/build
$ pulumi up
```

## Cleaning up

You can cleanly destroy the stack and all of its infrastructure with [`pulumi destroy`](https://www.pulumi.com/docs/iac/cli/commands/pulumi_destroy):

```bash
$ pulumi destroy
```

## Learn more

- Browse other architecture templates in the [Templates gallery](https://www.pulumi.com/templates).
- Explore the [Azure Native provider API docs](https://www.pulumi.com/registry/packages/azure-native) in the Pulumi Registry.
- Walk through Pulumi from the ground up in [Pulumi Tutorials](https://www.pulumi.com/dev/browse/?type=tutorial).
- Read the latest [Azure posts on the Pulumi blog](https://www.pulumi.com/blog/tag/azure).
