Skip to content

Commit 6e761f2

Browse files
committed
Merge branch 'release-2018-04-06' of github.com:/azure/azure-powershell into netcore-011a
2 parents bd1c6a1 + 221534c commit 6e761f2

File tree

133 files changed

+14105
-6965
lines changed

Some content is hidden

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

133 files changed

+14105
-6965
lines changed

build.proj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@
254254

255255
<Message Importance="high" Text="Running Static Analyser" />
256256
<CallTarget targets="DependencyAnalysis" ContinueOnError="ErrorAndContinue" />
257-
<Exec Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot;. $(LibraryToolsFolder)\CheckAssemblies.ps1 &quot;" />
257+
<Exec Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot;. $(LibraryToolsFolder)\CheckAssemblies.ps1 -BuildConfig $(Configuration) &quot;" />
258258
<Exec Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot;. $(LibraryToolsFolder)\CleanupBuild.ps1 -BuildConfig $(Configuration) &quot;" />
259259
</Target>
260260

src/Common/Commands.Common.Authentication.Abstractions/AzureAccount.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,13 @@ public static class Property
128128
/// <summary>
129129
/// Backup login Uri for MSI
130130
/// </summary>
131-
MSILoginUriBackup = "MSILoginBackup";
131+
MSILoginUriBackup = "MSILoginBackup",
132132

133133

134+
/// <summary>
135+
/// Secret that may be used with MSI login
136+
/// </summary>
137+
MSILoginSecret = "MSILoginSecret";
134138
}
135139
}
136140
}

src/Common/Commands.Common.Authentication/Authentication/ManagedServiceAccessToken.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
using Microsoft.Rest.Azure;
1818
using System;
1919
using System.Collections.Generic;
20+
using System.Net.Http;
2021
using System.Text;
2122
using System.Threading;
2223

@@ -72,6 +73,10 @@ public ManagedServiceAccessToken(IAzureAccount account, IAzureEnvironment enviro
7273
}
7374

7475
_tokenGetter = factory.GetHttpOperations<ManagedServiceTokenInfo>(true).WithHeader("Metadata", new[] { "true" });
76+
if (account.IsPropertySet(AzureAccount.Property.MSILoginSecret))
77+
{
78+
_tokenGetter = _tokenGetter.WithHeader("Secret", new[] { account.GetProperty(AzureAccount.Property.MSILoginSecret) });
79+
}
7580
}
7681

7782
public string AccessToken
@@ -119,11 +124,12 @@ void GetOrRenewAuthentication()
119124
RequestUris.Clear();
120125
RequestUris.Enqueue(currentRequestUri);
121126
}
122-
catch (CloudException) when (RequestUris.Count > 0)
127+
catch (Exception e) when ( (e is CloudException || e is HttpRequestException) && RequestUris.Count > 0)
123128
{
124-
// do nothing
129+
// skip to the next uri
125130
}
126131
}
132+
127133
SetToken(info);
128134
}
129135
}

src/Common/Commands.Common/Extensions/CmdletExtensions.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,18 @@ public static void SafeCopyParameterSet<T>(this T source, T target) where T : Az
202202
}
203203
}
204204

205+
/// <summary>
206+
/// Return the value of a paramater, or null if not set
207+
/// </summary>
208+
/// <typeparam name="T"></typeparam>
209+
/// <param name="cmdlet">the executing cmdlet</param>
210+
/// <param name="parameterName">The name of the parameter to return</param>
211+
/// <returns>true if the parameter was provided by the user, otherwise false</returns>
212+
public static bool IsBound(this PSCmdlet cmdlet, string parameterName)
213+
{
214+
return cmdlet.MyInvocation.BoundParameters.ContainsKey(parameterName);
215+
}
216+
205217
public static string AsAbsoluteLocation(this string realtivePath)
206218
{
207219
return Path.GetFullPath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, realtivePath));

src/ResourceManager/Aks/AzureRM.Aks.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ CLRVersion = '4.0'
5151
# ProcessorArchitecture = ''
5252

