public async Task UploadUserCode(string zipPackagePath) { await EnsureScmHttpClient(); using (var response = await ScmClient.PutZipFile($"{ScmBaseUrl}/api/zip/LocalSiteRoot/funclite", zipPackagePath)) { response.EnsureSuccessStatusCode(); } }
protected internal override async Task <dynamic> SendRequest(object payload) { await EnsureScmHttpClient(); using (var response = await ScmClient.PostAsJsonAsync($"{ScmBaseUrl}/funclite", payload)) { response.EnsureSuccessStatusCode(); return(await response.Content.ReadAsAsync <dynamic>()); } }
async Task Restart() { // Just kill the scm site to restart it (faster than full site restart) await EnsureScmHttpClient(); using (var response = await ScmClient.DeleteAsync($"{ScmBaseUrl}/api/processes/0")) { // Ignore errors as suiciding the scm w3wp can cause the delete request to fail (even though it still kills it) //response.EnsureSuccessStatusCode(); } }
protected override async Task UploadLanguageHost() { _logger.LogInformation("UploadLanguageHost " + Name); await CreateKuduFolder(@"d:\home\SiteExtensions\FuncLite"); await EnsureScmHttpClient(); using (var response = await ScmClient.PutZipFile($"{ScmBaseUrl}/api/zip/SiteExtensions/FuncLite", $"{_config.DataFolder}/runtimes/node.zip")) { response.EnsureSuccessStatusCode(); } }
public async Task SendWarmUpRequests() { // As a warmup request, create the folder where the user files will land, to make sure it's there is the site restarts await CreateKuduFolder(@"d:\local\funclite"); await EnsureScmHttpClient(); using (var response = await ScmClient.GetAsync($"{ScmBaseUrl}/funclite")) { response.EnsureSuccessStatusCode(); } }
async Task RunKuduCommand(string command) { await EnsureScmHttpClient(); using (var response = await ScmClient.PostAsJsonAsync( $"{ScmBaseUrl}/api/command", new { command = command })) { response.EnsureSuccessStatusCode(); } }
public new async Task Delete() { using (var response = await Client.DeleteAsync( $"/subscriptions/{_config.Subscription}/resourceGroups/{_config.ResourceGroup}/providers/Microsoft.Web/sites/{AppName}?api-version=2016-03-01")) { response.EnsureSuccessStatusCode(); } if (ScmClient != null) { ScmClient.Dispose(); ScmClient = null; } }
public async Task SendWarmUpRequests() { await EnsureScmHttpClient(); using (var response = await ScmClient.GetAsync($"{ScmBaseUrl}")) { response.EnsureSuccessStatusCode(); } using (var response = await Client.GetAsync($"{SiteUrl}")) { response.EnsureSuccessStatusCode(); } }