@@ -65,8 +65,10 @@ private async Task Initialize()
6565 // after all initialization is done, do a final restart for good measure
6666 await RestartSite ( ) ;
6767
68- Trace . WriteLine ( "Environment initialized. " ) ;
68+ Trace . WriteLine ( "Environment initialized" ) ;
6969 Telemetry . TrackEvent ( new EventTelemetry ( "EnvironmentInitialized" ) ) ;
70+
71+ Trace . WriteLine ( "Test run starting..." ) ;
7072 }
7173
7274 private async Task RedeployTestSite ( )
@@ -112,6 +114,8 @@ private async Task InitializeFunctionKeys()
112114
113115 private async Task WaitForSite ( )
114116 {
117+ Trace . WriteLine ( "Waiting for site..." ) ;
118+
115119 using ( var client = new HttpClient ( ) )
116120 {
117121 HttpStatusCode statusCode ;
@@ -127,24 +131,32 @@ private async Task WaitForSite()
127131 }
128132 while ( statusCode != HttpStatusCode . OK && attempts < 5 ) ;
129133 }
134+
135+ Trace . WriteLine ( "Site is up and running!" ) ;
130136 }
131137
132138 private async Task AddSettings ( )
133139 {
134140 Trace . WriteLine ( "Updating app settings..." ) ;
135141 Telemetry . TrackEvent ( "SettingsUpdate" ) ;
142+
136143 await AddAppSetting ( Constants . ServiceBusKey , Environment . GetEnvironmentVariable ( Constants . ServiceBusKey ) ) ;
144+
145+ Trace . WriteLine ( "App settings updated" ) ;
137146 }
138147
139148 private async Task UpdateSiteContents ( )
140149 {
141150 Trace . WriteLine ( "Updating site contents..." ) ;
142151 Telemetry . TrackEvent ( "ContentUpdate" ) ;
152+
143153 await _kuduClient . DeleteDirectory ( "site/wwwroot" , true ) ;
144154 string filePath = Path . ChangeExtension ( Path . GetTempFileName ( ) , "zip" ) ;
145155 ZipFile . CreateFromDirectory ( Path . Combine ( Environment . CurrentDirectory , "Functions" ) , filePath ) ;
146156
147157 await _kuduClient . UploadZip ( "site" , filePath ) ;
158+
159+ Trace . WriteLine ( "Site contents updated" ) ;
148160 }
149161
150162 private async Task UpdateRuntime ( )
@@ -180,16 +192,29 @@ private async Task UpdateRuntime()
180192
181193 public async Task RestartSite ( )
182194 {
195+ Trace . WriteLine ( "Restarting site..." ) ;
196+
183197 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" ) ;
184200 }
185201
186202 public async Task StopSite ( )
187203 {
204+ Trace . WriteLine ( "Stopping site..." ) ;
205+
188206 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" ) ;
189209 }
210+
190211 public async Task StartSite ( )
191212 {
213+ Trace . WriteLine ( "Starting site..." ) ;
214+
192215 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" ) ;
193218 }
194219
195220 public async Task AddAppSetting ( string name , string value )
0 commit comments