Skip to content

Commit 4491ebc

Browse files
author
Maddie Clayton
authored
Merge pull request #5270 from varunkch/msi_powershell2
Adding new Powershell module for ManagedServiceIdentity
2 parents a186cdc + 823b094 commit 4491ebc

33 files changed

+3375
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ msbuild.log
1414
# please do not commit any app.config files.
1515
app.config
1616
!src/ResourceManager/Profile/Commands.Profile.Test/App.config
17+
!src/ResourceManager/ManagedServiceIdentity/Commands.ManagedServiceIdentity.Test/App.config
1718
!src/Storage/Commands.Storage.Test/app.config
19+
1820
## Ignore Visual Studio temporary files, build results, and
1921
## files generated by popular Visual Studio add-ons.
2022

TestMappings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@
101101
"src/ResourceManager/MachineLearningCompute/" : [
102102
".\\src\\ResourceManager\\MachineLearningCompute\\Commands.MachineLearningCompute.Test\\bin\\Debug\\Microsoft.Azure.Commands.MachineLearningCompute.Test.dll"
103103
],
104+
"src/ResourceManager/ManagedServiceIdentity/" : [
105+
".\\src\\ResourceManager\\ManagedServiceIdentity\\Commands.ManagedServiceIdentity.Test\\bin\\Debug\\Microsoft.Azure.Commands.ManagedServiceIdentity.Test.dll"
106+
],
104107
"src/ResourceManager/MarketplaceOrdering/Commands.MarketplaceOrdering.Test/": [
105108
".\\src\\ResourceManager\\MarketplaceOrdering\\Commands.MarketplaceOrdering.Test\\bin\\Debug\\Microsoft.Azure.Commands.MarketplaceOrdering.Test.dll"
106109
],
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
#
2+
# Module manifest for module 'PSGet_AzureRM.ManagedServiceIdentity'
3+
#
4+
# Generated by: Microsoft Corporation
5+
#
6+
# Generated on: 1/4/2018
7+
#
8+
9+
@{
10+
11+
# Script module or binary module file associated with this manifest.
12+
# RootModule = ''
13+
14+
# Version number of this module.
15+
ModuleVersion = '1.0.0'
16+
17+
# Supported PSEditions
18+
# CompatiblePSEditions = @()
19+
20+
# ID used to uniquely identify this module
21+
GUID = '2a27df8b-15e3-4fb9-b885-22c6bcafc203'
22+
23+
# Author of this module
24+
Author = 'Microsoft Corporation'
25+
26+
# Company or vendor of this module
27+
CompanyName = 'Microsoft Corporation'
28+
29+
# Copyright statement for this module
30+
Copyright = 'Microsoft Corporation. All rights reserved.'
31+
32+
# Description of the functionality provided by this module
33+
Description = 'Microsoft Azure PowerShell - Managed Service Identity cmdlets for Azure Resource Manager. Manages user assigned identities in Azure Resource Manager'
34+
35+
# Minimum version of the Windows PowerShell engine required by this module
36+
PowerShellVersion = '3.0'
37+
38+
# Name of the Windows PowerShell host required by this module
39+
# PowerShellHostName = ''
40+
41+
# Minimum version of the Windows PowerShell host required by this module
42+
# PowerShellHostVersion = ''
43+
44+
# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
45+
DotNetFrameworkVersion = '4.5.2'
46+
47+
# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
48+
CLRVersion = '4.0'
49+
50+
# Processor architecture (None, X86, Amd64) required by this module
51+
# ProcessorArchitecture = ''
52+
53+
# Modules that must be imported into the global environment prior to importing this module
54+
RequiredModules = @(@{ModuleName = 'AzureRM.Profile'; ModuleVersion = '4.2.0'; })
55+
56+
# Assemblies that must be loaded prior to importing this module
57+
RequiredAssemblies = '.\Microsoft.Azure.Management.ManagedServiceIdentity.dll'
58+
59+
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
60+
# ScriptsToProcess = @()
61+
62+
# Type files (.ps1xml) to be loaded when importing this module
63+
#TypesToProcess = @()
64+
65+
# Format files (.ps1xml) to be loaded when importing this module
66+
#FormatsToProcess = @()
67+
68+
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
69+
NestedModules = @('.\Microsoft.Azure.Commands.ManagedServiceIdentity.dll')
70+
71+
# Functions 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 functions to export.
72+
FunctionsToExport = @()
73+
74+
# 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.
75+
CmdletsToExport = 'New-AzureRmUserAssignedIdentity', 'Get-AzureRmUserAssignedIdentity', 'Remove-AzureRmUserAssignedIdentity'
76+
77+
78+
# Variables to export from this module
79+
# VariablesToExport = @()
80+
81+
# Aliases 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 aliases to export.
82+
AliasesToExport = @()
83+
84+
# DSC resources to export from this module
85+
# DscResourcesToExport = @()
86+
87+
# List of all modules packaged with this module
88+
# ModuleList = @()
89+
90+
# List of all files packaged with this module
91+
# FileList = @()
92+
93+
# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
94+
PrivateData = @{
95+
96+
PSData = @{
97+
98+
# Tags applied to this module. These help with module discovery in online galleries.
99+
Tags = 'Azure','ResourceManager','ARM','MSI','ManagedServiceIdentity','Identity','UserAssignedIdentities', 'IAM'
100+
101+
# A URL to the license for this module.
102+
LicenseUri = 'https://aka.ms/azps-license'
103+
104+
# A URL to the main website for this project.
105+
ProjectUri = 'https://github.com/Azure/azure-powershell'
106+
107+
# A URL to an icon representing this module.
108+
# IconUri = ''
109+
110+
# ReleaseNotes of this module
111+
ReleaseNotes = 'New Powershell module for Managed Service Identity to manage CRUD operations on user assigned identities. This is the private-preview release.'
112+
113+
# External dependent modules of this module
114+
# ExternalModuleDependencies = ''
115+
Prerelease = 'preview'
116+
117+
} # End of PSData hashtable
118+
119+
} # End of PrivateData hashtable
120+
121+
# HelpInfo URI of this module
122+
# HelpInfoURI = ''
123+
124+
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
125+
# DefaultCommandPrefix = ''
126+
127+
}
128+
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<!--
2+
Please leave this section at the top of the change log.
3+
4+
Changes for the current release should go under the section titled "Current Release", and should adhere to the following format:
5+
6+
## Current Release
7+
* Overview of change #1
8+
- Additional information about change #1
9+
* Overview of change #2
10+
- Additional information about change #2
11+
- Additional information about change #2
12+
* Overview of change #3
13+
* Overview of change #4
14+
- Additional information about change #4
15+
16+
## YYYY.MM.DD - Version X.Y.Z (Previous Release)
17+
* Overview of change #1
18+
- Additional information about change #1
19+
-->
20+
## Current Release
21+
First release of Managed Service Identity cmdlets
22+
23+
- Get-AzureRmUserAssignedIdentity
24+
The **Get-AzureRmUserAssignedIdentity** gets existing user assigned identities.
25+
26+
- New-AzureRmUserAssignedIdentity
27+
The **New-AzureRmUserAssignedIdentity** cmdlet creates a new User Assigned Identity. When used with an already existing identity, it updated the identity.
28+
To add Azure Resource Manager tags to the identity, please use the Set-AzureRmResource cmdlet.
29+
30+
- Remove-AzureRmUserAssignedIdentity
31+
The **Remove-AzureRmUserAssignedIdentity** deletes the specified User Assigned Identity.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<runtime>
4+
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
5+
<dependentAssembly>
6+
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
7+
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
8+
</dependentAssembly>
9+
</assemblyBinding>
10+
</runtime>
11+
</configuration>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="..\packages\xunit.core.2.3.1\build\xunit.core.props" Condition="Exists('..\packages\xunit.core.2.3.1\build\xunit.core.props')" />
4+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
5+
<PropertyGroup>
6+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
7+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
8+
<ProjectGuid>{76BBFAA8-01E4-4A41-AF8F-F4BE7269F640}</ProjectGuid>
9+
<OutputType>Library</OutputType>
10+
<AppDesignerFolder>Properties</AppDesignerFolder>
11+
<RootNamespace>Microsoft.Azure.Commands.ManagedServiceIdentity.Test</RootNamespace>
12+
<AssemblyName>Microsoft.Azure.Commands.ManagedServiceIdentity.Test</AssemblyName>
13+
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
14+
<FileAlignment>512</FileAlignment>
15+
<NuGetPackageImportStamp>
16+
</NuGetPackageImportStamp>
17+
</PropertyGroup>
18+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
19+
<DebugSymbols>true</DebugSymbols>
20+
<DebugType>full</DebugType>
21+
<Optimize>false</Optimize>
22+
<OutputPath>bin\Debug\</OutputPath>
23+
<DefineConstants>DEBUG;TRACE</DefineConstants>
24+
<ErrorReport>prompt</ErrorReport>
25+
<WarningLevel>4</WarningLevel>
26+
</PropertyGroup>
27+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
28+
<DebugType>pdbonly</DebugType>
29+
<Optimize>true</Optimize>
30+
<OutputPath>bin\Release\</OutputPath>
31+
<DefineConstants>TRACE</DefineConstants>
32+
<ErrorReport>prompt</ErrorReport>
33+
<WarningLevel>4</WarningLevel>
34+
</PropertyGroup>
35+
<ItemGroup>
36+
<Reference Include="Microsoft.Azure.Management.ManagedServiceIdentity, Version=0.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
37+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.ManagedServiceIdentity.0.9.0-preview\lib\net452\Microsoft.Azure.Management.ManagedServiceIdentity.dll</HintPath>
38+
<Private>True</Private>
39+
</Reference>
40+
<Reference Include="Microsoft.Azure.ResourceManager, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
41+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Resources.2.20.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll</HintPath>
42+
<Private>True</Private>
43+
</Reference>
44+
<Reference Include="Microsoft.Azure.Test.Framework, Version=1.0.6179.26854, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
45+
<SpecificVersion>False</SpecificVersion>
46+
<HintPath>..\..\..\packages\Microsoft.Azure.Test.Framework.1.0.6179.26854-prerelease\lib\net45\Microsoft.Azure.Test.Framework.dll</HintPath>
47+
</Reference>
48+
<Reference Include="Microsoft.Azure.Test.HttpRecorder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
49+
<HintPath>..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.8.1\lib\net452\Microsoft.Azure.Test.HttpRecorder.dll</HintPath>
50+
<Private>True</Private>
51+
</Reference>
52+
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory, Version=2.28.3.860, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
53+
<HintPath>..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.28.3\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll</HintPath>
54+
<Private>True</Private>
55+
</Reference>
56+
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms, Version=2.28.3.860, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
57+
<HintPath>..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.28.3\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll</HintPath>
58+
<Private>True</Private>
59+
</Reference>
60+
<Reference Include="Microsoft.Rest.ClientRuntime.Azure.Authentication, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
61+
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.Authentication.2.3.1\lib\net452\Microsoft.Rest.ClientRuntime.Azure.Authentication.dll</HintPath>
62+
<Private>True</Private>
63+
</Reference>
64+
<Reference Include="Microsoft.Rest.ClientRuntime.Azure.TestFramework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
65+
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.TestFramework.1.7.2\lib\net452\Microsoft.Rest.ClientRuntime.Azure.TestFramework.dll</HintPath>
66+
<Private>True</Private>
67+
</Reference>
68+
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
69+
<SpecificVersion>False</SpecificVersion>
70+
<HintPath>..\..\..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
71+
</Reference>
72+
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
73+
<Reference Include="System.Runtime.Serialization" />
74+
<Reference Include="System.Security" />
75+
<Reference Include="xunit.abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
76+
<HintPath>..\..\..\packages\xunit.abstractions.2.0.0\lib\net35\xunit.abstractions.dll</HintPath>
77+
<Private>True</Private>
78+
</Reference>
79+
<Reference Include="xunit.assert, Version=2.1.0.3179, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
80+
<HintPath>..\..\..\packages\xunit.assert.2.1.0\lib\portable-net45+win8+wp8+wpa81\xunit.assert.dll</HintPath>
81+
<Private>True</Private>
82+
</Reference>
83+
<Reference Include="xunit.core, Version=2.1.0.3179, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
84+
<HintPath>..\..\..\packages\xunit.extensibility.core.2.1.0\lib\portable-net45+win8+wp8+wpa81\xunit.core.dll</HintPath>
85+
<Private>True</Private>
86+
</Reference>
87+
<Reference Include="xunit.execution.desktop, Version=2.1.0.3179, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
88+
<HintPath>..\..\..\packages\xunit.extensibility.execution.2.1.0\lib\net45\xunit.execution.desktop.dll</HintPath>
89+
<Private>True</Private>
90+
</Reference>
91+
</ItemGroup>
92+
<ItemGroup>
93+
<Compile Include="Properties\AssemblyInfo.cs" />
94+
<Compile Include="ScenarioTests\CrudTests.cs" />
95+
<Compile Include="TestController.cs" />
96+
</ItemGroup>
97+
<ItemGroup>
98+
<ProjectReference Include="..\..\..\Common\Commands.Common.Authentication.Abstractions\Commands.Common.Authentication.Abstractions.csproj">
99+
<Project>{70527617-7598-4AEF-B5BD-DB9186B8184B}</Project>
100+
<Name>Commands.Common.Authentication.Abstractions</Name>
101+
</ProjectReference>
102+
<ProjectReference Include="..\..\Common\Commands.ResourceManager.Common\Commands.ResourceManager.Common.csproj">
103+
<Project>{3819D8A7-C62C-4C47-8DDD-0332D9CE1252}</Project>
104+
<Name>Commands.ResourceManager.Common</Name>
105+
</ProjectReference>
106+
<ProjectReference Include="..\..\Common\Commands.ScenarioTests.ResourceManager.Common\Commands.ScenarioTests.ResourceManager.Common.csproj">
107+
<Project>{3436a126-edc9-4060-8952-9a1be34cdd95}</Project>
108+
<Name>Commands.ScenarioTests.ResourceManager.Common</Name>
109+
</ProjectReference>
110+
<ProjectReference Include="..\Commands.ManagedServiceIdentity\Commands.ManagedServiceIdentity.csproj">
111+
<Project>{228eb071-fa04-43b3-95f9-7d76dbf0b850}</Project>
112+
<Name>Commands.ManagedServiceIdentity</Name>
113+
</ProjectReference>
114+
</ItemGroup>
115+
<ItemGroup>
116+
<None Include="App.config" />
117+
<None Include="packages.config" />
118+
<None Include="ScenarioTests\CrudTests.ps1">
119+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
120+
</None>
121+
<None Include="SessionRecords\**\*.json">
122+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
123+
</None>
124+
</ItemGroup>
125+
<ItemGroup>
126+
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
127+
</ItemGroup>
128+
<ItemGroup />
129+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
130+
<Import Project="..\..\..\..\tools\Common.Dependencies.targets" />
131+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
using System.Reflection;
2+
using System.Runtime.InteropServices;
3+
4+
// General Information about an assembly is controlled through the following
5+
// set of attributes. Change these attribute values to modify the information
6+
// associated with an assembly.
7+
[assembly: AssemblyTitle("Commands.ManagedServiceIdentity.Test")]
8+
[assembly: AssemblyDescription("")]
9+
[assembly: AssemblyConfiguration("")]
10+
[assembly: AssemblyCompany("")]
11+
[assembly: AssemblyProduct("Commands.ManagedServiceIdentity.Test")]
12+
[assembly: AssemblyCopyright("Copyright © 2018")]
13+
[assembly: AssemblyTrademark("")]
14+
[assembly: AssemblyCulture("")]
15+
16+
// Setting ComVisible to false makes the types in this assembly not visible
17+
// to COM components. If you need to access a type in this assembly from
18+
// COM, set the ComVisible attribute to true on that type.
19+
[assembly: ComVisible(false)]
20+
21+
// The following GUID is for the ID of the typelib if this project is exposed to COM
22+
[assembly: Guid("76bbfaa8-01e4-4a41-af8f-f4be7269f640")]
23+
24+
// Version information for an assembly consists of the following four values:
25+
//
26+
// Major Version
27+
// Minor Version
28+
// Build Number
29+
// Revision
30+
//
31+
// You can specify all the values or you can default the Build and Revision Numbers
32+
// by using the '*' as shown below:
33+
// [assembly: AssemblyVersion("1.0.*")]
34+
[assembly: AssemblyVersion("1.0.0")]
35+
[assembly: AssemblyFileVersion("1.0.0")]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using Microsoft.Azure.Commands.ManagedServiceIdentity.Test;
2+
using Microsoft.WindowsAzure.Commands.ScenarioTest;
3+
using Xunit;
4+
using Microsoft.Azure.ServiceManagemenet.Common.Models;
5+
using Microsoft.WindowsAzure.Commands.Test.Utilities.Common;
6+
7+
namespace Microsoft.Azure.Commands.ManagedServiceIdentity.Test.ScenarioTests
8+
{
9+
public class CrudTests : RMTestBase
10+
{
11+
public CrudTests(Xunit.Abstractions.ITestOutputHelper output)
12+
{
13+
var helper = new EnvironmentSetupHelper
14+
{
15+
TracingInterceptor =new XunitTracingInterceptor(output)
16+
};
17+
XunitTracingInterceptor.AddToContext(helper.TracingInterceptor);
18+
}
19+
20+
[Fact]
21+
[Trait(Category.AcceptanceType, Category.CheckIn)]
22+
public void TestCrud()
23+
{
24+
new TestController().RunPsTest("Test-CrudUserAssignedIdentity");
25+
}
26+
}
27+
}

0 commit comments

Comments
 (0)