public virtual WebAppCreateOrUpdateConfigurationSlotOperation CreateOrUpdate(SiteConfigAutoGeneratedData siteConfig, bool waitForCompletion = true, CancellationToken cancellationToken = default) { if (siteConfig == null) { throw new ArgumentNullException(nameof(siteConfig)); } using var scope = _clientDiagnostics.CreateScope("SiteSlotConfigWeb.CreateOrUpdate"); scope.Start(); try { var response = _webAppsRestClient.CreateOrUpdateConfigurationSlot(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, siteConfig, cancellationToken); var operation = new WebAppCreateOrUpdateConfigurationSlotOperation(this, response); if (waitForCompletion) { operation.WaitForCompletion(cancellationToken); } return(operation); } catch (Exception e) { scope.Failed(e); throw; } }
internal SiteConfigSnapshot(ArmResource options, SiteConfigAutoGeneratedData resource) : base(options, resource.Id) { HasData = true; _data = resource; _clientDiagnostics = new ClientDiagnostics(ClientOptions); _webAppsRestClient = new WebAppsRestOperations(_clientDiagnostics, Pipeline, ClientOptions, BaseUri); }
public virtual Response <SiteSlotConfigWeb> Update(SiteConfigAutoGeneratedData siteConfig, CancellationToken cancellationToken = default) { if (siteConfig == null) { throw new ArgumentNullException(nameof(siteConfig)); } using var scope = _clientDiagnostics.CreateScope("SiteSlotConfigWeb.Update"); scope.Start(); try { var response = _webAppsRestClient.UpdateConfigurationSlot(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, siteConfig, cancellationToken); return(Response.FromValue(new SiteSlotConfigWeb(this, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }