How do I build an azure-native web appserviceplan with Pulumi?
Building an Azure-native Web App Service Plan with Pulumi
In this example, we will create an Azure web app service plan using Pulumi. A web app service plan in Azure describes the compute resources used by a web app, including how many instances you want to run and what size those instances should be. This will be the foundation for deploying your web applications in Azure.
We’ll cover:
- Setting up the necessary Azure provider configuration.
- Creating a resource group.
- Creating an app service plan within that resource group.
Here’s the Pulumi program in TypeScript that accomplishes these steps:
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.core.ResourceGroup("example", {
name: "example-resources",
location: "West US",
});
const examplePlan = new azure.appservice.Plan("example", {
name: "example-appserviceplan",
location: example.location,
resourceGroupName: example.name,
kind: "App",
reserved: true,
sku: {
tier: "Standard",
size: "S1",
},
});
export const appServicePlanId = examplePlan.id;
Key Points:
- Provider Configuration: Initializes the Azure provider.
- Resource Group: A container that holds related resources for an Azure solution.
- App Service Plan: Defines the compute resources for a web app including pricing tier and size.
- Output: Displays the ID of the created app service plan.
Summary
In this example, we created an Azure-native web app service plan using Pulumi. By defining an Azure resource group and an app service plan, you now have the necessary infrastructure to deploy web applications on Azure’s App Service platform.
Deploy this code
Want to deploy this code? Sign up for a free Pulumi account to deploy in a few clicks.
Sign upNew to Pulumi?
Want to deploy this code? Sign up with Pulumi to deploy in a few clicks.
Sign upThank you for your feedback!
If you have a question about how to use Pulumi, reach out in Community Slack.
Open an issue on GitHub to report a problem or suggest an improvement.