Skip to content

Commit b9cc8ee

Browse files
authored
Merge pull request #3363 from begoldsm/dev
ADL Updates for Jan release
2 parents abd428c + 02a88c9 commit b9cc8ee

File tree

120 files changed

+26124
-18126
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+26124
-18126
lines changed

src/Common/Commands.Common/GeneralUtilities.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ public static class GeneralUtilities
3838

3939
private static List<string> AuthorizationHeaderNames = new List<string>() { "Authorization" };
4040

41+
// this is only used to determine cutoff for streams (not xml or json).
42+
private const int StreamCutOffSize = 10 * 1024; //10KB
43+
4144
private static bool TryFindCertificatesInStore(string thumbprint,
4245
System.Security.Cryptography.X509Certificates.StoreLocation location, out X509Certificate2Collection certificates)
4346
{
@@ -318,7 +321,9 @@ public static string FormatString(string content)
318321
}
319322
else
320323
{
321-
return content;
324+
return content.Length <= GeneralUtilities.StreamCutOffSize ?
325+
content :
326+
content.Substring(0, StreamCutOffSize) + "\r\nDATA TRUNCATED DUE TO SIZE\r\n";
322327
}
323328
}
324329

src/ResourceManager/DataLakeAnalytics/ChangeLog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818
- Additional information about change #1
1919
-->
2020
## Current Release
21+
* Update Get-AdlJob to support Top parameter
22+
* Update Get-AdlJob to return the list of jobs in order by most recently submitted
23+
* Updated help for all cmdlets to include output as well as more descriptions of parameters and the inclusion of aliases.
24+
* Update New-AdlAnalyticsAccount and Set-AdlAnalyticsAccount to support commitment tier options for the service.
25+
* Added OutputType mismatch warnings to all cmdlets with incorrect OutputType attributes. These will be fixed in a future breaking change release.
2126

2227
## Version 2.4.0
2328
* Removal of unsupported parameters in Add and Set-AzureRMDataLakeAnalyticsDataSource (default for data lake store)

src/ResourceManager/DataLakeAnalytics/Commands.DataLakeAnalytics.Test/Commands.DataLakeAnalytics.Test.csproj

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,14 @@
6262
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Authorization.2.0.0\lib\net40\Microsoft.Azure.Management.Authorization.dll</HintPath>
6363
<Private>True</Private>
6464
</Reference>
65-
<Reference Include="Microsoft.Azure.Management.DataLake.Analytics">
66-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.DataLake.Analytics.1.0.1-preview\lib\net45\Microsoft.Azure.Management.DataLake.Analytics.dll</HintPath>
65+
<Reference Include="Microsoft.Azure.Management.DataLake.Analytics, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
66+
<SpecificVersion>False</SpecificVersion>
67+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.DataLake.Analytics.2.0.0\lib\net45\Microsoft.Azure.Management.DataLake.Analytics.dll</HintPath>
6768
<Private>True</Private>
6869
</Reference>
6970
<Reference Include="Microsoft.Azure.Management.DataLake.Store, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
7071
<SpecificVersion>False</SpecificVersion>
71-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.DataLake.Store.1.0.2-preview\lib\net45\Microsoft.Azure.Management.DataLake.Store.dll</HintPath>
72+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.DataLake.Store.1.0.3\lib\net45\Microsoft.Azure.Management.DataLake.Store.dll</HintPath>
7273
<Private>True</Private>
7374
</Reference>
7475
<Reference Include="Microsoft.Azure.Management.ResourceManager, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
@@ -115,9 +116,9 @@
115116
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.Authentication.2.2.9-preview\lib\net45\Microsoft.Rest.ClientRuntime.Azure.Authentication.dll</HintPath>
116117
<Private>True</Private>
117118
</Reference>
118-
<Reference Include="Microsoft.Rest.ClientRuntime.Azure.TestFramework">
119+
<Reference Include="Microsoft.Rest.ClientRuntime.Azure.TestFramework, Version=1.5.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
119120
<SpecificVersion>False</SpecificVersion>
120-
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.TestFramework.1.3.6-preview\lib\net45\Microsoft.Rest.ClientRuntime.Azure.TestFramework.dll</HintPath>
121+
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.TestFramework.1.5.1-preview\lib\net45\Microsoft.Rest.ClientRuntime.Azure.TestFramework.dll</HintPath>
121122
<Private>True</Private>
122123
</Reference>
123124
<Reference Include="Microsoft.Threading.Tasks, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
@@ -223,6 +224,9 @@
223224
<None Include="SessionRecords\Microsoft.Azure.Commands.DataLakeAnalytics.Test.ScenarioTests.AdlaAliasTests\TestAdlaAccount.json">
224225
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
225226
</None>
227+
<None Include="SessionRecords\Microsoft.Azure.Commands.DataLakeAnalytics.Test.ScenarioTests.AdlaAliasTests\TestAdlaAccountTiers.json">
228+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
229+
</None>
226230
<None Include="SessionRecords\Microsoft.Azure.Commands.DataLakeAnalytics.Test.ScenarioTests.AdlaAliasTests\TestAdlaCatalog.json">
227231
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
228232
</None>
@@ -238,6 +242,9 @@
238242
<None Include="SessionRecords\Microsoft.Azure.Commands.DataLakeAnalytics.Test.ScenarioTests.AdlaTests\TestAdlaAccount.json">
239243
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
240244
</None>
245+
<None Include="SessionRecords\Microsoft.Azure.Commands.DataLakeAnalytics.Test.ScenarioTests.AdlaTests\TestAdlaAccountTiers.json">
246+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
247+
</None>
241248
<None Include="SessionRecords\Microsoft.Azure.Commands.DataLakeAnalytics.Test.ScenarioTests.AdlaTests\TestAdlaCatalog.json">
242249
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
243250
</None>

