@@ -66,7 +66,17 @@ Creates the test environment needed to perform the Sql auditing tests
66
66
function Create-AuditingTestEnvironment ($testSuffix , $location = " West Central US" , $serverVersion = " 12.0" )
67
67
{
68
68
$params = Get-SqlAuditingTestEnvironmentParameters $testSuffix
69
- Create- TestEnvironmentWithParams $params $location $serverVersion
69
+ Create- TestEnvironmentWithParams $params $location $serverVersion
70
+ }
71
+
72
+ <#
73
+ . SYNOPSIS
74
+ Creates the test environment needed to perform the Sql auditing tests with classic storage
75
+ #>
76
+ function Create-AuditingClassicTestEnvironment ($testSuffix , $location = " West Central US" , $serverVersion = " 12.0" )
77
+ {
78
+ $params = Get-SqlAuditingTestEnvironmentParameters $testSuffix
79
+ Create- ClassicTestEnvironmentWithParams $params $location $serverVersion
70
80
}
71
81
72
82
<#
@@ -76,7 +86,17 @@ Creates the test environment needed to perform the Sql threat detecion tests
76
86
function Create-ThreatDetectionTestEnvironment ($testSuffix , $location = " West Central US" , $serverVersion = " 12.0" )
77
87
{
78
88
$params = Get-SqlThreatDetectionTestEnvironmentParameters $testSuffix
79
- Create- TestEnvironmentWithParams $params $location $serverVersion
89
+ Create- TestEnvironmentWithParams $params $location $serverVersion
90
+ }
91
+
92
+ <#
93
+ . SYNOPSIS
94
+ Creates the test environment needed to perform the Sql threat detecion tests with classic storage
95
+ #>
96
+ function Create-ThreatDetectionClassicTestEnvironment ($testSuffix , $location = " West Central US" , $serverVersion = " 12.0" )
97
+ {
98
+ $params = Get-SqlThreatDetectionTestEnvironmentParameters $testSuffix
99
+ Create- ClassicTestEnvironmentWithParams $params $location $serverVersion
80
100
}
81
101
82
102
<#
@@ -85,16 +105,33 @@ Creates the test environment needed to perform the Sql auditing tests
85
105
#>
86
106
function Create-TestEnvironmentWithParams ($params , $location , $serverVersion )
87
107
{
88
- New-AzureRmResourceGroup - Name $params.rgname - Location $location
108
+ Create- BasicTestEnvironmentWithParams $params $location $serverVersion
109
+ New-AzureRmStorageAccount - StorageAccountName $params.storageAccount - ResourceGroupName $params.rgname - Location $location - Type Standard_GRS
110
+ }
89
111
90
- New-AzureRmStorageAccount - StorageAccountName $params.storageAccount - ResourceGroupName $params.rgname - Location $location - Type Standard_GRS
91
-
112
+ <#
113
+ . SYNOPSIS
114
+ Creates the test environment needed to perform the Sql auditing tests
115
+ #>
116
+ function Create-ClassicTestEnvironmentWithParams ($params , $location , $serverVersion )
117
+ {
118
+ Create- BasicTestEnvironmentWithParams $params $location $serverVersion
119
+ New-AzureRmResource - ResourceName $params.storageAccount - ResourceGroupName $params.rgname - ResourceType " Microsoft.ClassicStorage/StorageAccounts" - Location $location - Properties @ { AccountType = " Standard_GRS" } - ApiVersion " 2014-06-01" - Force
120
+ }
121
+
122
+ <#
123
+ . SYNOPSIS
124
+ Creates the basic test environment needed to perform the Sql data security tests - resource group, server and database
125
+ #>
126
+ function Create-BasicTestEnvironmentWithParams ($params , $location , $serverVersion )
127
+ {
128
+ New-AzureRmResourceGroup - Name $params.rgname - Location $location
92
129
$serverName = $params.serverName
93
130
$serverLogin = " testusername"
94
131
$serverPassword = " t357ingP@s5w0rd!Sec"
95
132
$credentials = new-object System.Management.Automation.PSCredential($serverLogin , ($serverPassword | ConvertTo-SecureString - asPlainText - Force))
96
- New-AzureRmSqlServer - ResourceGroupName $params.rgname - ServerName $params.serverName - Location $location - ServerVersion $serverVersion - SqlAdministratorCredentials $credentials
97
- New-AzureRmSqlDatabase - DatabaseName $params.databaseName - ResourceGroupName $params.rgname - ServerName $params.serverName - Edition Basic
133
+ New-AzureRmSqlServer - ResourceGroupName $params.rgname - ServerName $params.serverName - Location $location - ServerVersion $serverVersion - SqlAdministratorCredentials $credentials
134
+ New-AzureRmSqlDatabase - DatabaseName $params.databaseName - ResourceGroupName $params.rgname - ServerName $params.serverName - Edition Basic
98
135
}
99
136
100
137
<#
0 commit comments