internal override async Task <int> RunAsync(CancellationToken cancellationToken) { var context = await Context .WithAzureLogon() .WithDevOpsLogon() .BuildAsync(cancellationToken); var instance = new InstanceName(Instance, ResourceGroup); var mappings = new AggregatorMappings(context.Devops, context.Azure, context.Logger); bool ok = await mappings.RemoveRuleAsync(instance, Name); var rules = new AggregatorRules(context.Azure, context.Logger); //rules.Progress += Instances_Progress; ok = ok && await rules.RemoveAsync(instance, Name, cancellationToken); return(ok ? 0 : 1); }
internal override async Task <int> RunAsync() { var context = await Context .WithAzureLogon() .WithVstsLogon() .Build(); var instance = new InstanceName(Instance); var mappings = new AggregatorMappings(context.Vsts, context.Azure, context.Logger); bool ok = await mappings.RemoveRuleAsync(instance, Name); var rules = new AggregatorRules(context.Azure, context.Logger); //rules.Progress += Instances_Progress; ok = ok && await rules.RemoveAsync(instance, Name); return(ok ? 0 : 1); }
internal override async Task <int> RunAsync(CancellationToken cancellationToken) { var context = await Context .WithAzureLogon() .WithDevOpsLogon() .BuildAsync(cancellationToken); var instance = context.Naming.Instance(Instance, ResourceGroup); var mappings = new AggregatorMappings(context.Devops, context.Azure, context.Logger, context.Naming); var outcome = await mappings.RemoveRuleAsync(instance, Name); if (outcome == RemoveOutcome.Failed) { return(ExitCodes.Failure); } var rules = new AggregatorRules(context.Azure, context.Logger); bool ok = await rules.RemoveAsync(instance, Name, cancellationToken); return(ok ? ExitCodes.Success : ExitCodes.Failure); }