@@ -38,7 +38,7 @@ function Test-DataLakeAnalyticsAccount
38
38
for ($i = 0 ; $i -le 60 ; $i ++ )
39
39
{
40
40
[array ]$accountGet = Get-AdlAnalyticsAccount - ResourceGroupName $resourceGroupName - Name $accountName
41
- if ($accountGet [0 ].Properties. ProvisioningState -like " Succeeded" )
41
+ if ($accountGet [0 ].ProvisioningState -like " Succeeded" )
42
42
{
43
43
Assert-AreEqual $accountName $accountGet [0 ].Name
44
44
Assert-AreEqual $location $accountGet [0 ].Location
@@ -47,7 +47,7 @@ function Test-DataLakeAnalyticsAccount
47
47
break
48
48
}
49
49
50
- Write-Host " account not yet provisioned. current state: $ ( $accountGet [0 ].Properties. ProvisioningState) "
50
+ Write-Host " account not yet provisioned. current state: $ ( $accountGet [0 ].ProvisioningState) "
51
51
[Microsoft.Rest.ClientRuntime.Azure.TestFramework.TestUtilities ]::Wait(30000 )
52
52
Assert-False {$i -eq 60 } " dataLakeAnalytics account is not in succeeded state even after 30 min."
53
53
}
@@ -111,7 +111,7 @@ function Test-DataLakeAnalyticsAccount
111
111
112
112
# get the account and ensure that it contains two data lake stores
113
113
$testStoreAdd = Get-AdlAnalyticsAccount - Name $accountName
114
- Assert-AreEqual 2 $testStoreAdd.Properties. DataLakeStoreAccounts.Count
114
+ Assert-AreEqual 2 $testStoreAdd.DataLakeStoreAccounts.Count
115
115
116
116
# get the specific data source added
117
117
$adlsAccountInfo = Get-AdlAnalyticsDataSource - Account $accountName - DataLakeStore $secondDataLakeAccountName
@@ -126,14 +126,14 @@ function Test-DataLakeAnalyticsAccount
126
126
127
127
# get the account and ensure that it contains one data lake store
128
128
$testStoreAdd = Get-AdlAnalyticsAccount - Name $accountName
129
- Assert-AreEqual 1 $testStoreAdd.Properties. DataLakeStoreAccounts.Count
129
+ Assert-AreEqual 1 $testStoreAdd.DataLakeStoreAccounts.Count
130
130
131
131
# add a blob account to the analytics account
132
132
Add-AdlAnalyticsDataSource - Account $accountName - Blob $blobAccountName - AccessKey $blobAccountKey
133
133
134
134
# get the account and ensure that it contains one blob account
135
135
$testStoreAdd = Get-AdlAnalyticsAccount - Name $accountName
136
- Assert-AreEqual 1 $testStoreAdd.Properties. StorageAccounts.Count
136
+ Assert-AreEqual 1 $testStoreAdd.StorageAccounts.Count
137
137
138
138
# get the specific data source added
139
139
$blobAccountInfo = Get-AdlAnalyticsDataSource - Account $accountName - Blob $blobAccountName
@@ -148,7 +148,7 @@ function Test-DataLakeAnalyticsAccount
148
148
149
149
# get the account and ensure that it contains no azure storage accounts
150
150
$testStoreAdd = Get-AdlAnalyticsAccount - Name $accountName
151
- Assert-True {$testStoreAdd.Properties. StorageAccounts -eq $null -or $testStoreAdd.Properties .StorageAccounts.Count -eq 0 } " Remove blob storage reported success but failed to remove the account."
151
+ Assert-True {$testStoreAdd.StorageAccounts -eq $null -or $testStoreAdd.StorageAccounts.Count -eq 0 } " Remove blob storage reported success but failed to remove the account."
152
152
153
153
# Delete dataLakeAnalytics account
154
154
Assert-True {Remove-AdlAnalyticsAccount - ResourceGroupName $resourceGroupName - Name $accountName - Force - PassThru} " Remove Account failed."
@@ -167,6 +167,60 @@ function Test-DataLakeAnalyticsAccount
167
167
}
168
168
169
169
170
+ <#
171
+ . SYNOPSIS
172
+ Tests DataLakeAnalytics Account commitment tier (Create, Update, Get).
173
+ #>
174
+ function Test-DataLakeAnalyticsAccountTiers
175
+ {
176
+ param
177
+ (
178
+ $resourceGroupName = (Get-ResourceGroupName ),
179
+ $accountName = (Get-DataLakeAnalyticsAccountName ),
180
+ $dataLakeAccountName = (Get-DataLakeStoreAccountName ),
181
+ $location = " West US"
182
+ )
183
+
184
+ try
185
+ {
186
+ # Creating Account and initial setup
187
+ New-AzureRmResourceGroup - Name $resourceGroupName - Location $location
188
+
189
+ # Test to make sure the account doesn't exist
190
+ Assert-False {Test-AdlAnalyticsAccount - ResourceGroupName $resourceGroupName - Name $accountName }
191
+ # Test it without specifying a resource group
192
+ Assert-False {Test-AdlAnalyticsAccount - Name $accountName }
193
+
194
+ New-AdlStore - ResourceGroupName $resourceGroupName - Name $dataLakeAccountName - Location $location
195
+
196
+ # Test 1: create account with no pricing tier and validate default
197
+ $accountCreated = New-AdlAnalyticsAccount - ResourceGroupName $resourceGroupName - Name $accountName - Location $location - DefaultDataLakeStore $dataLakeAccountName
198
+
199
+ Assert-AreEqual " Consumption" $accountCreated.CurrentTier
200
+ Assert-AreEqual " Consumption" $accountCreated.NewTier
201
+
202
+ # Test 2: update this account to have a new pricing tier
203
+ $accountUpdated = Set-AdlAnalyticsAccount - ResourceGroupName $resourceGroupName - Name $accountName - Tier Commitment100AUHours
204
+
205
+ Assert-AreEqual " Consumption" $accountUpdated.CurrentTier
206
+ Assert-AreEqual " Commitment100AUHours" $accountUpdated.NewTier
207
+
208
+ # Test 3: Create a new account with a tier specified
209
+ $secondAccountName = (Get-DataLakeAnalyticsAccountName )
210
+ $accountCreated = New-AdlAnalyticsAccount - ResourceGroupName $resourceGroupName - Name $secondAccountName - Location $location - DefaultDataLakeStore $dataLakeAccountName - Tier Commitment100AUHours
211
+ Assert-AreEqual " Commitment100AUHours" $accountCreated.CurrentTier
212
+ Assert-AreEqual " Commitment100AUHours" $accountCreated.NewTier
213
+ }
214
+ finally
215
+ {
216
+ # cleanup the resource group that was used in case it still exists. This is a best effort task, we ignore failures here.
217
+ Invoke-HandledCmdlet - Command {Remove-AdlAnalyticsAccount - ResourceGroupName $resourceGroupName - Name $accountName - Force - ErrorAction SilentlyContinue} - IgnoreFailures
218
+ Invoke-HandledCmdlet - Command {Remove-AdlAnalyticsAccount - ResourceGroupName $resourceGroupName - Name $secondAccountName - Force - ErrorAction SilentlyContinue} - IgnoreFailures
219
+ Invoke-HandledCmdlet - Command {Remove-AdlStore - ResourceGroupName $resourceGroupName - Name $dataLakeAccountName - Force - ErrorAction SilentlyContinue} - IgnoreFailures
220
+ Invoke-HandledCmdlet - Command {Remove-AzureRmResourceGroup - Name $resourceGroupName - Force - ErrorAction SilentlyContinue} - IgnoreFailures
221
+ }
222
+ }
223
+
170
224
<#
171
225
. SYNOPSIS
172
226
Tests DataLakeAnalytics Job Lifecycle (Submit, Get, List, Cancel and Get Debug data).
@@ -186,7 +240,7 @@ function Test-DataLakeAnalyticsJob
186
240
New-AzureRmResourceGroup - Name $resourceGroupName - Location $location
187
241
New-AdlStore - ResourceGroupName $resourceGroupName - Name $dataLakeAccountName - Location $location
188
242
$accountCreated = New-AdlAnalyticsAccount - ResourceGroupName $resourceGroupName - Name $accountName - Location $location - DefaultDataLakeStore $dataLakeAccountName
189
- $nowTime = $accountCreated.Properties. CreationTime
243
+ $nowTime = $accountCreated.CreationTime
190
244
Assert-AreEqual $accountName $accountCreated.Name
191
245
Assert-AreEqual $location $accountCreated.Location
192
246
Assert-AreEqual " Microsoft.DataLakeAnalytics/accounts" $accountCreated.Type
@@ -196,7 +250,7 @@ function Test-DataLakeAnalyticsJob
196
250
for ($i = 0 ; $i -le 60 ; $i ++ )
197
251
{
198
252
[array ]$accountGet = Get-AdlAnalyticsAccount - ResourceGroupName $resourceGroupName - Name $accountName
199
- if ($accountGet [0 ].Properties. ProvisioningState -like " Succeeded" )
253
+ if ($accountGet [0 ].ProvisioningState -like " Succeeded" )
200
254
{
201
255
Assert-AreEqual $accountName $accountGet [0 ].Name
202
256
Assert-AreEqual $location $accountGet [0 ].Location
@@ -205,7 +259,7 @@ function Test-DataLakeAnalyticsJob
205
259
break
206
260
}
207
261
208
- Write-Host " account not yet provisioned. current state: $ ( $accountGet [0 ].Properties. ProvisioningState) "
262
+ Write-Host " account not yet provisioned. current state: $ ( $accountGet [0 ].ProvisioningState) "
209
263
[Microsoft.Rest.ClientRuntime.Azure.TestFramework.TestUtilities ]::Wait(30000 )
210
264
Assert-False {$i -eq 60 } " dataLakeAnalytics accounts not in succeeded state even after 30 min."
211
265
}
@@ -288,7 +342,7 @@ function Test-NegativeDataLakeAnalyticsAccount
288
342
for ($i = 0 ; $i -le 60 ; $i ++ )
289
343
{
290
344
[array ]$accountGet = Get-AdlAnalyticsAccount - ResourceGroupName $resourceGroupName - Name $accountName
291
- if ($accountGet [0 ].Properties. ProvisioningState -like " Succeeded" )
345
+ if ($accountGet [0 ].ProvisioningState -like " Succeeded" )
292
346
{
293
347
Assert-AreEqual $accountName $accountGet [0 ].Name
294
348
Assert-AreEqual $location $accountGet [0 ].Location
@@ -297,7 +351,7 @@ function Test-NegativeDataLakeAnalyticsAccount
297
351
break
298
352
}
299
353
300
- Write-Host " account not yet provisioned. current state: $ ( $accountGet [0 ].Properties. ProvisioningState) "
354
+ Write-Host " account not yet provisioned. current state: $ ( $accountGet [0 ].ProvisioningState) "
301
355
[Microsoft.Rest.ClientRuntime.Azure.TestFramework.TestUtilities ]::Wait(30000 )
302
356
Assert-False {$i -eq 60 } " dataLakeAnalytics accounts not in succeeded state even after 30 min."
303
357
}
@@ -351,7 +405,7 @@ function Test-NegativeDataLakeAnalyticsJob
351
405
New-AzureRmResourceGroup - Name $resourceGroupName - Location $location
352
406
New-AdlStore - ResourceGroupName $resourceGroupName - Name $dataLakeAccountName - Location $location
353
407
$accountCreated = New-AdlAnalyticsAccount - ResourceGroupName $resourceGroupName - Name $accountName - Location $location - DefaultDataLakeStore $dataLakeAccountName
354
- $nowTime = $accountCreated.Properties. CreationTime
408
+ $nowTime = $accountCreated.CreationTime
355
409
Assert-AreEqual $accountName $accountCreated.Name
356
410
Assert-AreEqual $location $accountCreated.Location
357
411
Assert-AreEqual " Microsoft.DataLakeAnalytics/accounts" $accountCreated.Type
@@ -361,7 +415,7 @@ function Test-NegativeDataLakeAnalyticsJob
361
415
for ($i = 0 ; $i -le 60 ; $i ++ )
362
416
{
363
417
[array ]$accountGet = Get-AdlAnalyticsAccount - ResourceGroupName $resourceGroupName - Name $accountName
364
- if ($accountGet [0 ].Properties. ProvisioningState -like " Succeeded" )
418
+ if ($accountGet [0 ].ProvisioningState -like " Succeeded" )
365
419
{
366
420
Assert-AreEqual $accountName $accountGet [0 ].Name
367
421
Assert-AreEqual $location $accountGet [0 ].Location
@@ -370,7 +424,7 @@ function Test-NegativeDataLakeAnalyticsJob
370
424
break
371
425
}
372
426
373
- Write-Host " account not yet provisioned. current state: $ ( $accountGet [0 ].Properties. ProvisioningState) "
427
+ Write-Host " account not yet provisioned. current state: $ ( $accountGet [0 ].ProvisioningState) "
374
428
[Microsoft.Rest.ClientRuntime.Azure.TestFramework.TestUtilities ]::Wait(30000 )
375
429
Assert-False {$i -eq 60 } " dataLakeAnalytics accounts not in succeeded state even after 30 min."
376
430
}
@@ -441,7 +495,7 @@ function Test-DataLakeAnalyticsCatalog
441
495
for ($i = 0 ; $i -le 60 ; $i ++ )
442
496
{
443
497
[array ]$accountGet = Get-AdlAnalyticsAccount - ResourceGroupName $resourceGroupName - Name $accountName
444
- if ($accountGet [0 ].Properties. ProvisioningState -like " Succeeded" )
498
+ if ($accountGet [0 ].ProvisioningState -like " Succeeded" )
445
499
{
446
500
Assert-AreEqual $accountName $accountGet [0 ].Name
447
501
Assert-AreEqual $location $accountGet [0 ].Location
@@ -450,7 +504,7 @@ function Test-DataLakeAnalyticsCatalog
450
504
break
451
505
}
452
506
453
- Write-Host " account not yet provisioned. current state: $ ( $accountGet [0 ].Properties. ProvisioningState) "
507
+ Write-Host " account not yet provisioned. current state: $ ( $accountGet [0 ].ProvisioningState) "
454
508
[Microsoft.Rest.ClientRuntime.Azure.TestFramework.TestUtilities ]::Wait(30000 )
455
509
Assert-False {$i -eq 60 } " dataLakeAnalytics accounts not in succeeded state even after 30 min."
456
510
}
0 commit comments