Beispiel #1
0
        public async Task Execute(string odsInstanceName, CloudOdsClaimSet claimSet, ApiMode apiMode)
        {
            var odsSqlConfiguration = await _odsSecretConfigurationProvider.GetSqlConfiguration();

            var cloudOdsInstance = await _getCloudOdsInstanceQuery.Execute(odsInstanceName);

            var firstTimeSetupConfiguration = await GetFirstTimeSetupConfiguration(cloudOdsInstance, claimSet, odsSqlConfiguration);

            SetupAndRuntimeConfigurations(firstTimeSetupConfiguration);

            if (apiMode.SupportsSingleInstance)
            {
                var defaultOdsInstance = new OdsInstanceRegistration
                {
                    Name        = odsInstanceName,
                    Description = "Default single ods instance"
                };
                await _odsInstanceFirstTimeSetupService.CompleteSetup(defaultOdsInstance, claimSet, apiMode);
            }

            CreateClaimSetForAdminApp(firstTimeSetupConfiguration.ClaimSet);

            ApplyAdditionalClaimSetModifications();

            await _usersContext.SaveChangesAsync();

            await _securityContext.SaveChangesAsync();

            await _restartAppServicesCommand.Execute(new CloudOdsApiOperationContext(cloudOdsInstance));
        }
        public async Task Execute(string odsInstanceName)
        {
            var defaultInstance = await _getCloudOdsInstanceQuery.Execute(odsInstanceName);

            var configuration = new OdsPostUpdateSetupConfiguration
            {
                Instance = defaultInstance
            };

            //in the Azure Cloud ODS implementation we don't actually have access to the SQL Server
            //so this command stamps the correct version in the Admin database, based on the version
            //number that was set in the Azure Resource Group tags during the upgrade operation

            var instance = await _usersContext.OdsInstances.Include(i => i.OdsInstanceComponents).SingleOrDefaultAsync(i => i.Name == configuration.Instance.FriendlyName);

            instance.Version = configuration.Instance.Version;

            foreach (var component in instance.OdsInstanceComponents)
            {
                component.Version = configuration.Instance.Version;
            }

            _learningStandardsSetup.SetupLearningStandardsClaims();

            _assessmentVendorAdjustment.ReadAndCreatePerformanceLevelDescriptors();

            await _usersContext.SaveChangesAsync();

            await _restartAppServicesCommand.Execute(new CloudOdsApiOperationContext(defaultInstance, CloudOdsEnvironment.Production));
        }