Skip to content

Commit f0e0cbf

Browse files
Raj ShahMaddie Clayton
authored andcommitted
Add ManagementGroups to AzureRM.Resources and Update to use latest SDK for GA (#6271)
* Initial migration commit * Move ManagementGroups to AzureRM.Resources * Update powershell to use the latest SDK and API, minor changes to responses and help files * Add installer file * Revert "Add installer file" This reverts commit 0d9b92c. * Update tests and run tests again * Update Help * Update helpfiles * more changes to help files * Changes to Netcore.psd1 * Changes to Netcore.csproj * Update help file * Regenerate all help files * Move help files to AzureRM.Resource help files * Update package version * Update local feed and rerun tests * Remove local feed
1 parent 1ac17f6 commit f0e0cbf

File tree

45 files changed

+13367
-8
lines changed

Some content is hidden

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

45 files changed

+13367
-8
lines changed

src/ResourceManager/Resources/AzureRM.Resources.Netcore.psd1

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ RequiredModules = @(@{ModuleName = 'AzureRM.Profile.Netcore'; ModuleVersion = '0
5656
# Assemblies that must be loaded prior to importing this module
5757
RequiredAssemblies = '.\Microsoft.Azure.Management.Authorization.dll',
5858
'.\Microsoft.Azure.Commands.ResourceManager.Cmdlets.dll',
59-
'.\Microsoft.Azure.Management.ResourceManager.dll'
59+
'.\Microsoft.Azure.Management.ResourceManager.dll',
60+
'.\Microsoft.Azure.Management.ManagementGroups.dll'
6061

6162
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
6263
ScriptsToProcess = @()
@@ -119,7 +120,10 @@ CmdletsToExport = 'Get-AzureRmProviderOperation', 'Remove-AzureRmRoleAssignment'
119120
'Set-AzureRmManagedApplicationDefinition',
120121
'Remove-AzureRmManagedApplicationDefinition',
121122
'Get-AzureRmManagedApplication', 'New-AzureRmManagedApplication',
122-
'Set-AzureRmManagedApplication', 'Remove-AzureRmManagedApplication'
123+
'Set-AzureRmManagedApplication', 'Remove-AzureRmManagedApplication',
124+
'Get-AzureRmManagementGroup', 'New-AzureRmManagementGroup',
125+
'Update-AzureRmManagementGroup', 'Remove-AzureRmManagementGroup',
126+
'New-AzureRmManagementGroupSubscription', 'Remove-AzureRmManagementGroupSubscription'
123127

124128
# Variables to export from this module
125129
# VariablesToExport = @()
@@ -142,7 +146,7 @@ PrivateData = @{
142146
PSData = @{
143147

144148
# Tags applied to this module. These help with module discovery in online galleries.
145-
Tags = 'Azure','ResourceManager','ARM','Provider','ResourceGroup','Deployment','ActiveDirectory','Authorization'
149+
Tags = 'Azure','ResourceManager','ARM','Provider','ResourceGroup','Deployment','ActiveDirectory','Authorization', 'Management','ManagementGroups'
146150

147151
# A URL to the license for this module.
148152
LicenseUri = 'https://aka.ms/azps-license'

src/ResourceManager/Resources/AzureRM.Resources.psd1

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ RequiredModules = @(@{ModuleName = 'AzureRM.Profile'; ModuleVersion = '5.1.0'; }
5555

5656
# Assemblies that must be loaded prior to importing this module
5757
RequiredAssemblies = '.\Microsoft.Azure.Management.ResourceManager.dll',
58-
'.\Microsoft.Azure.Management.Authorization.dll'
58+
'.\Microsoft.Azure.Management.Authorization.dll',
59+
'.\Microsoft.Azure.Management.ManagementGroups.dll'
5960

6061
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
6162
# ScriptsToProcess = @()
@@ -120,7 +121,10 @@ CmdletsToExport = 'Get-AzureRmProviderOperation', 'Remove-AzureRmRoleAssignment'
120121
'Set-AzureRmManagedApplicationDefinition',
121122
'Remove-AzureRmManagedApplicationDefinition',
122123
'Get-AzureRmManagedApplication', 'New-AzureRmManagedApplication',
123-
'Set-AzureRmManagedApplication', 'Remove-AzureRmManagedApplication'
124+
'Set-AzureRmManagedApplication', 'Remove-AzureRmManagedApplication',
125+
'Get-AzureRmManagementGroup', 'New-AzureRmManagementGroup',
126+
'Update-AzureRmManagementGroup', 'Remove-AzureRmManagementGroup',
127+
'New-AzureRmManagementGroupSubscription', 'Remove-AzureRmManagementGroupSubscription'
124128

125129
# Variables to export from this module
126130
# VariablesToExport = @()
@@ -148,7 +152,7 @@ PrivateData = @{
148152
PSData = @{
149153

150154
# Tags applied to this module. These help with module discovery in online galleries.
151-
Tags = 'Azure','ResourceManager','ARM','Provider','ResourceGroup','Deployment','ActiveDirectory','Authorization'
155+
Tags = 'Azure','ResourceManager','ARM','Provider','ResourceGroup','Deployment','ActiveDirectory','Authorization', 'Management','ManagementGroups'
152156

153157
# A URL to the license for this module.
154158
LicenseUri = 'https://aka.ms/azps-license'

src/ResourceManager/Resources/Commands.Resources.Test/Commands.Resources.Test.csproj

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@
6767
<Reference Include="Microsoft.Azure.Insights">
6868
<HintPath>..\..\..\packages\Microsoft.Azure.Insights.0.10.0-preview\lib\net45\Microsoft.Azure.Insights.dll</HintPath>
6969
</Reference>
70+
<Reference Include="Microsoft.Azure.Management.ManagementGroups, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
71+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.ManagementGroups.1.1.0-preview\lib\net452\Microsoft.Azure.Management.ManagementGroups.dll</HintPath>
72+
</Reference>
7073
<Reference Include="Microsoft.Azure.Management.ResourceManager, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
7174
<SpecificVersion>False</SpecificVersion>
7275
<HintPath>..\..\..\packages\Microsoft.Azure.Management.ResourceManager.1.6.0-preview\lib\net452\Microsoft.Azure.Management.ResourceManager.dll</HintPath>
@@ -173,6 +176,7 @@
173176
</Content>
174177
<Compile Include="ScenarioTests\LocationTests.cs" />
175178
<Compile Include="ScenarioTests\ManagedApplicationTests.cs" />
179+
<Compile Include="ScenarioTests\ManagementGroupsTests.cs" />
176180
<Compile Include="ScenarioTests\MoveResourceTest.cs" />
177181
<Compile Include="ScenarioTests\ManagedApplicationDefinitionTests.cs" />
178182
<Compile Include="ScenarioTests\ProviderFeatureTests.cs" />
@@ -320,6 +324,9 @@
320324
<None Include="ScenarioTests\ManagedApplicationTests.ps1">
321325
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
322326
</None>
327+
<None Include="ScenarioTests\ManagementGroupsTests.ps1">
328+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
329+
</None>
323330
<None Include="ScenarioTests\MoveResourceTest.ps1">
324331
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
325332
</None>
@@ -398,6 +405,42 @@
398405
<None Include="SessionRecords\Microsoft.Azure.Commands.Resources.Test.ScenarioTests.ManagedApplicationTests\TestManagedApplicationCRUD.json">
399406
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
400407
</None>
408+
<None Include="SessionRecords\Microsoft.Azure.Commands.Resources.Test.ScenarioTests.ManagementGroupsTests\TestGetManagementGroup.json">
409+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
410+
</None>
411+
<None Include="SessionRecords\Microsoft.Azure.Commands.Resources.Test.ScenarioTests.ManagementGroupsTests\TestGetManagementGroupWithExpand.json">
412+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
413+
</None>
414+
<None Include="SessionRecords\Microsoft.Azure.Commands.Resources.Test.ScenarioTests.ManagementGroupsTests\TestGetManagementGroupWithExpandAndRecurse.json">
415+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
416+
</None>
417+
<None Include="SessionRecords\Microsoft.Azure.Commands.Resources.Test.ScenarioTests.ManagementGroupsTests\TestNewManagementGroup.json">
418+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
419+
</None>
420+
<None Include="SessionRecords\Microsoft.Azure.Commands.Resources.Test.ScenarioTests.ManagementGroupsTests\TestNewManagementGroupWithDisplayName.json">
421+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
422+
</None>
423+
<None Include="SessionRecords\Microsoft.Azure.Commands.Resources.Test.ScenarioTests.ManagementGroupsTests\TestNewManagementGroupWithDisplayNameAndParentId.json">
424+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
425+
</None>
426+
<None Include="SessionRecords\Microsoft.Azure.Commands.Resources.Test.ScenarioTests.ManagementGroupsTests\TestNewManagementGroupWithParentId.json">
427+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
428+
</None>
429+
<None Include="SessionRecords\Microsoft.Azure.Commands.Resources.Test.ScenarioTests.ManagementGroupsTests\TestNewRemoveManagementGroupSubscription.json">
430+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
431+
</None>
432+
<None Include="SessionRecords\Microsoft.Azure.Commands.Resources.Test.ScenarioTests.ManagementGroupsTests\TestRemoveManagementGroup.json">
433+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
434+
</None>
435+
<None Include="SessionRecords\Microsoft.Azure.Commands.Resources.Test.ScenarioTests.ManagementGroupsTests\TestUpdateManagementGroupWithDisplayName.json">
436+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
437+
</None>
438+
<None Include="SessionRecords\Microsoft.Azure.Commands.Resources.Test.ScenarioTests.ManagementGroupsTests\TestUpdateManagementGroupWithDisplayNameAndParentId.json">
439+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
440+
</None>
441+
<None Include="SessionRecords\Microsoft.Azure.Commands.Resources.Test.ScenarioTests.ManagementGroupsTests\TestUpdateManagementGroupWithParentId.json">
442+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
443+
</None>
401444
<None Include="SessionRecords\Microsoft.Azure.Commands.Resources.Test.ScenarioTests.MoveResourceTest\TestMoveAzureResource.json">
402445
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
403446
</None>
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using Microsoft.Azure.ServiceManagemenet.Common.Models;
16+
using Microsoft.WindowsAzure.Commands.ScenarioTest;
17+
using Xunit;
18+
19+
namespace Microsoft.Azure.Commands.Resources.Test.ScenarioTests
20+
{
21+
public class ManagementGroupsTests
22+
{
23+
public ManagementGroupsTests(Xunit.Abstractions.ITestOutputHelper output)
24+
{
25+
XunitTracingInterceptor.AddToContext(new XunitTracingInterceptor(output));
26+
}
27+
28+
[Fact]
29+
[Trait(Category.AcceptanceType, Category.CheckIn)]
30+
public void TestGetManagementGroup()
31+
{
32+
ResourcesController.NewInstance.RunPsTest("Test-GetManagementGroup");
33+
}
34+
35+
[Fact]
36+
[Trait(Category.AcceptanceType, Category.CheckIn)]
37+
public void TestGetManagementGroupWithExpand()
38+
{
39+
ResourcesController.NewInstance.RunPsTest("Test-GetManagementGroupWithExpand");
40+
}
41+
42+
[Fact]
43+
[Trait(Category.AcceptanceType, Category.CheckIn)]
44+
public void TestGetManagementGroupWithExpandAndRecurse()
45+
{
46+
ResourcesController.NewInstance.RunPsTest("Test-GetManagementGroupWithExpandAndRecurse");
47+
}
48+
49+
[Fact]
50+
[Trait(Category.AcceptanceType, Category.CheckIn)]
51+
public void TestNewManagementGroup()
52+
{
53+
ResourcesController.NewInstance.RunPsTest("Test-NewManagementGroup");
54+
}
55+
56+
[Fact]
57+
[Trait(Category.AcceptanceType, Category.CheckIn)]
58+
public void TestNewManagementGroupWithDisplayName()
59+
{
60+
ResourcesController.NewInstance.RunPsTest("Test-NewManagementGroupWithDisplayName");
61+
}
62+
63+
[Fact]
64+
[Trait(Category.AcceptanceType, Category.CheckIn)]
65+
public void TestNewManagementGroupWithParentId()
66+
{
67+
ResourcesController.NewInstance.RunPsTest("Test-NewManagementGroupWithParentId");
68+
}
69+
70+
[Fact]
71+
[Trait(Category.AcceptanceType, Category.CheckIn)]
72+
public void TestNewManagementGroupWithDisplayNameAndParentId()
73+
{
74+
ResourcesController.NewInstance.RunPsTest("Test-NewManagementGroupWithDisplayNameAndParentId");
75+
}
76+
77+
[Fact]
78+
[Trait(Category.AcceptanceType, Category.CheckIn)]
79+
public void TestUpdateManagementGroupWithDisplayName()
80+
{
81+
ResourcesController.NewInstance.RunPsTest("Test-UpdateManagementGroupWithDisplayName");
82+
}
83+
84+
[Fact]
85+
[Trait(Category.AcceptanceType, Category.CheckIn)]
86+
public void TestUpdateManagementGroupWithParentId()
87+
{
88+
ResourcesController.NewInstance.RunPsTest("Test-UpdateManagementGroupWithParentId");
89+
}
90+
91+
[Fact]
92+
[Trait(Category.AcceptanceType, Category.CheckIn)]
93+
public void TestUpdateManagementGroupWithDisplayNameAndParentId()
94+
{
95+
ResourcesController.NewInstance.RunPsTest("Test-UpdateManagementGroupWithDisplayNameAndParentId");
96+
}
97+
98+
[Fact]
99+
[Trait(Category.AcceptanceType, Category.CheckIn)]
100+
public void TestRemoveManagementGroup()
101+
{
102+
ResourcesController.NewInstance.RunPsTest("Test-RemoveManagementGroup");
103+
}
104+
105+
[Fact]
106+
[Trait(Category.AcceptanceType, Category.CheckIn)]
107+
public void TestNewRemoveManagementGroupSubscription()
108+
{
109+
ResourcesController.NewInstance.RunPsTest("Test-NewRemoveManagementGroupSubscription");
110+
}
111+
}
112+
}

0 commit comments

Comments
 (0)