Skip to content

Instantly share code, notes, and snippets.

@weeyin83
Created December 1, 2022 14:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save weeyin83/9c39dd36b709478fe7991cb35d48d5ce to your computer and use it in GitHub Desktop.
Save weeyin83/9c39dd36b709478fe7991cb35d48d5ce to your computer and use it in GitHub Desktop.
Azure Bicep template for deploying a web app and app service plan
param sku string // App Service Plan pricing tier
param linuxFxVersion string = 'node|18-lts' // The runtime stack of web app
param location string // Resource Azure region location
param resourceTags object = {
Environment: 'Tutorial'
Owner: 'Sarah'
} // Tags for all resources
param appServicePlanName string // Name of the App Service Plan
param webSiteName string // Name of the Web App being deployed
// Deploying the Azure App Service Plan
resource appServicePlan 'Microsoft.Web/serverfarms@2022-03-01' = {
name: appServicePlanName
location: location
tags: resourceTags
properties: {
reserved: true
}
sku: {
name: sku
}
kind: 'linux'
}
// Deploying the Azure Web App
resource appService 'Microsoft.Web/sites@2022-03-01' = {
name: webSiteName
location: location
tags: resourceTags
properties: {
serverFarmId: appServicePlan.id
siteConfig: {
linuxFxVersion: linuxFxVersion
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment