// TODO add --swap.slot to support App Service Deployment Slots internal override async Task <int> RunAsync(CancellationToken cancellationToken) { var context = await Context .WithAzureLogon() .WithDevOpsLogon() // need the token, so we can save it in the app settings .BuildAsync(cancellationToken); var instances = new AggregatorInstances(context.Azure, context.Logger, context.Naming); var instance = context.Naming.Instance(Name, ResourceGroup); bool ok = false; if (Authentication) { ok = await instances.ChangeAppSettingsAsync(instance, Location, SaveMode, cancellationToken); } else { context.Logger.WriteError($"Unsupported command option(s)"); } return(ok ? 0 : 1); }
// TODO add --swap.slot to support App Service Deployment Slots internal override async Task <int> RunAsync(CancellationToken cancellationToken) { var context = await Context .WithAzureLogon() .WithDevOpsLogon() // need the token, so we can save it in the app settings .BuildAsync(cancellationToken); context.ResourceGroupDeprecationCheck(this.ResourceGroup); var instances = new AggregatorInstances(context.Azure, context.Logger, context.Naming); var instance = context.Naming.Instance(Name, ResourceGroup); if (Authentication) { bool ok = await instances.ChangeAppSettingsAsync(instance, Location, SaveMode, cancellationToken); return(ok ? ExitCodes.Success : ExitCodes.Failure); } else { context.Logger.WriteError($"Unsupported command option(s)"); return(ExitCodes.InvalidArguments); } }