Skip to content

Commit 2429501

Browse files
Merge branch 'vnext' into mergebranch
2 parents 61d5531 + fcf7fad commit 2429501

File tree

12 files changed

+2154
-875
lines changed

12 files changed

+2154
-875
lines changed

CanaryValidator/Canary.Tests.ps1

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ param (
104104
[parameter(HelpMessage="List of usecases to be excluded from execution")]
105105
[Parameter(ParameterSetName="default", Mandatory=$false)]
106106
[Parameter(ParameterSetName="tenant", Mandatory=$false)]
107-
[string[]]$ExclusionList = ("GetAzureStackInfraRoleInstance", "DeleteSubscriptionResourceGroup"),
107+
[string[]]$ExclusionList = ("GetAzureStackInfraRoleInstance", "DeleteSubscriptionResourceGroup", "QueryImagesFromPIR", "DeployARMTemplate", "RetrieveResourceDeploymentTimes", "QueryTheVMsDeployed", "CheckVMCommunicationPreVMReboot", "TransmitMTUSizedPacketsBetweenTenantVMs", "AddDatadiskToVMWithPrivateIP", "ApplyDataDiskCheckCustomScriptExtensionToVMWithPrivateIP", "RestartVMWithPublicIP", "StopDeallocateVMWithPrivateIP", "StartVMWithPrivateIP", "CheckVMCommunicationPostVMReboot", "CheckExistenceOfScreenShotForVMWithPrivateIP", "DeleteVMWithPrivateIP"),
108108
[parameter(HelpMessage="Lists the available usecases in Canary")]
109109
[Parameter(ParameterSetName="listavl", Mandatory=$true)]
110110
[ValidateNotNullOrEmpty()]
@@ -319,7 +319,7 @@ while ($runCount -le $NumberOfIterations)
319319
$CustomVHDPath = CopyImage -ImagePath $LinuxImagePath -OutputFolder $CanaryCustomImageFolder
320320
Add-AzsVMImage -publisher $linuxImagePublisher -offer $linuxImageOffer -sku $LinuxOSSku -version $linuxImageVersion -osDiskLocalPath $CustomVHDPath -osType Linux -Location $ResourceLocation -CreateGalleryItem $false
321321
Remove-Item $CanaryCustomImageFolder -Force -Recurse
322-
$linuxUpload = $true
322+
Set-Variable -Name linuxUpload -Value $true -Scope 1
323323
}
324324
}
325325
catch
@@ -408,7 +408,7 @@ while ($runCount -le $NumberOfIterations)
408408
if ($asTenantSubscription)
409409
{
410410
Get-AzureRmSubscription -SubscriptionName $asTenantSubscription.DisplayName | Select-AzureRmSubscription -ErrorAction Stop
411-
}
411+
}
412412
}
413413

