internal override async Task <int> RunAsync(CancellationToken cancellationToken) { var context = await Context .WithAzureLogon() .BuildAsync(cancellationToken); var instance = new InstanceName(Instance, ResourceGroup); var rules = new AggregatorRules(context.Azure, context.Logger); var disable = GetDisableStatus(Disable, Enable); var impersonate = GetEnableStatus(DisableImpersonateExecution, EnableImpersonateExecution); var ok = await rules.ConfigureAsync(instance, Name, disable, impersonate, cancellationToken); return(ok ? 0 : 1); }
internal override async Task <int> RunAsync(CancellationToken cancellationToken) { var context = await Context .WithAzureLogon() .BuildAsync(cancellationToken); context.ResourceGroupDeprecationCheck(this.ResourceGroup); var instance = context.Naming.Instance(Instance, ResourceGroup); var rules = new AggregatorRules(context.Azure, context.Logger); var disable = GetDisableStatus(Disable, Enable); var impersonate = GetEnableStatus(DisableImpersonateExecution, EnableImpersonateExecution); var ok = await rules.ConfigureAsync(instance, Name, disable, impersonate, cancellationToken); return(ok ? ExitCodes.Success : ExitCodes.Failure); }