@@ -65,8 +65,10 @@ private async Task Initialize()
65
65
// after all initialization is done, do a final restart for good measure
66
66
await RestartSite ( ) ;
67
67
68
- Trace . WriteLine ( "Environment initialized. " ) ;
68
+ Trace . WriteLine ( "Environment initialized" ) ;
69
69
Telemetry . TrackEvent ( new EventTelemetry ( "EnvironmentInitialized" ) ) ;
70
+
71
+ Trace . WriteLine ( "Test run starting..." ) ;
70
72
}
71
73
72
74
private async Task RedeployTestSite ( )
@@ -112,6 +114,8 @@ private async Task InitializeFunctionKeys()
112
114
113
115
private async Task WaitForSite ( )
114
116
{
117
+ Trace . WriteLine ( "Waiting for site..." ) ;
118
+
115
119
using ( var client = new HttpClient ( ) )
116
120
{
117
121
HttpStatusCode statusCode ;
@@ -127,24 +131,32 @@ private async Task WaitForSite()
127
131
}
128
132
while ( statusCode != HttpStatusCode . OK && attempts < 5 ) ;
129
133
}
134
+
135
+ Trace . WriteLine ( "Site is up and running!" ) ;
130
136
}
131
137
132
138
private async Task AddSettings ( )
133
139
{
134
140
Trace . WriteLine ( "Updating app settings..." ) ;
135
141
Telemetry . TrackEvent ( "SettingsUpdate" ) ;
142
+
136
143
await AddAppSetting ( Constants . ServiceBusKey , Environment . GetEnvironmentVariable ( Constants . ServiceBusKey ) ) ;
144
+
145
+ Trace . WriteLine ( "App settings updated" ) ;
137
146
}
138
147
139
148
private async Task UpdateSiteContents ( )
140
149
{
141
150
Trace . WriteLine ( "Updating site contents..." ) ;
142
151
Telemetry . TrackEvent ( "ContentUpdate" ) ;
152
+
143
153
await _kuduClient . DeleteDirectory ( "site/wwwroot" , true ) ;
144
154
string filePath = Path . ChangeExtension ( Path . GetTempFileName ( ) , "zip" ) ;
145
155
ZipFile . CreateFromDirectory ( Path . Combine ( Environment . CurrentDirectory , "Functions" ) , filePath ) ;
146
156
147
157
await _kuduClient . UploadZip ( "site" , filePath ) ;
158
+
159
+ Trace . WriteLine ( "Site contents updated" ) ;
148
160
}
149
161
150
162
private async Task UpdateRuntime ( )
@@ -180,16 +192,29 @@ private async Task UpdateRuntime()
180
192
181
193
public async Task RestartSite ( )
182
194
{
195
+ Trace . WriteLine ( "Restarting site..." ) ;
196
+
183
197
await IssueSiteCommand ( $ "/subscriptions/{ Settings . SiteSubscriptionId } /resourceGroups/{ Settings . SiteResourceGroup } /providers/Microsoft.Web/sites/{ Settings . SiteName } /restart?api-version=2015-08-01&softRestart=true&synchronous=true") ;
198
+
199
+ Trace . WriteLine ( "Site restarted" ) ;
184
200
}
185
201
186
202
public async Task StopSite ( )
187
203
{
204
+ Trace . WriteLine ( "Stopping site..." ) ;
205
+
188
206
await IssueSiteCommand ( $ "/subscriptions/{ Settings . SiteSubscriptionId } /resourceGroups/{ Settings . SiteResourceGroup } /providers/Microsoft.Web/sites/{ Settings . SiteName } /stop?api-version=2015-08-01") ;
207
+
208
+ Trace . WriteLine ( "Site stopped" ) ;
189
209
}
210
+
190
211
public async Task StartSite ( )
191
212
{
213
+ Trace . WriteLine ( "Starting site..." ) ;
214
+
192
215
await IssueSiteCommand ( $ "/subscriptions/{ Settings . SiteSubscriptionId } /resourceGroups/{ Settings . SiteResourceGroup } /providers/Microsoft.Web/sites/{ Settings . SiteName } /start?api-version=2015-08-01") ;
216
+
217
+ Trace . WriteLine ( "Site started" ) ;
193
218
}
194
219
195
220
public async Task AddAppSetting ( string name , string value )
0 commit comments