Skip to content

FW: Adding cmdlets for creating and deleting AD application & service principal #87

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Jan 16, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
c77f6e8
FW: Adding cmdlets for creating and deleting AD application &
Jan 8, 2015
26273de
FW: Re-recording the Test-GetAzureADUserWithUPN.
Jan 8, 2015
7df1dc3
FW: Adressing comments from ogail. Using constructor to set default
Jan 9, 2015
1710cf5
FW: Adding cmdlets for creating and deleting AD application &
Jan 8, 2015
b2fa151
FW: Re-recording the Test-GetAzureADUserWithUPN.
Jan 8, 2015
5abe3be
FW: Adressing comments from ogail. Using constructor to set default
Jan 9, 2015
0f5b12b
Merge branch 'master' of https://github.com/perseusCode/azure-powershell
Jan 9, 2015
8db9886
FW: Adding Hyak.Common to Commands.Resources.proj as Jenkins complains
Jan 13, 2015
2de6931
FW: Adding cmdlets for creating and deleting AD application &
Jan 8, 2015
e7eff28
FW: Re-recording the Test-GetAzureADUserWithUPN.
Jan 8, 2015
0d56c55
FW: Adressing comments from ogail. Using constructor to set default
Jan 9, 2015
7819550
FW: Adding cmdlets for creating and deleting AD application &
Jan 8, 2015
471f0a0
FW: Getting rid of build and test failures after merge.
Jan 13, 2015
4ea884d
Merge branch 'master' of https://github.com/perseusCode/azure-powershell
Jan 13, 2015
d366494
FW: Adding cmdlets for creating and deleting AD application &
Jan 8, 2015
72442fb
FW: Re-recording the Test-GetAzureADUserWithUPN.
Jan 8, 2015
84726a0
FW: Adressing comments from ogail. Using constructor to set default
Jan 9, 2015
ba61a3c
FW: Adding cmdlets for creating and deleting AD application &
Jan 8, 2015
8901c05
FW: Adressing comments from ogail. Using constructor to set default
Jan 9, 2015
7d1b492
FW: Adding cmdlets for creating and deleting AD application &
Jan 8, 2015
a6f4a4f
FW: Getting rid of build and test failures after merge.
Jan 13, 2015
af3f5e5
Merge branch 'master' of https://github.com/perseusCode/azure-powershell
Jan 15, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\..\packages\xunit.runner.visualstudio.0.99.9-build1021\build\net20\xunit.runner.visualstudio.props" Condition="Exists('..\..\..\packages\xunit.runner.visualstudio.0.99.9-build1021\build\net20\xunit.runner.visualstudio.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
Expand All @@ -15,6 +16,7 @@
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\</SolutionDir>
<RestorePackages>true</RestorePackages>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<NuGetPackageImportStamp>944f727b</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<SignAssembly>true</SignAssembly>
Expand Down Expand Up @@ -376,6 +378,12 @@
<None Include="SessionRecords\Microsoft.Azure.Commands.Resources.Test.ScenarioTests.ActiveDirectoryTests\TestGetAllADUser.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.Resources.Test.ScenarioTests.ActiveDirectoryTests\TestNewADApplication.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.Resources.Test.ScenarioTests.ActiveDirectoryTests\TestNewADServicePrincipal.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.Resources.Test.ScenarioTests.RoleAssignmentTests\RaByResource.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down Expand Up @@ -423,6 +431,12 @@
<PropertyGroup>
<PostBuildEvent>xcopy "$(SolutionDir)Package\$(ConfigurationName)\*.*" $(TargetDir) /Y /E</PostBuildEvent>
</PropertyGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\..\packages\xunit.runner.visualstudio.0.99.9-build1021\build\net20\xunit.runner.visualstudio.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\xunit.runner.visualstudio.0.99.9-build1021\build\net20\xunit.runner.visualstudio.props'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,39 @@ public void TestGetADUserWithBadSearchString()
ResourcesController.NewInstance.RunPsTest("Test-GetADUserWithBadSearchString");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestNewADApplication()
{
ResourcesController.NewInstance.RunPsTest("Test-NewADApplication");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestNewADServicePrincipal()
{
const string scriptMethod = "Test-NewADServicePrincipal '{0}'";
Application application = null;
var controllerAdmin = ResourcesController.NewInstance;

controllerAdmin.RunPsTestWorkflow(
// scriptBuilder
() =>
{
application = CreateNewAdApp(controllerAdmin);
return new[] { string.Format(scriptMethod, application.AppId) };
},
// initialize
null,
// cleanup
() =>
{
DeleteAdApp(controllerAdmin, application);
},
TestUtilities.GetCallingClass(),
TestUtilities.GetCurrentMethodName());
}

private User CreateNewAdUser(ResourcesController controllerAdmin)
{
var name = TestUtilities.GenerateName("aduser");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -432,3 +432,37 @@ function Test-GetADUserWithBadSearchString
# Assert
Assert-Null($users)
}

<#
.SYNOPSIS
Tests Creating and deleting application.
#>
function Test-NewADApplication
{
# Setup
$displayName = getAssetName
$homePage = "http://" + $displayName + ".com"
$identifierUri = "http://" + $displayName

# Test
$application = New-AzureADApplication -DisplayName $displayName -HomePage $homePage -IdentifierUris $identifierUri

# Assert
Assert-NotNull $application
}

<#
.SYNOPSIS
Tests Creating and deleting service principal.
#>
function Test-NewADServicePrincipal
{
param([string]$applicationId)

# Test
$servicePrincipal = New-AzureADServicePrincipal -ApplicationId $applicationId

# Assert
Assert-NotNull $servicePrincipal
}

Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@ function Get-ProviderLocation($provider)
}
}

<#
.SYNOPSIS
Gets valid application display name
#>
function Get-ApplicatonDisplayName
{
return getAssetName
}

<#
.SYNOPSIS
Cleans the created resource groups
Expand Down
Loading