Skip to content

Instantly share code, notes, and snippets.

@egil
Created September 25, 2023 16:13
Show Gist options
  • Save egil/4118be48a792610f547bb7ebcc4fac5f to your computer and use it in GitHub Desktop.
Save egil/4118be48a792610f547bb7ebcc4fac5f to your computer and use it in GitHub Desktop.
An example of using bicep to create a Azure App Service running Windows and .NET 8 preview
param resourceName string
param subnetId string
param appServicePlanId string
param appsettingsProperties object
param location string = resourceGroup().location
param tags object = resourceGroup().tags
param eventHubNames array
resource appService 'Microsoft.Web/sites@2022-09-01' = {
name: resourceName
kind: 'app'
location: location
tags: tags
identity: {
type: 'SystemAssigned'
}
properties: {
serverFarmId: appServicePlanId
virtualNetworkSubnetId: subnetId
vnetRouteAllEnabled: true
httpsOnly: true
siteConfig: {
keyVaultReferenceIdentity: 'SystemAssigned'
publicNetworkAccess: 'Enabled'
alwaysOn: true
minTlsVersion: '1.2'
use32BitWorkerProcess: true
ftpsState: 'Disabled'
webSocketsEnabled: true
http20Enabled: true
vnetRouteAllEnabled: true
netFrameworkVersion: 'v8.0'
windowsFxVersion: 'dotnet:8'
cors: {
allowedOrigins: [ '*' ]
}
}
}
}
resource appsettings 'Microsoft.Web/sites/config@2022-09-01' = {
parent: appService
name: 'appsettings'
properties: appsettingsProperties
}
resource aspNetCore8Support 'Microsoft.Web/sites/siteextensions@2022-09-01' = {
parent: appService
name: 'AspNetCoreRuntime.8.0.x86'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment