public override void Pre_CreateOrUpgradeSession() { NormalizeWindowsUser(); var elevated = (IElevatedUserConfiguration)sessionConfiguration; var masterElevated = ConfigurationManagerUtils.ConfigurationToMaster(elevated); var runtimeElevated = (RuntimeDatabaseConfiguration)elevated.ElevatedRuntimeDatabaseConfiguration(); bool isAzureDB = ConfigurationManagerUtils.IsDatabaseAzure(masterElevated); if (isAzureDB) { // On the unlikely scenario of an on-premise installation with Azure SQL, // we try to minimise the chance of timeouts. ConfigurationManagerUtils.QueryTimeout = 300; } ConfigurationManagerUtils.CheckIfUserHasNecessaryElevatedPermissions(masterElevated); if (!isAzureDB) { ConfigurationManagerUtils.CreateSqlServerCatalogIfDoesntExist(masterElevated, runtimeElevated.Catalog); } else { // We will not support automatically creating Azure databases. // An appropriate message is displayed. ConfigurationManagerUtils.CheckIfAzureDatabaseExists(masterElevated, runtimeElevated.Catalog); } // Prepare statements PreProcessedStatements.Add(ConfigurationManagerUtils.GrantSessionUserPermissions( (SessionDatabaseConfiguration)sessionConfiguration, (PlatformDatabaseConfiguration)platformConfiguration)); // Azure does not support changing the recovery model if (!isAzureDB) { try { // Set database recovery model to Simple ConfigurationManagerUtils.SetRecoveryModel(masterElevated, runtimeElevated.Catalog, "Simple"); } catch (Exception exception) { throw new ConfigurationOperationException("After the Configuration Tool closes, you must set the '" + runtimeElevated.Catalog + "' database recovery model to simple.", exception); } } }