5353
# Modules that must be imported into the global environment prior to importing this module
54-
RequiredModules = @(@{ModuleName = 'AzureRM.Profile'; ModuleVersion = '4.1.1'; })
54+
RequiredModules = @(@{ModuleName = 'AzureRM.Profile'; ModuleVersion = '4.5.0'; })
5555

5656
# Assemblies that must be loaded prior to importing this module
5757
RequiredAssemblies = '.\YamlDotNet.dll',

src/ResourceManager/Aks/NuGet.Config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<config>
4+
<add key="repositorypath" value="..\..\packages" />
5+
</config>
6+
</configuration>

src/ResourceManager/CognitiveServices/AzureRM.CognitiveServices.Netcore.psd1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ FunctionsToExport = @()
7474
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
7575
CmdletsToExport = 'Get-AzureRmCognitiveServicesAccount',
7676
'Get-AzureRmCognitiveServicesAccountKey',
77-
'Get-AzureRmCognitiveServicesAccountSkus',
77+
'Get-AzureRmCognitiveServicesAccountSkus',
78+
'Get-AzureRmCognitiveServicesAccountUsage',
7879
'New-AzureRmCognitiveServicesAccount',
7980
'New-AzureRmCognitiveServicesAccountKey',
8081
'Remove-AzureRmCognitiveServicesAccount',

src/ResourceManager/CognitiveServices/AzureRM.CognitiveServices.psd1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,11 @@ FunctionsToExport = @()
7575
CmdletsToExport = 'Get-AzureRmCognitiveServicesAccount',
7676
'Get-AzureRmCognitiveServicesAccountKey',
7777
'Get-AzureRmCognitiveServicesAccountSkus',
78+
'Get-AzureRmCognitiveServicesAccountUsage',
7879
'New-AzureRmCognitiveServicesAccount',
7980
'New-AzureRmCognitiveServicesAccountKey',
8081
'Remove-AzureRmCognitiveServicesAccount',
81-
'Set-AzureRmCognitiveServicesAccount'
82+
'Set-AzureRmCognitiveServicesAccount'
8283

8384
# Variables to export from this module
8485
# VariablesToExport = @()

src/ResourceManager/CognitiveServices/ChangeLog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
-->
2020
## Current Release
2121
* Updated to the latest version of the Azure ClientRuntime
22+
* Integrate with Cognitive Services Management SDK version 4.0.0.
23+
* Add Get-AzureRmCognitiveServicesAccountUsage operation.
2224

2325
## Version 0.9.3
2426
* Fix issue with Default Resource Group in CloudShell

src/ResourceManager/CognitiveServices/CognitiveServices.Test/Commands.Management.CognitiveServices.Test.csproj

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151
<Reference Include="Microsoft.Azure.Management.Authorization">
5252
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Authorization.1.0.0\lib\net40\Microsoft.Azure.Management.Authorization.dll</HintPath>
5353
</Reference>
54-
<Reference Include="Microsoft.Azure.Management.CognitiveServices, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
55-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.CognitiveServices.3.0.0\lib\net452\Microsoft.Azure.Management.CognitiveServices.dll</HintPath>
54+
<Reference Include="Microsoft.Azure.Management.CognitiveServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
55+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.CognitiveServices.4.0.0\lib\net452\Microsoft.Azure.Management.CognitiveServices.dll</HintPath>
5656
</Reference>
5757
<Reference Include="Microsoft.Azure.ResourceManager, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
5858
<SpecificVersion>False</SpecificVersion>
@@ -169,6 +169,9 @@
169169
<None Include="SessionRecords\CognitiveServices.Test.ScenarioTests.CognitiveServicesAccountTests\TestGetAccounts.json">
170170
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
171171
</None>
172+
<None Include="SessionRecords\CognitiveServices.Test.ScenarioTests.CognitiveServicesAccountTests\TestGetUsages.json">
173+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
174+
</None>
172175
<None Include="SessionRecords\CognitiveServices.Test.ScenarioTests.CognitiveServicesAccountTests\TestGetWithPaging.json">
173176
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
174177
</None>

