Skip to content

Commit 5f9d41d

Browse files
authored
[BotService] Fix the issue that didn't pack resources files of bot service. (#14221)
* Fix the issue that didn't pack resources files of bot service. * Fix the issue that didn't pack resources files of bot service. * Add Debug info for test phase * Add Debug info for test phase * Fix the issue of test project list is empty Co-authored-by: wyunchi-ms <[email protected]>
1 parent 8a017cf commit 5f9d41d

File tree

6 files changed

+310
-1
lines changed

6 files changed

+310
-1
lines changed

build.proj

+1-1
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@
317317

318318
<!-- https://github.com/Microsoft/msbuild/issues/3157#issuecomment-378002971 -->
319319
<!-- https://github.com/xunit/xunit/issues/1154#issuecomment-405366373 -->
320-
<Exec Command="dotnet test $(RepoArtifacts)Azure.PowerShell.sln --filter &quot;AcceptanceType=CheckIn%26RunType!=DesktopOnly&quot; --configuration $(Configuration) --framework $(TestFramework) --logger trx --results-directory &quot;$(TestOutputDirectory)&quot;" Condition="$(TestCsprojListCount) == 0" />
320+
<Exec Command="dotnet test $(RepoArtifacts)Azure.PowerShell.sln --filter &quot;AcceptanceType=CheckIn%26RunType!=DesktopOnly&quot; --configuration $(Configuration) --framework $(TestFramework) --logger trx --results-directory &quot;$(TestOutputDirectory)&quot;" Condition="$(TestCsprojListCount) != 0" />
321321
<Message Importance="high" Text="Finish running tests..." />
322322
<OnError ExecuteTargets="TestFailureErrorMessage" />
323323
</Target>

src/BotService/Changelog.md

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21+
* Fixed the issue that didn't pack template files into nupkg.
2122

2223
## Version 0.1.0
2324
* First preview release for module Az.BotService

src/BotService/readme.md

+3
Original file line numberDiff line numberDiff line change
@@ -135,4 +135,7 @@ directive:
135135
set:
136136
parameter-name: Name
137137
alias: BotName
138+
- from: Az.BotService.nuspec
139+
where: $
140+
transform: $ = $.replace('</files>', ' <file src="resources\**\*.*" target="resources" />\n </files>');
138141
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
This configuration file is required if iisnode is used to run a TypeScript Node.js processes behind
4+
IIS or IIS Express. For more information, visit:
5+
6+
https://github.com/tjanczuk/iisnode/blob/master/src/samples/configuration/web.config
7+
-->
8+
9+
<configuration>
10+
<system.webServer>
11+
<!-- Visit http://blogs.msdn.com/b/windowsazure/archive/2013/11/14/introduction-to-websockets-on-windows-azure-web-sites.aspx for more information on WebSocket support -->
12+
<webSocket enabled="false" />
13+
<handlers>
14+
<!-- Indicates that the server.js file is a node.js site to be handled by the iisnode module -->
15+
<add name="iisnode" path="lib/index.js" verb="*" modules="iisnode"/>
16+
</handlers>
17+
<rewrite>
18+
<rules>
19+
<!-- Do not interfere with requests for node-inspector debugging -->
20+
<rule name="NodeInspector" patternSyntax="ECMAScript" stopProcessing="true">
21+
<match url="^lib/index.js\/debug[\/]?" />
22+
</rule>
23+
24+
<!-- First we consider whether the incoming URL matches a physical file in the /public folder -->
25+
<rule name="StaticContent">
26+
<action type="Rewrite" url="public{REQUEST_URI}"/>
27+
</rule>
28+
29+
<!-- All other URLs are mapped to the node.js site entry point -->
30+
<rule name="DynamicContent">
31+
<conditions>
32+
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="True"/>
33+
</conditions>
34+
<action type="Rewrite" url="lib/index.js"/>
35+
</rule>
36+
</rules>
37+
</rewrite>
38+
39+
<!-- 'bin' directory has no special meaning in node.js and apps can be placed in it -->
40+
<security>
41+
<requestFiltering>
42+
<hiddenSegments>
43+
<remove segment="bin"/>
44+
</hiddenSegments>
45+
</requestFiltering>
46+
</security>
47+
48+
<!-- Make sure error responses are left untouched -->
49+
<httpErrors existingResponse="PassThrough" />
50+
51+
<!--
52+
You can control how Node is hosted within IIS using the following options:
53+
* watchedFiles: semi-colon separated list of files that will be watched for changes to restart the server
54+
* node_env: will be propagated to node as NODE_ENV environment variable
55+
* debuggingEnabled - controls whether the built-in debugger is enabled
56+
57+
See https://github.com/tjanczuk/iisnode/blob/master/src/samples/configuration/web.config for a full list of options
58+
-->
59+
<!--<iisnode watchedFiles="web.config;*.js"/>-->
60+
</system.webServer>
61+
</configuration>