src/ResourceManager/DataLakeAnalytics/Commands.DataLakeAnalytics.Test/ScenarioTests/AdlaAliasTests.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,16 @@ public void TestAdlaAccount()
3434
AdlaTestsBase.resourceGroupLocation));
3535
}
3636

37+
[Fact]
38+
[Trait(Category.AcceptanceType, Category.CheckIn)]
39+
public void TestAdlaAccountTiers()
40+
{
41+
AdlaTestsBase.NewInstance.RunPsTest(true,
42+
string.Format(
43+
"Test-DataLakeAnalyticsAccountTiers -location '{0}'",
44+
AdlaTestsBase.resourceGroupLocation));
45+
}
46+
3747
[Fact]
3848
[Trait(Category.AcceptanceType, Category.CheckIn)]
3949
public void TestAdlaCatalog()

src/ResourceManager/DataLakeAnalytics/Commands.DataLakeAnalytics.Test/ScenarioTests/AdlaAliasTests.ps1

Lines changed: 70 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function Test-DataLakeAnalyticsAccount
3838
for ($i = 0; $i -le 60; $i++)
3939
{
4040
[array]$accountGet = Get-AdlAnalyticsAccount -ResourceGroupName $resourceGroupName -Name $accountName
41-
if ($accountGet[0].Properties.ProvisioningState -like "Succeeded")
41+
if ($accountGet[0].ProvisioningState -like "Succeeded")
4242
{
4343
Assert-AreEqual $accountName $accountGet[0].Name
4444
Assert-AreEqual $location $accountGet[0].Location
@@ -47,7 +47,7 @@ function Test-DataLakeAnalyticsAccount
4747
break
4848
}
4949

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)"
5151
[Microsoft.Rest.ClientRuntime.Azure.TestFramework.TestUtilities]::Wait(30000)
5252
Assert-False {$i -eq 60} "dataLakeAnalytics account is not in succeeded state even after 30 min."
5353
}
@@ -111,7 +111,7 @@ function Test-DataLakeAnalyticsAccount
111111

112112
# get the account and ensure that it contains two data lake stores
113113
$testStoreAdd = Get-AdlAnalyticsAccount -Name $accountName
114-
Assert-AreEqual 2 $testStoreAdd.Properties.DataLakeStoreAccounts.Count
114+
Assert-AreEqual 2 $testStoreAdd.DataLakeStoreAccounts.Count
115115