src/ResourceManager/CognitiveServices/CognitiveServices.Test/ScenarioTests/CognitiveServicesAccountTests.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,5 +125,12 @@ public void TestGetWithPaging()
125125
{
126126
TestController.NewInstance.RunPsTest("Test-GetWithPaging");
127127
}
128+
129+
[Fact]
130+
[Trait(Category.AcceptanceType, Category.CheckIn)]
131+
public void TestGetUsages()
132+
{
133+
TestController.NewInstance.RunPsTest("Test-GetUsages");
134+
}
128135
}
129136
}

src/ResourceManager/CognitiveServices/CognitiveServices.Test/ScenarioTests/CognitiveServicesAccountTests.ps1

Lines changed: 76 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function Test-NewAzureRmCognitiveServicesAccount
2727
$accountname = 'csa' + $rgname;
2828
$skuname = 'S2';
2929
$accounttype = 'TextAnalytics';
30-
$loc = 'West US';
30+
$loc = Get-Location -providerNamespace "Microsoft.CognitiveServices" -resourceType "accounts" -preferredLocation "West US";
3131

3232
New-AzureRmResourceGroup -Name $rgname -Location $loc;
3333

@@ -57,28 +57,31 @@ function Test-NewAzureRmAllKindsOfCognitiveServicesAccounts
5757
# Setup
5858
$rgname = Get-CognitiveServicesManagementTestResourceName;
5959