414414
Invoke-Usecase -Name 'RoleAssignmentAndCustomRoleDefinition' -Description "Assign a reader role and create a custom role definition" -UsecaseBlock `
@@ -765,8 +765,8 @@ while ($runCount -le $NumberOfIterations)
765765
}
766766
$osVersion, $linuxImgExists
767767
}
768-
[string]$osVersion = $pirQueryRes[2]
769-
[boolean]$linuxImgExists = $pirQueryRes[3]
768+
#[string]$osVersion = $pirQueryRes[2]
769+
#[boolean]$linuxImgExists = $pirQueryRes[3]
770770

771771
Invoke-Usecase -Name 'DeployARMTemplate' -Description "Deploy ARM template to setup the virtual machines" -UsecaseBlock `
772772
{
@@ -1166,13 +1166,13 @@ while ($runCount -le $NumberOfIterations)
11661166

11671167
Invoke-Usecase -Name 'RemoveLinuxImageFromPIR' -Description "Remove the Linux image uploaded during setup from the Platform Image Respository" -UsecaseBlock `
11681168
{
1169-
if (Get-AzureRmVMImage -Location $ResourceLocation -PublisherName $linuxImagePublisher -Offer $linuxImageOffer -Sku $LinuxOSSku -ErrorAction SilentlyContinue)
1169+
if ((Get-AzureRmVMImage -Location $ResourceLocation -PublisherName $linuxImagePublisher -Offer $linuxImageOffer -Sku $LinuxOSSku -ErrorAction SilentlyContinue) -and ($linuxUpload))
11701170
{
11711171
Remove-AzsVMImage -publisher $linuxImagePublisher -offer $linuxImageOffer -sku $LinuxOSSku -version $linuxImageVersion -Location $ResourceLocation -Force
11721172
}
11731173
}
11741174
Invoke-Usecase -Name 'DeleteSubscriptionResourceGroup' -Description "Delete the resource group that contains subscription resources" -UsecaseBlock `
1175-
{
1175+
{
11761176
if ($removeRG = Get-AzureRmResourceGroup -Name $subscriptionRGName -ErrorAction Stop)
11771177
{
11781178
$removeRG | Remove-AzureRmResourceGroup -Force -ErrorAction Stop
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Azure Stack Datacenter Integration Helper Scripts
2+
3+
These tools are meant to help customers integrate Azure Stack into their Datacenter. Datacenter integration of Azure Stack does require configuration changes on existing infrastructure services which are not touched by Azure Stack's automation. These scripts are meant to help to simplify and reduce failures.
4+
5+
6+
## AD FS integration
7+
8+
Configure AD FS relying Party Trust including claim transformation rules
9+
10+
11+
---
12+
_This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [[email protected]](mailto:[email protected]) with any additional questions or comments._
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
@RuleTemplate = "LdapClaims"
2+
@RuleName = "Name claim"
3+
c:[Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname", Issuer == "AD AUTHORITY"]
4+
=> issue(store = "Active Directory", types = ("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name"), query = ";userPrincipalName;{0}", param = c.Value);
5+
6+
@RuleTemplate = "LdapClaims"
7+
@RuleName = "UPN claim"
8+
c:[Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname", Issuer == "AD AUTHORITY"]
9+
=> issue(store = "Active Directory", types = ("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn"), query = ";userPrincipalName;{0}", param = c.Value);
10+
11+
@RuleTemplate = "LdapClaims"
12+
@RuleName = "ObjectID claim"
13+
c:[Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/primarysid"]
14+
=> issue(Type = "http://schemas.microsoft.com/identity/claims/objectidentifier", Issuer = c.Issuer, OriginalIssuer = c.OriginalIssuer, Value = c.Value, ValueType = c.ValueType);
15+
16+
@RuleName = "Family Name and Given claim"
17+
c:[Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname", Issuer == "AD AUTHORITY"]
18+
=> issue(store = "Active Directory", types = ("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname", "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname"), query = ";sn,givenName;{0}", param = c.Value);
19+
20+
@RuleTemplate = "PassThroughClaims"
21+
@RuleName = "Pass through all Group SID claims"
22+
c:[Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid", Issuer =~ "^(AD AUTHORITY|SELF AUTHORITY|LOCAL AUTHORITY)$"]
23+
=> issue(claim = c);
24+
25+
@RuleTemplate = "PassThroughClaims"
26+
@RuleName = "Pass through all windows account name claims"
27+
c:[Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname"]
28+
=> issue(claim = c);

DatacenterIntegration/Identity/setupadfs.ps1

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Copyright (c) Microsoft Corporation. All rights reserved.
2+
# See LICENSE.txt in the project root for license information.
3+
4+
<#
5+
 
6+
.SYNOPSIS 
7+
 
8+
Configures existing AD FS for Azure Stack
9+
 
10+
.DESCRIPTION 
11+
 
12+
It will create a relying Party Trust to Azure Stack's AD FS with the necessary rules. It will also turn on form based authentication and Enable as setting to support Edge
13+
 
14+
.PARAMETER ExternalDNSZoneSpecify the Extnerl Dns Zone of Azure Stack which was also provided for initial deployment.EXAMPLE .\setupadfs.ps1 -externaldnszone local.azurestack.external#>Param( [string]$ExternalDNSZone)
15+
$currentPath = $PSScriptRoot
16+
17+
#Create Endpoint
18+
$VIP="adfs.$ExternalDnsZone"
19+
20+
#Verify if Endpoint is reachable
21+
Write-Host "Validate AD FS Endpoint if reachable"
22+
$Validator1=Test-NetConnection -ComputerName $VIP -Port 443
23+
IF ($Validator1.TcpTestSucceeded -ne $true){
24+
Write-Host "Check you DNS Integration with Azure Stack Error "$Validator1.TcpTestSucceeded ""
25+
Exit}
26+
else{
27+
Write-host "Status "$Validator1.TcpTestSucceeded""
28+
#Create Metadata URL
29+
$MetadataURL= "https://$VIP/FederationMetadata/2007-06/FederationMetadata.xml"
30+
31+
#Verify Metadata URL
32+
Write-Host "Validate AD FS Metadata URL"
33+
$Validator2=Invoke-WebRequest $MetadataURL
34+
If ($Validator2.StatusCode -ne 200){
35+
Write-Host "Metadata URL could not be retrived Error "$Validator2.StatusCode""
36+
Exit}
37+
else{
38+
Write-Host "Status "$Validator2.StatusCode""
39+
40+
#Determine Windows Version
41+
$WindowsVersion= [environment]::OSVersion.Version
42+
43+
#Configure Relying Party Trust
44+
If ($WindowsVersion.Build -lt 14393) {
45+
46+
#Must be 2012 or 2012 R2
47+
Add-ADFSRelyingPartyTrust -Name AzureStack -MetadataUrl $MetadataURL -IssuanceTransformRulesFile ($currentPath + '\claimrules.txt') -AutoUpdateEnabled:$true -MonitoringEnabled:$true -enabled:$true
48+
}
49+
else{
50+
#Must be 2016
51+
Add-ADFSRelyingPartyTrust -Name AzureStack -MetadataUrl $MetadataURL -IssuanceTransformRulesFile ($currentPath + '\claimrules.txt') -AutoUpdateEnabled:$true -MonitoringEnabled:$true -enabled:$true -AccessControlPolicyName Permit everyone
52+
53+
54+
#Enable Form Based Authentication
55+
Set-AdfsProperties -WIASupportedUserAgents @("MSAuthHost/1.0/In-Domain","MSIPC","Windows Rights Management Client","Kloud")
56+
57+
#Enable Supprt for Edge Browser
58+
Set-AdfsProperties -IgnoreTokenBinding $true
59+
}
60+
}
61+
}

0 commit comments

Comments
 (0)