public async Task AutoDeployAsync([NotNull] IReadOnlyCollection <PackageVersion> packageIdentifiers)
        {
            if (packageIdentifiers == null)
            {
                throw new ArgumentNullException(nameof(packageIdentifiers));
            }

            _logger.Information("Received hook for packages {Packages}", string.Join(", ", packageIdentifiers.Select(p => p.ToString())));

            IReadOnlyCollection <DeploymentTarget> deploymentTargets =
                (await _targetSource.GetDeploymentTargetsAsync(CancellationToken.None))
                .SafeToReadOnlyCollection();

            DeploymentTarget[] withAutoDeploy = deploymentTargets.Where(t => t.AutoDeployEnabled).ToArray();

            if (!withAutoDeploy.Any())
            {
                _logger.Information("No target has auto deploy enabled");
            }
            else
            {
                foreach (DeploymentTarget deploymentTarget in withAutoDeploy)
                {
                    foreach (PackageVersion packageIdentifier in packageIdentifiers)
                    {
                        if (deploymentTarget.PackageId.Equals(
                                packageIdentifier.PackageId,
                                StringComparison.OrdinalIgnoreCase))
                        {
                            bool allowDeployment =
                                !packageIdentifier.Version.IsPrerelease || deploymentTarget.AllowPreRelease;

                            if (allowDeployment)
                            {
                                AppVersion metadata = await _monitoringService.GetAppMetadataAsync(
                                    deploymentTarget,
                                    CancellationToken.None);

                                if (metadata.SemanticVersion != null)
                                {
                                    if (packageIdentifier.Version > metadata.SemanticVersion)
                                    {
                                        _logger.Information("Auto deploying package {PackageIdentifier} to target {Name} from web hook", packageIdentifier, deploymentTarget.Name);

                                        DeploymentTaskResult result =
                                            await
                                            _deploymentService.ExecuteDeploymentAsync(
                                                new DeploymentTask(
                                                    $"{packageIdentifier.PackageId}, {packageIdentifier.Version.ToNormalizedString()}",
                                                    deploymentTarget.Id, Guid.NewGuid()
                                                    ),
                                                _logger,
                                                CancellationToken.None);

                                        _logger.Information("Deployed package {PackageIdentifier} to target {Name} from web hook with result {Result}", packageIdentifier, deploymentTarget.Name, result);
                                    }
                                    else
                                    {
                                        _logger.Information("Auto deployment skipped for {PackageIdentifier} since deployed version is higher {V}", packageIdentifier, metadata.SemanticVersion.ToNormalizedString());
                                    }
                                }
                                else
                                {
                                    _logger.Information("Auto deployment skipped for {PackageIdentifier} since the target version could not be determined", packageIdentifier);
                                }
                            }
                            else
                            {
                                _logger.Information("Auto deployment skipped for {PackageIdentifier} since the target does not allow pre-release", packageIdentifier);
                            }
                        }
                        else
                        {
                            _logger.Information("No package id matched {PackageIdentifier} for target {Name}", packageIdentifier, deploymentTarget.Name);
                        }
                    }
                }
            }
        }