Пример #1
0
        private static void CreateNewDatabase(IAzure azure, string serverId)
        {
            try
            {
                ISqlDatabase tenantDatabase = azure.SqlServers.GetById(serverId).Databases
                                              .Define(TenantParameters.GetFormattedShortName)
                                              .Create();

                MiscellaneousUtils.PrintDatabase(tenantDatabase);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #2
0
        private static void CreateNewDatabaseWithActiveDirectory(IAzure azure, string serverId)
        {
            try
            {
                IStorageAccount account        = azure.StorageAccounts.GetById(TenantParameters.StorageAccountId);
                ISqlDatabase    tenantDatabase = azure.SqlServers.GetById(serverId).Databases
                                                 .Define(TenantParameters.GetFormattedShortName)
                                                 .ImportFrom(account, TenantParameters.ContainerName, TenantParameters.TenantTemplateName)
                                                 .WithActiveDirectoryLoginAndPassword(UserCredentials.UserName, UserCredentials.Password)
                                                 .Create();

                MiscellaneousUtils.PrintDatabase(tenantDatabase);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }