Skip to content

Commit dc14ca5

Browse files
author
Raj Shah
committed
Move ManagementGroups to AzureRM.Resources
1 parent 9a785f4 commit dc14ca5

28 files changed

+6252
-34
lines changed

src/ResourceManager/Resources/AzureRM.Resources.psd1

Lines changed: 15 additions & 4 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'
@@ -160,7 +164,14 @@ PrivateData = @{
160164
# IconUri = ''
161165

162166
# ReleaseNotes of this module
163-
ReleaseNotes = '* Set minimum dependency of module to PowerShell 5.0
167+
ReleaseNotes = '* Add ManagementGroups Cmdlets:
168+
- Get-AzureRmManagementGroup
169+
- New-AzureRmManagementGroup
170+
- Update-AzureRmManagementGroup
171+
- Remove-AzureRmManagementGroup
172+
- New-AzureRmManagementGroupSubscription
173+
- Remove-AzureRmManagementGroupSubscription
174+
* Set minimum dependency of module to PowerShell 5.0
164175
* Remove obsolete parameter -AtScopeAndBelow from Get-AzureRmRoledefinition call
165176
* Include assignments to deleted Users/Groups/ServicePrincipals in Get-AzureRmRoleAssignment result
166177
* Add convenience cmdlet for creating ServicePrincipals

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

Lines changed: 27 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.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
71+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.ManagementGroups.1.0.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>
@@ -90,6 +93,14 @@
9093
<HintPath>..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.28.3\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll</HintPath>
9194
<Private>True</Private>
9295
</Reference>
96+
<Reference Include="Microsoft.Rest.ClientRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
97+
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.2.3.10\lib\net452\Microsoft.Rest.ClientRuntime.dll</HintPath>
98+
<Private>True</Private>
99+
</Reference>
100+
<Reference Include="Microsoft.Rest.ClientRuntime.Azure, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
101+
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.3.3.10\lib\net452\Microsoft.Rest.ClientRuntime.Azure.dll</HintPath>
102+
<Private>True</Private>
103+
</Reference>
93104
<Reference Include="Microsoft.Rest.ClientRuntime.Azure.Authentication, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
94105
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.Authentication.2.2.9-preview\lib\net45\Microsoft.Rest.ClientRuntime.Azure.Authentication.dll</HintPath>
95106
<Private>True</Private>
@@ -173,6 +184,7 @@
173184
</Content>
174185
<Compile Include="ScenarioTests\LocationTests.cs" />
175186
<Compile Include="ScenarioTests\ManagedApplicationTests.cs" />
187+
<Compile Include="ScenarioTests\ManagementGroupsTests.cs" />
176188
<Compile Include="ScenarioTests\MoveResourceTest.cs" />
177189
<Compile Include="ScenarioTests\ManagedApplicationDefinitionTests.cs" />
178190
<Compile Include="ScenarioTests\ProviderFeatureTests.cs" />
@@ -320,6 +332,9 @@
320332
<None Include="ScenarioTests\ManagedApplicationTests.ps1">
321333
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
322334
</None>
335+
<None Include="ScenarioTests\ManagementGroupsTests.ps1">
336+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
337+
</None>
323338
<None Include="ScenarioTests\MoveResourceTest.ps1">
324339
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
325340
</None>
@@ -398,6 +413,18 @@
398413
<None Include="SessionRecords\Microsoft.Azure.Commands.Resources.Test.ScenarioTests.ManagedApplicationTests\TestManagedApplicationCRUD.json">
399414
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
400415
</None>
416+
<None Include="SessionRecords\Microsoft.Azure.Commands.Resources.Test.ScenarioTests.ManagementGroupsTests\TestGetManagementGroup.json" />
417+
<None Include="SessionRecords\Microsoft.Azure.Commands.Resources.Test.ScenarioTests.ManagementGroupsTests\TestGetManagementGroupWithExpand.json" />
418+
<None Include="SessionRecords\Microsoft.Azure.Commands.Resources.Test.ScenarioTests.ManagementGroupsTests\TestGetManagementGroupWithExpandAndRecurse.json" />
419+
<None Include="SessionRecords\Microsoft.Azure.Commands.Resources.Test.ScenarioTests.ManagementGroupsTests\TestNewManagementGroup.json" />
420+
<None Include="SessionRecords\Microsoft.Azure.Commands.Resources.Test.ScenarioTests.ManagementGroupsTests\TestNewManagementGroupWithDisplayName.json" />
421+
<None Include="SessionRecords\Microsoft.Azure.Commands.Resources.Test.ScenarioTests.ManagementGroupsTests\TestNewManagementGroupWithDisplayNameAndParentId.json" />
422+
<None Include="SessionRecords\Microsoft.Azure.Commands.Resources.Test.ScenarioTests.ManagementGroupsTests\TestNewManagementGroupWithParentId.json" />
423+
<None Include="SessionRecords\Microsoft.Azure.Commands.Resources.Test.ScenarioTests.ManagementGroupsTests\TestNewRemoveManagementGroupSubscription.json" />
424+
<None Include="SessionRecords\Microsoft.Azure.Commands.Resources.Test.ScenarioTests.ManagementGroupsTests\TestRemoveManagementGroup.json" />
425+
<None Include="SessionRecords\Microsoft.Azure.Commands.Resources.Test.ScenarioTests.ManagementGroupsTests\TestUpdateManagementGroupWithDisplayName.json" />
426+
<None Include="SessionRecords\Microsoft.Azure.Commands.Resources.Test.ScenarioTests.ManagementGroupsTests\TestUpdateManagementGroupWithDisplayNameAndParentId.json" />
427+
<None Include="SessionRecords\Microsoft.Azure.Commands.Resources.Test.ScenarioTests.ManagementGroupsTests\TestUpdateManagementGroupWithParentId.json" />
401428
<None Include="SessionRecords\Microsoft.Azure.Commands.Resources.Test.ScenarioTests.MoveResourceTest\TestMoveAzureResource.json">
402429
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
403430
</None>
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
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 Microsoft.WindowsAzure.Commands.Test.Utilities.Common;
18+
using Xunit;
19+
20+
namespace Microsoft.Azure.Commands.Resources.Test.ScenarioTests
21+
{
22+
public class ManagementGroupsTests
23+
{
24+
public ManagementGroupsTests(Xunit.Abstractions.ITestOutputHelper output)
25+
{
26+
XunitTracingInterceptor.AddToContext(new XunitTracingInterceptor(output));
27+
}
28+
29+
[Fact]
30+
[Trait(Category.AcceptanceType, Category.CheckIn)]
31+
public void TestGetManagementGroup()
32+
{
33+
ResourcesController.NewInstance.RunPsTest("Test-GetManagementGroup");
34+
}
35+
36+
[Fact]
37+
[Trait(Category.AcceptanceType, Category.CheckIn)]
38+
public void TestGetManagementGroupWithExpand()
39+
{
40+
ResourcesController.NewInstance.RunPsTest("Test-GetManagementGroupWithExpand");
41+
}
42+
43+
[Fact]
44+
[Trait(Category.AcceptanceType, Category.CheckIn)]
45+
public void TestGetManagementGroupWithExpandAndRecurse()
46+
{
47+
ResourcesController.NewInstance.RunPsTest("Test-GetManagementGroupWithExpandAndRecurse");
48+
}
49+
50+
[Fact]
51+
[Trait(Category.AcceptanceType, Category.CheckIn)]
52+
public void TestNewManagementGroup()
53+
{
54+
ResourcesController.NewInstance.RunPsTest("Test-NewManagementGroup");
55+
}
56+
57+
[Fact]
58+
[Trait(Category.AcceptanceType, Category.CheckIn)]
59+
public void TestNewManagementGroupWithDisplayName()
60+
{
61+
ResourcesController.NewInstance.RunPsTest("Test-NewManagementGroupWithDisplayName");
62+
}
63+
64+
[Fact]
65+
[Trait(Category.AcceptanceType, Category.CheckIn)]
66+
public void TestNewManagementGroupWithParentId()
67+
{
68+
ResourcesController.NewInstance.RunPsTest("Test-NewManagementGroupWithParentId");
69+
}
70+
71+
[Fact]
72+
[Trait(Category.AcceptanceType, Category.CheckIn)]
73+
public void TestNewManagementGroupWithDisplayNameAndParentId()
74+
{
75+
ResourcesController.NewInstance.RunPsTest("Test-NewManagementGroupWithDisplayNameAndParentId");
76+
}
77+
78+
[Fact]
79+
[Trait(Category.AcceptanceType, Category.CheckIn)]
80+
public void TestUpdateManagementGroupWithDisplayName()
81+
{
82+
ResourcesController.NewInstance.RunPsTest("Test-UpdateManagementGroupWithDisplayName");
83+
}
84+
85+
[Fact]
86+
[Trait(Category.AcceptanceType, Category.CheckIn)]
87+
public void TestUpdateManagementGroupWithParentId()
88+
{
89+
ResourcesController.NewInstance.RunPsTest("Test-UpdateManagementGroupWithParentId");
90+
}
91+
92+
[Fact]
93+
[Trait(Category.AcceptanceType, Category.CheckIn)]
94+
public void TestUpdateManagementGroupWithDisplayNameAndParentId()
95+
{
96+
ResourcesController.NewInstance.RunPsTest("Test-UpdateManagementGroupWithDisplayNameAndParentId");
97+
}
98+
99+
[Fact]
100+
[Trait(Category.AcceptanceType, Category.CheckIn)]
101+
public void TestRemoveManagementGroup()
102+
{
103+
ResourcesController.NewInstance.RunPsTest("Test-RemoveManagementGroup");
104+
}
105+
106+
[Fact]
107+
[Trait(Category.AcceptanceType, Category.CheckIn)]
108+
public void TestNewRemoveManagementGroupSubscription()
109+
{
110+
ResourcesController.NewInstance.RunPsTest("Test-NewRemoveManagementGroupSubscription");
111+
}
112+
}
113+
}

0 commit comments

Comments
 (0)