internal override async Task <int> RunAsync(CancellationToken cancellationToken) { var context = await Context .WithAzureLogon() .WithDevOpsLogon() .BuildAsync(cancellationToken); var instance = context.Naming.Instance(Name, ResourceGroup); if (!Mappings) { var mappings = new AggregatorMappings(context.Devops, context.Azure, context.Logger, context.Naming); _ = await mappings.RemoveInstanceAsync(instance); } var instances = new AggregatorInstances(context.Azure, context.Logger, context.Naming); var ok = await instances.RemoveAsync(instance, Location); return(ok ? 0 : 1); }
internal override async Task <int> RunAsync() { var context = await Context .WithAzureLogon() .WithVstsLogon() .Build(); var instance = new InstanceName(Name); bool ok; if (!Mappings) { var mappings = new AggregatorMappings(context.Vsts, context.Azure, context.Logger); ok = await mappings.RemoveInstanceAsync(instance); } var instances = new AggregatorInstances(context.Azure, context.Logger); ok = await instances.Remove(instance, Location); return(ok ? 0 : 1); }