116116
# get the specific data source added
117117
$adlsAccountInfo = Get-AdlAnalyticsDataSource -Account $accountName -DataLakeStore $secondDataLakeAccountName
@@ -126,14 +126,14 @@ function Test-DataLakeAnalyticsAccount
126126

127127
# get the account and ensure that it contains one data lake store
128128
$testStoreAdd = Get-AdlAnalyticsAccount -Name $accountName
129-
Assert-AreEqual 1 $testStoreAdd.Properties.DataLakeStoreAccounts.Count
129+
Assert-AreEqual 1 $testStoreAdd.DataLakeStoreAccounts.Count
130130

131131
# add a blob account to the analytics account
132132
Add-AdlAnalyticsDataSource -Account $accountName -Blob $blobAccountName -AccessKey $blobAccountKey
133133

134134
# get the account and ensure that it contains one blob account
135135
$testStoreAdd = Get-AdlAnalyticsAccount -Name $accountName
136-
Assert-AreEqual 1 $testStoreAdd.Properties.StorageAccounts.Count
136+
Assert-AreEqual 1 $testStoreAdd.StorageAccounts.Count
137137

138138
# get the specific data source added
139139
$blobAccountInfo = Get-AdlAnalyticsDataSource -Account $accountName -Blob $blobAccountName
@@ -148,7 +148,7 @@ function Test-DataLakeAnalyticsAccount
148148

149149
# get the account and ensure that it contains no azure storage accounts
150150
$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."
152152

153153
# Delete dataLakeAnalytics account
154154
Assert-True {Remove-AdlAnalyticsAccount -ResourceGroupName $resourceGroupName -Name $accountName -Force -PassThru} "Remove Account failed."
@@ -167,6 +167,60 @@ function Test-DataLakeAnalyticsAccount
167167
}
168168

