private static async Task ProcessOptions(ProgramOptions options, ServiceProvider serviceProvider)
        {
            var logger = serviceProvider.GetRequiredService <ILogger <Program> >();
            var resourceGroupWrapper = serviceProvider.GetService <ResourceGroupWrapper>();

            if (resourceGroupWrapper == null)
            {
                logger.LogError("Unable to create {Name}. Aborting.", nameof(ResourceGroupWrapper));
                return;
            }

            var deletedResourceGroups = await resourceGroupWrapper.DeleteNonLockedResourceGroups(options.Simulate).ConfigureAwait(false);

            if (!string.IsNullOrWhiteSpace(options.Channel))
            {
                var slackClient = serviceProvider.GetRequiredService <ISlackClient>();
                if (slackClient == null)
                {
                    logger.LogError("Unable to create {Name}. Aborting.", nameof(ISlackClient));
                    return;
                }
                var context = new MessageContext
                {
                    DeletedResourceGroups = deletedResourceGroups,
                    WasSimulated          = options.Simulate
                };

                var message = MessageUtil.CreateDeleteInformationMessage(options.Channel, context);
                await slackClient.PostMessage(message).ConfigureAwait(false);
            }
        }
        public async Task ReportToSlack([ActivityTrigger] SlackReportingContext slackReportingContext)
        {
            if (slackReportingContext is null)
            {
                throw new ArgumentNullException(nameof(slackReportingContext));
            }

            var context = new MessageUtil.MessageContext
            {
                DeletedResourceGroups = slackReportingContext.DeletedResourceGroups,
                WasSimulated          = _cleanupConfiguration.Simulate
            };
            var message = MessageUtil.CreateDeleteInformationMessage(_cleanupConfiguration.SlackChannel, context);
            await _slackClient.PostMessage(message).ConfigureAwait(false);
        }