private async Task <ServiceResponse <DatabaseInstanceInfo> > GetDatabasesForServerFromService(
            IAzureResourceManagementSession session,
            IAzureSqlServerResource azureSqlServer,
            string serverName,
            CancellationToken cancellationToken,
            CancellationToken internalCancellationToken)
        {
            try
            {
                if (cancellationToken.IsCancellationRequested)
                {
                    return(new ServiceResponse <DatabaseInstanceInfo>());
                }
                ServerInstanceInfo serverInstanceInfo = new ServerInstanceInfo(ServerDefinition)
                {
                    Name = azureSqlServer.Name,
                    FullyQualifiedDomainName = azureSqlServer.FullyQualifiedDomainName,
                    AdministratorLogin       = azureSqlServer.AdministratorLogin
                };
                OnDatabaseFound(new DatabaseInstanceInfo(serverInstanceInfo));
                IEnumerable <IAzureResource> databases = await AzureResourceManager.GetAzureDatabasesAsync(
                    session,
                    azureSqlServer.ResourceGroupName,
                    azureSqlServer.Name);

                if (cancellationToken.IsCancellationRequested)
                {
                    return(new ServiceResponse <DatabaseInstanceInfo>());
                }
                else
                {
                    IEnumerable <DatabaseInstanceInfo>     data   = databases.Select(x => ConvertToModel(serverInstanceInfo, x));
                    ServiceResponse <DatabaseInstanceInfo> result = new ServiceResponse <DatabaseInstanceInfo>(data);
                    foreach (var databaseInstance in result.Data)
                    {
                        if (cancellationToken.IsCancellationRequested)
                        {
                            break;
                        }
                        OnDatabaseFound(databaseInstance);
                    }

                    return(result);
                }
            }
            catch (Exception ex)
            {
                return(new ServiceResponse <DatabaseInstanceInfo>(ex));
            }
        }