169169

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+
170224
<#
171225
.SYNOPSIS
172226
Tests DataLakeAnalytics Job Lifecycle (Submit, Get, List, Cancel and Get Debug data).
@@ -186,7 +240,7 @@ function Test-DataLakeAnalyticsJob
186240
New-AzureRmResourceGroup -Name $resourceGroupName -Location $location
187241
New-AdlStore -ResourceGroupName $resourceGroupName -Name $dataLakeAccountName -Location $location
188242
$accountCreated = New-AdlAnalyticsAccount -ResourceGroupName $resourceGroupName -Name $accountName -Location $location -DefaultDataLakeStore $dataLakeAccountName
189-
$nowTime = $accountCreated.Properties.CreationTime
243+
$nowTime = $accountCreated.CreationTime
190244
Assert-AreEqual $accountName $accountCreated.Name
191245
Assert-AreEqual $location $accountCreated.Location
192246
Assert-AreEqual "Microsoft.DataLakeAnalytics/accounts" $accountCreated.Type
@@ -196,7 +250,7 @@ function Test-DataLakeAnalyticsJob
196250
for ($i = 0; $i -le 60; $i++)
197251
{
198252
[array]$accountGet = Get-AdlAnalyticsAccount -ResourceGroupName $resourceGroupName -Name $accountName
199-
if ($accountGet[0].Properties.ProvisioningState -like "Succeeded")
253+
if ($accountGet[0].ProvisioningState -like "Succeeded")
200254
{
201255
Assert-AreEqual $accountName $accountGet[0].Name
202256
Assert-AreEqual $location $accountGet[0].Location
@@ -205,7 +259,7 @@ function Test-DataLakeAnalyticsJob
205259
break
206260
}
207261

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)"
209263
[Microsoft.Rest.ClientRuntime.Azure.TestFramework.TestUtilities]::Wait(30000)
210264
Assert-False {$i -eq 60} "dataLakeAnalytics accounts not in succeeded state even after 30 min."
211265
}
@@ -288,7 +342,7 @@ function Test-NegativeDataLakeAnalyticsAccount
288342
for ($i = 0; $i -le 60; $i++)
289343
{
290344
[array]$accountGet = Get-AdlAnalyticsAccount -ResourceGroupName $resourceGroupName -Name $accountName
291-
if ($accountGet[0].Properties.ProvisioningState -like "Succeeded")
345+
if ($accountGet[0].ProvisioningState -like "Succeeded")
292346
{
293347
Assert-AreEqual $accountName $accountGet[0].Name
294348
Assert-AreEqual $location $accountGet[0].Location
@@ -297,7 +351,7 @@ function Test-NegativeDataLakeAnalyticsAccount
297351
break
298352
}
299353

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)"
301355
[Microsoft.Rest.ClientRuntime.Azure.TestFramework.TestUtilities]::Wait(30000)
302356
Assert-False {$i -eq 60} "dataLakeAnalytics accounts not in succeeded state even after 30 min."
303357
}
@@ -351,7 +405,7 @@ function Test-NegativeDataLakeAnalyticsJob
351405
New-AzureRmResourceGroup -Name $resourceGroupName -Location $location
352406
New-AdlStore -ResourceGroupName $resourceGroupName -Name $dataLakeAccountName -Location $location
353407
$accountCreated = New-AdlAnalyticsAccount -ResourceGroupName $resourceGroupName -Name $accountName -Location $location -DefaultDataLakeStore $dataLakeAccountName
354-
$nowTime = $accountCreated.Properties.CreationTime
408+
$nowTime = $accountCreated.CreationTime
355409
Assert-AreEqual $accountName $accountCreated.Name
356410
Assert-AreEqual $location $accountCreated.Location
357411
Assert-AreEqual "Microsoft.DataLakeAnalytics/accounts" $accountCreated.Type
@@ -361,7 +415,7 @@ function Test-NegativeDataLakeAnalyticsJob
361415
for ($i = 0; $i -le 60; $i++)
362416
{
363417
[array]$accountGet = Get-AdlAnalyticsAccount -ResourceGroupName $resourceGroupName -Name $accountName
364-
if ($accountGet[0].Properties.ProvisioningState -like "Succeeded")
418+
if ($accountGet[0].ProvisioningState -like "Succeeded")
365419
{
366420
Assert-AreEqual $accountName $accountGet[0].Name
367421
Assert-AreEqual $location $accountGet[0].Location
@@ -370,7 +424,7 @@ function Test-NegativeDataLakeAnalyticsJob
370424
break
371425
}
372426

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)"
374428
[Microsoft.Rest.ClientRuntime.Azure.TestFramework.TestUtilities]::Wait(30000)
375429
Assert-False {$i -eq 60} "dataLakeAnalytics accounts not in succeeded state even after 30 min."
376430
}
@@ -441,7 +495,7 @@ function Test-DataLakeAnalyticsCatalog
441495
for ($i = 0; $i -le 60; $i++)
442496
{
443497
[array]$accountGet = Get-AdlAnalyticsAccount -ResourceGroupName $resourceGroupName -Name $accountName
444-
if ($accountGet[0].Properties.ProvisioningState -like "Succeeded")
498+
if ($accountGet[0].ProvisioningState -like "Succeeded")
445499
{
446500
Assert-AreEqual $accountName $accountGet[0].Name
447501
Assert-AreEqual $location $accountGet[0].Location
@@ -450,7 +504,7 @@ function Test-DataLakeAnalyticsCatalog
450504
break
451505
}
452506

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)"
454508
[Microsoft.Rest.ClientRuntime.Azure.TestFramework.TestUtilities]::Wait(30000)
455509
Assert-False {$i -eq 60} "dataLakeAnalytics accounts not in succeeded state even after 30 min."
456510
}

src/ResourceManager/DataLakeAnalytics/Commands.DataLakeAnalytics.Test/ScenarioTests/AdlaTests.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,16 @@ public void TestAdlaAccount()
3434
AdlaTestsBase.resourceGroupLocation));
3535
}
3636

37+
[Fact]
38+
[Trait(Category.AcceptanceType, Category.CheckIn)]
39+
public void TestAdlaAccountTiers()
40+
{
41+
AdlaTestsBase.NewInstance.RunPsTest(true,
42+
string.Format(
43+
"Test-DataLakeAnalyticsAccountTiers -location '{0}'",
44+
AdlaTestsBase.resourceGroupLocation));
45+
}
46+
3747
[Fact]
3848
[Trait(Category.AcceptanceType, Category.CheckIn)]
3949
public void TestAdlaCatalog()

0 commit comments

Comments
 (0)