src/BotService/resources/web.config

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
This configuration file is required if iisnode is used to run node processes behind
4+
IIS or IIS Express. For more information, visit:
5+
6+
https://github.com/tjanczuk/iisnode/blob/master/src/samples/configuration/web.config
7+
-->
8+
9+
<configuration>
10+
<system.webServer>
11+
<!-- Visit http://blogs.msdn.com/b/windowsazure/archive/2013/11/14/introduction-to-websockets-on-windows-azure-web-sites.aspx for more information on WebSocket support -->
12+
<webSocket enabled="false" />
13+
<handlers>
14+
<!-- Indicates that the server.js file is a node.js site to be handled by the iisnode module -->
15+
<add name="iisnode" path="index.js" verb="*" modules="iisnode"/>
16+
</handlers>
17+
<rewrite>
18+
<rules>
19+
<!-- Do not interfere with requests for node-inspector debugging -->
20+
<rule name="NodeInspector" patternSyntax="ECMAScript" stopProcessing="true">
21+
<match url="^index.js\/debug[\/]?" />
22+
</rule>
23+
24+
<!-- First we consider whether the incoming URL matches a physical file in the /public folder -->
25+
<rule name="StaticContent">
26+
<action type="Rewrite" url="public{REQUEST_URI}"/>
27+
</rule>
28+
29+
<!-- All other URLs are mapped to the node.js site entry point -->
30+
<rule name="DynamicContent">
31+
<conditions>
32+
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="True"/>
33+
</conditions>
34+
<action type="Rewrite" url="index.js"/>
35+
</rule>
36+
</rules>
37+
</rewrite>
38+
39+
<!-- 'bin' directory has no special meaning in node.js and apps can be placed in it -->
40+
<security>
41+
<requestFiltering>
42+
<hiddenSegments>
43+
<remove segment="bin"/>
44+
</hiddenSegments>
45+
</requestFiltering>
46+
</security>
47+
48+
<!-- Make sure error responses are left untouched -->
49+
<httpErrors existingResponse="PassThrough" />
50+
51+
<!--
52+
You can control how Node is hosted within IIS using the following options:
53+
* watchedFiles: semi-colon separated list of files that will be watched for changes to restart the server
54+
* node_env: will be propagated to node as NODE_ENV environment variable
55+
* debuggingEnabled - controls whether the built-in debugger is enabled
56+
57+
See https://github.com/tjanczuk/iisnode/blob/master/src/samples/configuration/web.config for a full list of options
58+
-->
59+
<!--<iisnode watchedFiles="web.config;*.js"/>-->
60+
</system.webServer>
61+
</configuration>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
{
2+
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
3+
"contentVersion": "1.0.0.0",
4+
"parameters": {
5+
"botEnv": {
6+
"type": "string",
7+
"defaultValue": "prod"
8+
},
9+
"botId": {
10+
"type": "string"
11+
},
12+
"description": {
13+
"type": "string",
14+
"defaultValue": ""
15+
},
16+
"location": {
17+
"type": "string"
18+
},
19+
"sku": {
20+
"type": "string"
21+
},
22+
"kind": {
23+
"type": "string"
24+
},
25+
"siteName": {
26+
"type": "string"
27+
},
28+
"appId": {
29+
"type": "string",
30+
"defaultValue": "1234"
31+
},
32+
"appSecret": {
33+
"type": "string",
34+
"defaultValue": "blank"
35+
},
36+
"zipUrl": {
37+
"type": "string",
38+
"defaultValue": ""
39+
},
40+
"serverFarmId": {
41+
"type": "string"
42+
},
43+
"createServerFarm": {
44+
"type": "bool"
45+
},
46+
"serverFarmLocation": {
47+
"type": "string",
48+
"defaultValue": ""
49+
},
50+
"serverFarmSku": {
51+
"type": "object",
52+
"defaultValue": {
53+
"name": "S1",
54+
"tier": "Standard",
55+
"size": "S1",
56+
"family": "S",
57+
"capacity": 1
58+
}
59+
},
60+
"endpoint": {
61+
"type": "string",
62+
"defaultValue": ""
63+
},
64+
"botFileEncryptionKey": {
65+
"type": "string",
66+
"defaultValue": ""
67+
}
68+
},
69+
"variables": {
70+
"serverFarmName": "[last(split(parameters('serverFarmId'), '/'))]",
71+
"botAppKinds": {
72+
"sdk": "app",
73+
"bot": ""
74+
},
75+
"botAppKind": "[variables('botAppKinds')[parameters('kind')]]",
76+
"siteHost": "[concat(parameters('siteName'), '.azurewebsites.net')]",
77+
"botEndpointConfig": {
78+
"bot": "[parameters('endpoint')]",
79+
"sdk": "[concat('https://', variables('siteHost'), '/api/messages')]"
80+
},
81+
"botEndpoint": "[variables('botEndpointConfig')[parameters('kind')]]"
82+
},
83+
"resources": [
84+
{
85+
"type": "Microsoft.Web/serverfarms",
86+
"condition": "[parameters('createServerFarm')]",
87+
"name": "[variables('serverFarmName')]",
88+
"apiVersion": "2016-09-01",
89+
"location": "[parameters('serverFarmLocation')]",
90+
"sku": "[parameters('serverFarmSku')]",
91+
"properties": {
92+
"name": "[variables('serverFarmName')]"
93+
}
94+
},
95+
{
96+
"name": "[parameters('siteName')]",
97+
"type": "Microsoft.Web/sites",
98+
"apiVersion": "2015-08-01",
99+
"location": "[parameters('location')]",
100+
"kind": "[variables('botAppKind')]",
101+
"dependsOn": [
102+
"[parameters('serverFarmId')]"
103+
],
104+
"properties": {
105+
"name": "[parameters('siteName')]",
106+
"serverFarmId": "[parameters('serverFarmId')]",
107+
"siteConfig": {
108+
"appSettings": [
109+
{
110+
"name": "WEBSITE_NODE_DEFAULT_VERSION",
111+
"value": "10.14.1"
112+
},
113+
{
114+
"name": "MicrosoftAppId",
115+
"value": "[parameters('appId')]"
116+
},
117+
{
118+
"name": "MicrosoftAppPassword",
119+
"value": "[parameters('appSecret')]"
120+
}
121+
],
122+
"cors": {
123+
"allowedOrigins": [
124+
"https://botservice.hosting.portal.azure.net",
125+
"https://hosting.onecloud.azure-test.net/"
126+
]
127+
}
128+
}
129+
},
130+
"resources": [
131+
{
132+
"name": "MSDeploy",
133+
"type": "Extensions",
134+
"apiVersion": "2015-02-01",
135+
"condition": "[not(equals(parameters('zipUrl'), ''))]",
136+
"dependsOn": [
137+
"[concat('Microsoft.Web/Sites/', parameters('siteName'))]"
138+
],
139+
"properties": {
140+
"packageUri": "[parameters('zipUrl')]",
141+
"dbType": "None",
142+
"connectionString": "",
143+
"setParameters": {
144+
"IIS Web Application Name": "[parameters('siteName')]"
145+
}
146+
}
147+
}
148+
]
149+
},
150+
{
151+
"apiVersion": "2017-12-01",
152+
"type": "Microsoft.BotService/botServices",
153+
"name": "[parameters('botId')]",
154+
"location": "global",
155+
"kind": "[parameters('kind')]",
156+
"sku": {
157+
"name": "[parameters('sku')]"
158+
},
159+
"properties": {
160+
"name": "[parameters('botId')]",
161+
"displayName": "[parameters('botId')]",
162+
"endpoint": "[variables('botEndpoint')]",
163+
"msaAppId": "[parameters('appId')]",
164+
"publishingCredentials": "[list(concat(resourceId('Microsoft.Web/Sites', parameters('siteName')), '/config/publishingcredentials'), '2018-02-01')]",
165+
"allSettings": {
166+
"WEBSITE_NODE_DEFAULT_VERSION": "10.14.1",
167+
"SCM_DO_BUILD_DURING_DEPLOYMENT": "true",
168+
"BotId": "[parameters('botId')]",
169+
"MicrosoftAppId": "[parameters('appId')]",
170+
"MicrosoftAppPassword": "[parameters('appSecret')]",
171+
"botFilePath": "[concat('./', parameters('botId'), '.bot')]",
172+
"botFileSecret": "[parameters('botFileEncryptionKey')]",
173+
"description": "[parameters('description')]"
174+
}
175+
},
176+
"dependsOn": [
177+
"[parameters('serverFarmId')]",
178+
"[resourceId('Microsoft.Web/sites/', parameters('siteName'))]",
179+
"MSDeploy"
180+
]
181+
}
182+
]
183+
}

0 commit comments

Comments
 (0)