Skip to content

Commit

Permalink
Add web-app-linux example (#1148)
Browse files Browse the repository at this point in the history
* Add dev container for codespaces

* Add example for web-app-linux

* Remove devcontainer after reading discussion in #455

* Add web-app-linux to index

* format main.bicep

* Trigger new workflow run. Nerdbank git versioning stuck process.

* Add line at end of file
  • Loading branch information
MarcusFelling authored Dec 14, 2020
1 parent 4b3e8b1 commit fde03e1
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 0 deletions.
31 changes: 31 additions & 0 deletions docs/examples/101/web-app-linux/main.bicep
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
param webAppName string = uniqueString(resourceGroup().id) // Generate unique String for web app name
param sku string = 'S1' // The SKU of App Service Plan
param linuxFxVersion string = 'php|7.4' // The runtime stack of web app
param location string = resourceGroup().location // Location for all resources

var appServicePlanName = toLower('AppServicePlan-${webAppName}')
var webSiteName = toLower('wapp-${webAppName}')

resource appServicePlan 'Microsoft.Web/serverfarms@2020-06-01' = {
name: appServicePlanName
location: location
sku: {
name: sku
}
kind: 'linux'
properties: {
reserved: true
}
}

resource appService 'Microsoft.Web/sites@2020-06-01' = {
name: webSiteName
location: location
kind: 'app'
properties: {
serverFarmId: appServicePlan.id
siteConfig: {
linuxFxVersion: linuxFxVersion
}
}
}
58 changes: 58 additions & 0 deletions docs/examples/101/web-app-linux/main.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"webAppName": {
"type": "string",
"defaultValue": "[uniqueString(resourceGroup().id)]"
},
"sku": {
"type": "string",
"defaultValue": "S1"
},
"linuxFxVersion": {
"type": "string",
"defaultValue": "php|7.4"
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]"
}
},
"functions": [],
"variables": {
"appServicePlanName": "[toLower(format('AppServicePlan-{0}', parameters('webAppName')))]",
"webSiteName": "[toLower(format('wapp-{0}', parameters('webAppName')))]"
},
"resources": [
{
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2020-06-01",
"name": "[variables('appServicePlanName')]",
"location": "[parameters('location')]",
"sku": {
"name": "[parameters('sku')]"
},
"kind": "linux",
"properties": {
"reserved": true
}
},
{
"type": "Microsoft.Web/sites",
"apiVersion": "2020-06-01",
"name": "[variables('webSiteName')]",
"location": "[parameters('location')]",
"kind": "app",
"properties": {
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('appServicePlanName'))]",
"siteConfig": {
"linuxFxVersion": "[parameters('linuxFxVersion')]"
}
},
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', variables('appServicePlanName'))]"
]
}
]
}
4 changes: 4 additions & 0 deletions docs/examples/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,10 @@
"filePath": "101/vnet-two-subnets/main.bicep",
"description": "101/vnet-two-subnets"
},
{
"filePath": "101/web-app-linux/main.bicep",
"description": "101/web-app-linux"
},
{
"filePath": "101/web-app-windows/main.bicep",
"description": "101/web-app-windows"
Expand Down

0 comments on commit fde03e1

Please sign in to comment.