Skip to content

Commit 6c436a4

Browse files
authored
Supporting Windows and Linux web apps. Linux by default (#57)
* Supporting Windows and Linux web apps. Linux by default * bug fix * update readme * adding doc * update readme
1 parent 4f12d72 commit 6c436a4

2 files changed

Lines changed: 120 additions & 13 deletions

File tree

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ A simple web page to hand off users to the Microsoft Health bot
99

1010
[![Deploy to Azure](https://azuredeploy.net/deploybutton.png)](https://azuredeploy.net/)
1111

12+
Note: It is recommended you use the default Linux host type when deploying the container.
13+
However, if you wish to enable online file editing using the App Service Editor, select 'Windows'.
14+
1215
2.Set the following environment variables:
1316

1417
`APP_SECRET`
@@ -48,7 +51,7 @@ In some cases it is required to set the endpoint URI so that it points to a spec
4851

4952
Pass your preferred geographic endpoint URI by setting the environment variable: `DIRECTLINE_ENDPOINT_URI` in your deployment. If no variable is found it will default to `directline.botframework.com`
5053

51-
**Note:** If you are deploying the code sample using the "Deploy to Azure" option, you should add the above secrets to the application settings for your App Service.
54+
**Note:** If you are deploying the code sample using the "Deploy to Azure" option, you should add the above secrets to the application settings for your App Service.
5255

5356
## Agent webchat
5457
If the agent webchat sample is also required, [switch to the live agent handoff branch](https://github.com/Microsoft/HealthBotContainerSample/tree/live_agent_handoff)

azuredeploy.json

Lines changed: 116 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,24 @@
77
"defaultValue": "[concat('HealthBot', uniqueString(resourceGroup().name, utcNow('F')))]",
88
"metadata":{
99
"description": "Web site name. Has to be unique."
10-
10+
11+
}
12+
},
13+
"serverKind": {
14+
"type": "string",
15+
"defaultValue": "linux",
16+
"allowedValues": [
17+
"linux",
18+
"windows"
19+
],
20+
"metadata": {
21+
"description": "Host type: Linux or Windows. (Linux is recommended)"
1122
}
1223
},
1324
"skuName": {
1425
"type": "string",
1526
"defaultValue": "P1V2",
16-
"allowedValues": [
27+
"allowedValues": [
1728
"B1",
1829
"S1",
1930
"P1V2"
@@ -44,7 +55,7 @@
4455
"webchatSecret": {
4556
"type": "securestring",
4657
"metadata":{
47-
"description": "Healthbot webchat secret."
58+
"description": "Healthbot webchat secret."
4859
}
4960
}
5061
},
@@ -53,21 +64,33 @@
5364
"skuCode": "[parameters('skuName')]",
5465
"numberOfWorkers": "[parameters('numberOfInstances')]",
5566
"linuxFxVersion": "NODE|lts",
56-
"hostingPlanName": "[concat('hpn-', parameters('siteName'))]",
67+
"hostingPlanNameLinux": "[concat('hpn-', parameters('siteName'))]",
68+
"hostingPlanNameWin": "[concat('hpn-win-', parameters('siteName'))]",
5769
"repoURL": "https://github.com/microsoft/HealthBotContainerSample.git",
58-
"branch": "master"
70+
"branch": "master",
71+
"kind": "[if(equals(parameters('serverKind'), 'windows'), 'app', 'linux')]",
72+
"linuxSiteName": "[concat(parameters('siteName'), 'linux')]",
73+
"windowsSiteName": "[concat(parameters('siteName'), 'windows')]",
74+
"WinSkuCode": "[parameters('skuName')]",
75+
"WinSku": "Standard",
76+
"workerSize": "0",
77+
"workerSizeId": "0",
78+
"hostingEnvironment": "",
79+
"nodeVersion": "12.13.0",
80+
"currentStack": "node"
5981
},
6082
"resources": [
6183
{
6284
"apiVersion": "2018-02-01",
63-
"name": "[parameters('siteName')]",
85+
"name": "[variables('linuxSiteName')]",
86+
"condition": "[equals(parameters('serverKind'),'linux')]",
6487
"type": "Microsoft.Web/sites",
6588
"location": "[parameters('siteLocation')]",
6689
"dependsOn": [
67-
"[resourceId('Microsoft.Web/serverfarms/', variables('hostingPlanName'))]"
90+
"[resourceId('Microsoft.Web/serverfarms/', variables('hostingPlanNameLinux'))]"
6891
],
6992
"properties": {
70-
"name": "[parameters('siteName')]",
93+
"name": "[variables('linuxSiteName')]",
7194
"siteConfig": {
7295
"linuxFxVersion": "[variables('linuxFxVersion')]",
7396
"alwaysOn": "[variables('alwaysOn')]",
@@ -82,17 +105,18 @@
82105
}
83106
]
84107
},
85-
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('hostingPlanName'))]",
108+
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('hostingPlanNameLinux'))]",
86109
"clientAffinityEnabled": false
87110
},
88111
"resources": [
89112
{
90113
"type": "sourcecontrols",
114+
"condition": "[equals(parameters('serverKind'),'linux')]",
91115
"apiVersion": "2018-02-01",
92116
"name": "web",
93117
"location": "[parameters('siteLocation')]",
94118
"dependsOn": [
95-
"[resourceId('Microsoft.Web/sites', parameters('siteName'))]"
119+
"[resourceId('Microsoft.Web/sites', variables('linuxSiteName'))]"
96120
],
97121
"properties": {
98122
"repoUrl": "[variables('repoURL')]",
@@ -104,18 +128,98 @@
104128
},
105129
{
106130
"apiVersion": "2018-02-01",
107-
"name": "[variables('hostingPlanName')]",
131+
"condition": "[equals(parameters('serverKind'),'linux')]",
132+
"name": "[variables('hostingPlanNameLinux')]",
108133
"type": "Microsoft.Web/serverfarms",
109134
"location": "[parameters('siteLocation')]",
110135
"kind": "linux",
111136
"sku": {
112137
"Name": "[variables('skuCode')]"
113138
},
114139
"properties": {
115-
"name": "[variables('hostingPlanName')]",
140+
"name": "[variables('hostingPlanNameLinux')]",
116141
"numberOfWorkers": "[variables('numberOfWorkers')]",
117142
"reserved": true
118143
}
144+
},
145+
{
146+
"apiVersion": "2018-11-01",
147+
"condition": "[equals(parameters('serverKind'),'windows')]",
148+
"name": "[variables('windowsSiteName')]",
149+
"type": "Microsoft.Web/sites",
150+
"location": "[parameters('siteLocation')]",
151+
"tags": null,
152+
"dependsOn": [
153+
"[concat('Microsoft.Web/serverfarms/', variables('hostingPlanNameWin'))]"
154+
],
155+
"properties": {
156+
"name": "[variables('windowsSiteName')]",
157+
"siteConfig": {
158+
"appSettings": [
159+
{
160+
"name": "APP_SECRET",
161+
"value": "[parameters('appSecret')]"
162+
},
163+
{
164+
"name": "WEBCHAT_SECRET",
165+
"value": "[parameters('webchatSecret')]"
166+
},
167+
{
168+
"name": "WEBSITE_NODE_DEFAULT_VERSION",
169+
"value": "[variables('nodeVersion')]"
170+
}
171+
],
172+
"metadata": [
173+
{
174+
"name": "CURRENT_STACK",
175+
"value": "[variables('currentStack')]"
176+
}
177+
],
178+
"nodeVersion": "[variables('nodeVersion')]",
179+
"alwaysOn": "[variables('alwaysOn')]"
180+
},
181+
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('hostingPlanNameWin'))]",
182+
"hostingEnvironment": "[variables('hostingEnvironment')]",
183+
"clientAffinityEnabled": true
184+
},
185+
"resources": [
186+
{
187+
"type": "sourcecontrols",
188+
"condition": "[equals(parameters('serverKind'),'windows')]",
189+
"apiVersion": "2018-11-01",
190+
"name": "web",
191+
"location": "[parameters('siteLocation')]",
192+
"dependsOn": [
193+
"[resourceId('Microsoft.Web/sites', variables('windowsSiteName'))]"
194+
],
195+
"properties": {
196+
"repoUrl": "[variables('repoURL')]",
197+
"branch": "[variables('branch')]",
198+
"isManualIntegration": true
199+
}
200+
}
201+
]
202+
},
203+
{
204+
"apiVersion": "2018-11-01",
205+
"name": "[variables('hostingPlanNameWin')]",
206+
"condition": "[equals(parameters('serverKind'),'windows')]",
207+
"type": "Microsoft.Web/serverfarms",
208+
"location": "[parameters('siteLocation')]",
209+
"kind": "",
210+
"tags": null,
211+
"dependsOn": [],
212+
"properties": {
213+
"name": "[variables('hostingPlanNameWin')]",
214+
"workerSize": "[variables('workerSize')]",
215+
"workerSizeId": "[variables('workerSizeId')]",
216+
"numberOfWorkers": "[variables('numberOfWorkers')]",
217+
"hostingEnvironment": "[variables('hostingEnvironment')]"
218+
},
219+
"sku": {
220+
"Tier": "[variables('WinSku')]",
221+
"Name": "[variables('WinSkuCode')]"
222+
}
119223
}
120224
]
121225
}

0 commit comments

Comments
 (0)