コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }