Skip to content

Commit 2151d81

Browse files
committed
adding windows tab for bicep
1 parent 5187357 commit 2151d81

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

articles/app-service/provision-resource-bicep.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ ms.author: msangapu
66
ms.topic: article
77
ms.custom: devx-track-bicep
88
ms.date: 11/18/2022
9+
zone_pivot_groups: app-service-bicep
910
---
1011

1112
# Create App Service app using Bicep
@@ -22,6 +23,8 @@ To effectively create resources with Bicep, you'll need to set up a Bicep [devel
2223

2324
## Review the template
2425

26+
::: zone pivot="app-service-bicep-linux"
27+
2528
The template used in this quickstart is shown below. It deploys an App Service plan and an App Service app on Linux and a sample Node.js "Hello World" app from the [Azure Samples](https://github.com/Azure-Samples) repo.
2629

2730
```bicep
@@ -86,6 +89,67 @@ This template contains several parameters that are predefined for your convenien
8689

8790
---
8891

92+
::: zone-end
93+
94+
::: zone pivot="app-service-bicep-windows-containers"
95+
96+
The template used in this quickstart is shown below. It deploys an App Service plan and an App Service app on Windows and a sample .NET "Hello World" app from the [Azure Samples](https://github.com/Azure-Samples) repo.
97+
98+
```bicep
99+
param webAppName string = uniqueString(resourceGroup().id) // generate unique name for web app
100+
param location string = resourceGroup().location // location for all resources
101+
param sku string = 'P1V3' // The SKU of App Service Plan
102+
param dockerContainerImage string = 'mcr.microsoft.com/dotnet/framework/samples:aspnetapp' // sample .NET app
103+
var appServicePlanName = toLower('ASP-${webAppName}') // generate unique name for App Service Plan
104+
105+
resource appServicePlan 'Microsoft.Web/serverfarms@2021-02-01' = {
106+
name: appServicePlanName
107+
location: location
108+
sku: {
109+
name: sku
110+
}
111+
properties: {
112+
hyperV: true
113+
}
114+
}
115+
116+
resource webApp 'Microsoft.Web/sites@2024-04-01' = {
117+
name: webAppName
118+
location: location
119+
kind:'app,container,windows'
120+
properties: {
121+
serverFarmId: appServicePlan.id
122+
siteConfig: {
123+
windowsFxVersion: 'DOCKER|${dockerContainerImage}'
124+
appCommandLine: ''
125+
alwaysOn: true
126+
minTlsVersion: '1.3'
127+
}
128+
httpsOnly: true
129+
}
130+
}
131+
132+
```
133+
134+
Three Azure resources are defined in the template:
135+
136+
* [**Microsoft.Web/serverfarms**](/azure/templates/microsoft.web/serverfarms): create an App Service plan.
137+
* [**Microsoft.Web/sites**](/azure/templates/microsoft.web/sites): create an App Service app.
138+
139+
This template contains several parameters that are predefined for your convenience. See the table below for parameter defaults and their descriptions:
140+
141+
| Parameters | Type | Default value | Description |
142+
|------------|---------|------------------------------|-------------|
143+
| webAppName | string | "webApp-**[`<uniqueString>`](../azure-resource-manager/templates/template-functions-string.md#uniquestring)**" | App name |
144+
| location | string | "[[resourceGroup().location](../azure-resource-manager/templates/template-functions-resource.md#resourcegroup)]" | App region |
145+
| sku | string | "P1V3" | Instance size |
146+
| appServicePlanName | string | "toLower('ASP-${webAppName}')" | App Service Plan name |
147+
| dockerContainerImage | string | "mcr.microsoft.com/dotnet/framework/samples:aspnetapp" | container image sample |
148+
149+
---
150+
151+
::: zone-end
152+
89153
## Deploy the template
90154

91155
Copy and paste the template to your preferred editor/IDE and save the file to your local working directory.

0 commit comments

Comments
 (0)