60+
$locWU = Get-Location -providerNamespace "Microsoft.CognitiveServices" -resourceType "accounts" -preferredLocation "West US";
61+
$locGBL = Get-Location -providerNamespace "Microsoft.CognitiveServices" -resourceType "accounts" -preferredLocation "Global";
62+
6063
try
6164
{
6265
New-AzureRmResourceGroup -Name $rgname -Location 'West US';
6366

6467
# Create all known kinds of Cognitive Services accounts.
65-
Test-CreateCognitiveServicesAccount $rgname 'AcademicTest' 'Academic' 'S0' 'West US'
66-
Test-CreateCognitiveServicesAccount $rgname 'BingAutosuggestTest' 'Bing.Autosuggest' 'S1' 'Global'
67-
Test-CreateCognitiveServicesAccount $rgname 'BingSearchTest' 'Bing.Search' 'S1' 'Global'
68-
Test-CreateCognitiveServicesAccount $rgname 'BingSpeechTest' 'Bing.Speech' 'S0' 'Global'
69-
Test-CreateCognitiveServicesAccount $rgname 'BingSpellCheckTest' 'Bing.SpellCheck' 'S1' 'Global'
70-
Test-CreateCognitiveServicesAccount $rgname 'ComputerVisionTest' 'ComputerVision' 'S0' 'West US'
71-
Test-CreateCognitiveServicesAccount $rgname 'ContentModeratorTest' 'ContentModerator' 'S0' 'West US'
72-
Test-CreateCognitiveServicesAccount $rgname 'EmotionTest' 'Emotion' 'S0' 'West US'
73-
Test-CreateCognitiveServicesAccount $rgname 'FaceTest' 'Face' 'S0' 'West US'
74-
Test-CreateCognitiveServicesAccount $rgname 'LUISTest' 'LUIS' 'S0' 'West US'
75-
Test-CreateCognitiveServicesAccount $rgname 'RecommendationsTest' 'Recommendations' 'S1' 'West US'
76-
Test-CreateCognitiveServicesAccount $rgname 'SpeakerRecognitionTest' 'SpeakerRecognition' 'S0' 'West US'
77-
Test-CreateCognitiveServicesAccount $rgname 'SpeechTest' 'Speech' 'S0' 'West US'
78-
Test-CreateCognitiveServicesAccount $rgname 'SpeechTranslationTest' 'SpeechTranslation' 'S1' 'Global'
79-
Test-CreateCognitiveServicesAccount $rgname 'TextAnalyticsTest' 'TextAnalytics' 'S1' 'West US'
80-
Test-CreateCognitiveServicesAccount $rgname 'TextTranslationTest' 'TextTranslation' 'S1' 'Global'
81-
Test-CreateCognitiveServicesAccount $rgname 'WebLMTest' 'WebLM' 'S0' 'West US'
68+
Test-CreateCognitiveServicesAccount $rgname 'AcademicTest' 'Academic' 'S0' $locWU
69+
Test-CreateCognitiveServicesAccount $rgname 'BingAutosuggestTest' 'Bing.Autosuggest' 'S1' $locGBL
70+
Test-CreateCognitiveServicesAccount $rgname 'BingSearchTest' 'Bing.Search' 'S1' $locGBL
71+
Test-CreateCognitiveServicesAccount $rgname 'BingSpeechTest' 'Bing.Speech' 'S0' $locGBL
72+
Test-CreateCognitiveServicesAccount $rgname 'BingSpellCheckTest' 'Bing.SpellCheck' 'S1' $locGBL
73+
Test-CreateCognitiveServicesAccount $rgname 'ComputerVisionTest' 'ComputerVision' 'S0' $locWU
74+
Test-CreateCognitiveServicesAccount $rgname 'ContentModeratorTest' 'ContentModerator' 'S0' $locWU
75+
Test-CreateCognitiveServicesAccount $rgname 'EmotionTest' 'Emotion' 'S0' $locWU
76+
Test-CreateCognitiveServicesAccount $rgname 'FaceTest' 'Face' 'S0' $locWU
77+
Test-CreateCognitiveServicesAccount $rgname 'LUISTest' 'LUIS' 'S0' $locWU
78+
Test-CreateCognitiveServicesAccount $rgname 'RecommendationsTest' 'Recommendations' 'S1' $locWU
79+
Test-CreateCognitiveServicesAccount $rgname 'SpeakerRecognitionTest' 'SpeakerRecognition' 'S0' $locWU
80+
Test-CreateCognitiveServicesAccount $rgname 'SpeechTest' 'Speech' 'S0' $locWU
81+
Test-CreateCognitiveServicesAccount $rgname 'SpeechTranslationTest' 'SpeechTranslation' 'S1' $locGBL
82+
Test-CreateCognitiveServicesAccount $rgname 'TextAnalyticsTest' 'TextAnalytics' 'S1' $locWU
83+
Test-CreateCognitiveServicesAccount $rgname 'TextTranslationTest' 'TextTranslation' 'S1' $locGBL
84+
Test-CreateCognitiveServicesAccount $rgname 'WebLMTest' 'WebLM' 'S0' $locWU
8285
}
8386
finally
8487
{
@@ -102,7 +105,7 @@ function Test-RemoveAzureRmCognitiveServicesAccount
102105
$accountname = 'csa' + $rgname;
103106
$skuname = 'S1';
104107
$accounttype = 'TextAnalytics';
105-
$loc = 'West US';
108+
$loc = Get-Location -providerNamespace "Microsoft.CognitiveServices" -resourceType "accounts" -preferredLocation "West US";
106109

107110
New-AzureRmResourceGroup -Name $rgname -Location $loc;
108111

@@ -134,7 +137,7 @@ function Test-GetAzureCognitiveServiceAccount
134137
$accountname = 'csa' + $rgname;
135138
$skuname = 'S2';
136139
$accounttype = 'TextAnalytics';
137-
$loc = 'West US';
140+
$loc = Get-Location -providerNamespace "Microsoft.CognitiveServices" -resourceType "accounts" -preferredLocation "West US";
138141

139142
New-AzureRmResourceGroup -Name $rgname -Location $loc;
140143

@@ -183,7 +186,7 @@ function Test-SetAzureRmCognitiveServicesAccount
183186
$accountname = 'csa' + $rgname;
184187
$skuname = 'S2';
185188
$accounttype = 'TextAnalytics';
186-
$loc = 'West US';
189+
$loc = Get-Location -providerNamespace "Microsoft.CognitiveServices" -resourceType "accounts" -preferredLocation "West US";
187190

188191
New-AzureRmResourceGroup -Name $rgname -Location $loc;
189192
New-AzureRmCognitiveServicesAccount -ResourceGroupName $rgname -Name $accountname -Type $accounttype -SkuName $skuname -Location $loc -Force;
@@ -229,7 +232,7 @@ function Test-GetAzureRmCognitiveServicesAccountKey
229232
$accountname = 'csa' + $rgname;
230233
$skuname = 'S2';
231234
$accounttype = 'TextAnalytics';
232-
$loc = 'West US';
235+
$loc = Get-Location -providerNamespace "Microsoft.CognitiveServices" -resourceType "accounts" -preferredLocation "West US";
233236

234237
New-AzureRmResourceGroup -Name $rgname -Location $loc;
235238
New-AzureRmCognitiveServicesAccount -ResourceGroupName $rgname -Name $accountname -Type $accounttype -SkuName $skuname -Location $loc -Force;
@@ -262,7 +265,7 @@ function Test-NewAzureRmCognitiveServicesAccountKey
262265
$accountname = 'csa' + $rgname;
263266
$skuname = 'S2';
264267
$accounttype = 'TextAnalytics';
265-
$loc = 'West US';
268+
$loc = Get-Location -providerNamespace "Microsoft.CognitiveServices" -resourceType "accounts" -preferredLocation "West US";
266269

267270
New-AzureRmResourceGroup -Name $rgname -Location $loc;
268271
New-AzureRmCognitiveServicesAccount -ResourceGroupName $rgname -Name $accountname -Type $accounttype -SkuName $skuname -Location $loc -Force;
@@ -305,7 +308,7 @@ function Test-GetAzureRmCognitiveServicesAccountSkus
305308
$accountname = 'csa' + $rgname;
306309
$skuname = 'S2';
307310
$accounttype = 'TextAnalytics';
308-
$loc = 'West US';
311+
$loc = Get-Location -providerNamespace "Microsoft.CognitiveServices" -resourceType "accounts" -preferredLocation "West US";
309312

310313
New-AzureRmResourceGroup -Name $rgname -Location $loc;
311314
New-AzureRmCognitiveServicesAccount -ResourceGroupName $rgname -Name $accountname -Type $accounttype -SkuName $skuname -Location $loc -Force;
@@ -340,7 +343,7 @@ function Test-PipingGetAccountToGetKey
340343
$accountname = 'csa' + $rgname;
341344
$skuname = 'S2';
342345
$accounttype = 'TextAnalytics';
343-
$loc = 'West US';
346+
$loc = Get-Location -providerNamespace "Microsoft.CognitiveServices" -resourceType "accounts" -preferredLocation "West US";
344347

345348
New-AzureRmResourceGroup -Name $rgname -Location $loc;
346349
New-AzureRmCognitiveServicesAccount -ResourceGroupName $rgname -Name $accountname -Type $accounttype -SkuName $skuname -Location $loc -Force;
@@ -372,7 +375,7 @@ function Test-PipingToSetAzureAccount
372375
$accountname = 'csa' + $rgname;
373376
$skuname = 'S2';
374377
$accounttype = 'TextAnalytics';
375-
$loc = 'West US';
378+
$loc = Get-Location -providerNamespace "Microsoft.CognitiveServices" -resourceType "accounts" -preferredLocation "West US";
376379

377380
New-AzureRmResourceGroup -Name $rgname -Location $loc;
378381
New-AzureRmCognitiveServicesAccount -ResourceGroupName $rgname -Name $accountname -Type $accounttype -SkuName $skuname -Location $loc -Force;
@@ -407,7 +410,7 @@ function Test-PipingToGetAccountSkus
407410
$accountname = 'csa' + $rgname;
408411
$skuname = 'S2';
409412
$accounttype = 'TextAnalytics';
410-
$loc = 'West US';
413+
$loc = Get-Location -providerNamespace "Microsoft.CognitiveServices" -resourceType "accounts" -preferredLocation "West US";
411414

412415
New-AzureRmResourceGroup -Name $rgname -Location $loc;
413416
New-AzureRmCognitiveServicesAccount -ResourceGroupName $rgname -Name $accountname -Type $accounttype -SkuName $skuname -Location $loc -Force;
@@ -444,7 +447,7 @@ function Test-MinMaxAccountName
444447
$longname = 'testtesttesttesttesttesttesttesttesttesttesttesttesttesttesttest';
445448
$skuname = 'S2';
446449
$accounttype = 'TextAnalytics';
447-
$loc = 'West US';
450+
$loc = Get-Location -providerNamespace "Microsoft.CognitiveServices" -resourceType "accounts" -preferredLocation "West US";
448451

449452
New-AzureRmResourceGroup -Name $rgname -Location $loc;
450453
$shortaccount = New-AzureRmCognitiveServicesAccount -ResourceGroupName $rgname -Name $shortname -Type $accounttype -SkuName $skuname -Location $loc -Force;
@@ -470,7 +473,7 @@ function Test-GetWithPaging
470473
{
471474
# Setup
472475
$rgname = Get-CognitiveServicesManagementTestResourceName
473-
$loc = 'West US'
476+
$loc = Get-Location -providerNamespace "Microsoft.CognitiveServices" -resourceType "accounts" -preferredLocation "West US"
474477

475478
try
476479
{
@@ -502,3 +505,47 @@ function Test-GetWithPaging
502505
Clean-ResourceGroup $rgname
503506
}
504507
}
508+
509+
<#
510+
.SYNOPSIS
511+
Test Test-GetUsages
512+
#>
513+
function Test-GetUsages
514+
{
515+
# Setup
516+
$rgname = Get-CognitiveServicesManagementTestResourceName;
517+
518+
try
519+
{
520+
# Test
521+
$accountname = 'csa' + $rgname;
522+
$skuname = 'S1';
523+
$accounttype = 'TextAnalytics';
524+
$loc = Get-Location -providerNamespace "Microsoft.CognitiveServices" -resourceType "accounts" -preferredLocation "West US"
525+
526+
New-AzureRmResourceGroup -Name $rgname -Location $loc;
527+
528+
$createdAccount = New-AzureRmCognitiveServicesAccount -ResourceGroupName $rgname -Name $accountname -Type $accounttype -SkuName $skuname -Location $loc -Force;
529+
$usages1 = Get-AzureRmCognitiveServicesAccountUsage -ResourceGroupName $rgname -Name $accountname
530+
$usages2 = Get-AzureRmCognitiveServicesAccountUsage -InputObject $createdAccount
531+
$usages3 = Get-AzureRmCognitiveServicesAccountUsage -ResourceId $createdAccount.Id
532+
533+
Assert-True {$usages1.Count -gt 0}
534+
Assert-AreEqual 0.0 $usages1[0].CurrentValue
535+
Assert-True {$usages1[0].Limit -gt 0}
536+
537+
Assert-AreEqual $usages1.Count $usages2.Count
538+
Assert-AreEqual $usages2.Count $usages3.Count
539+
540+
Assert-AreEqual $usages1[0].CurrentValue $usages2[0].CurrentValue
541+
Assert-AreEqual $usages2[0].CurrentValue $usages3[0].CurrentValue
542+
543+
Assert-AreEqual $usages1[0].Limit $usages2[0].Limit
544+
Assert-AreEqual $usages2[0].Limit $usages3[0].Limit
545+
}
546+
finally
547+
{
548+
# Cleanup
549+
Clean-ResourceGroup $rgname
550+
}
551+
}

0 commit comments

Comments
 (0)