@@ -184,9 +184,9 @@
-
+
-
+
@@ -247,7 +247,7 @@
-
+
@@ -301,7 +301,7 @@
-
+
|
-
+
-
+
@@ -348,7 +348,7 @@
--%>
-
+
@@ -361,7 +361,7 @@
-
+
diff --git a/LDAPCP/ADMIN/LDAPCP/GlobalSettings.ascx.cs b/LDAPCP/ADMIN/LDAPCP/GlobalSettings.ascx.cs
index 93d3def..94d44d5 100644
--- a/LDAPCP/ADMIN/LDAPCP/GlobalSettings.ascx.cs
+++ b/LDAPCP/ADMIN/LDAPCP/GlobalSettings.ascx.cs
@@ -330,7 +330,13 @@ void AddLdapConnection()
if (this.RbUseServerDomain.Checked)
{
- PersistedObject.LDAPConnectionsProp.Add(new LDAPConnection { UseSPServerConnectionToAD = true });
+ PersistedObject.LDAPConnectionsProp.Add(
+ new LDAPConnection
+ {
+ UseSPServerConnectionToAD = true ,
+ EnableAugmentation = true,
+ }
+ );
}
else
{
@@ -343,6 +349,7 @@ void AddLdapConnection()
LDAPUsername = this.TxtLdapUsername.Text,
LDAPPassword = this.TxtLdapPassword.Text,
AuthenticationSettings = authNType,
+ EnableAugmentation = true,
}
);
}
diff --git a/LDAPCP/LDAPCP.AdminLinks/Elements.xml b/LDAPCP/LDAPCP.AdminLinks/Elements.xml
index 796c7a2..8cc3681 100644
--- a/LDAPCP/LDAPCP.AdminLinks/Elements.xml
+++ b/LDAPCP/LDAPCP.AdminLinks/Elements.xml
@@ -25,4 +25,13 @@
Sequence="20">
+
+
+
+
diff --git a/LDAPCP/LDAPCP.cs b/LDAPCP/LDAPCP.cs
index 63c7365..affefb5 100644
--- a/LDAPCP/LDAPCP.cs
+++ b/LDAPCP/LDAPCP.cs
@@ -1365,7 +1365,25 @@ protected virtual List GetGroupsFromActiveDirectory(LDAPConnection ldap
foreach (Principal adGroup in adGroups)
{
string groupDomainName, groupDomainFqdn;
- string claimValue = adGroup.Name;
+
+ // https://github.com/Yvand/LDAPCP/issues/148 - the group property used for the group value should be based on the LDAPCP configuration
+ // By default it should be the SamAccountName, since it's also the default attribute set in LDAPCP configuration
+ string claimValue = adGroup.SamAccountName;
+ switch (groupCTConfig.LDAPAttribute.ToLower())
+ {
+ case "name":
+ claimValue = adGroup.Name;
+ break;
+
+ case "distinguishedname":
+ claimValue = adGroup.DistinguishedName;
+ break;
+
+ case "samaccountname":
+ claimValue = adGroup.SamAccountName;
+ break;
+ }
+
if (!String.IsNullOrEmpty(groupCTConfig.ClaimValuePrefix))
{
// Principal.DistinguishedName is used to build the domain name / FQDN of the current group. Example of value: CN=group1,CN=Users,DC=contoso,DC=local
@@ -1375,11 +1393,11 @@ protected virtual List GetGroupsFromActiveDirectory(LDAPConnection ldap
OperationContext.GetDomainInformation(groupDN, out groupDomainName, out groupDomainFqdn);
if (groupCTConfig.ClaimValuePrefix.Contains(ClaimsProviderConstants.LDAPCPCONFIG_TOKENDOMAINNAME))
{
- claimValue = groupCTConfig.ClaimValuePrefix.Replace(ClaimsProviderConstants.LDAPCPCONFIG_TOKENDOMAINNAME, groupDomainName) + adGroup.Name;
+ claimValue = groupCTConfig.ClaimValuePrefix.Replace(ClaimsProviderConstants.LDAPCPCONFIG_TOKENDOMAINNAME, groupDomainName) + claimValue;
}
else if (groupCTConfig.ClaimValuePrefix.Contains(ClaimsProviderConstants.LDAPCPCONFIG_TOKENDOMAINFQDN))
{
- claimValue = groupCTConfig.ClaimValuePrefix.Replace(ClaimsProviderConstants.LDAPCPCONFIG_TOKENDOMAINFQDN, groupDomainFqdn) + adGroup.Name;
+ claimValue = groupCTConfig.ClaimValuePrefix.Replace(ClaimsProviderConstants.LDAPCPCONFIG_TOKENDOMAINFQDN, groupDomainFqdn) + claimValue;
}
}
diff --git a/LDAPCP/LDAPCP.csproj b/LDAPCP/LDAPCP.csproj
index 01f555b..d74b886 100644
--- a/LDAPCP/LDAPCP.csproj
+++ b/LDAPCP/LDAPCP.csproj
@@ -134,6 +134,6 @@
- "C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.7.2 Tools\x64\gacutil.exe" /f /i "$(TargetPath)"
+ "C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\gacutil.exe" /f /i "$(TargetPath)"
\ No newline at end of file
diff --git a/LDAPCP/LDAPCPConfig.cs b/LDAPCP/LDAPCPConfig.cs
index d9ed608..7d6d84c 100644
--- a/LDAPCP/LDAPCPConfig.cs
+++ b/LDAPCP/LDAPCPConfig.cs
@@ -598,7 +598,10 @@ public static List ReturnDefaultLDAPConnection()
{
return new List
{
- new LDAPConnection{UseSPServerConnectionToAD = true}
+ new LDAPConnection{
+ UseSPServerConnectionToAD = true,
+ EnableAugmentation = true,
+ }
};
}
@@ -1247,10 +1250,11 @@ public static void GetDomainInformation(string distinguishedName, out string dom
{
StringBuilder sbDomainFQDN = new StringBuilder();
domainName = String.Empty;
- if (distinguishedName.Contains("DC="))
+ // String search in distinguishedName should not be case sensitive - https://github.com/Yvand/LDAPCP/issues/147
+ if (distinguishedName.IndexOf("DC=", StringComparison.InvariantCultureIgnoreCase) >= 0)
{
int start = distinguishedName.IndexOf("DC=", StringComparison.InvariantCultureIgnoreCase);
- string[] dnSplitted = distinguishedName.Substring(start).Split(new string[] { "DC=" }, StringSplitOptions.RemoveEmptyEntries);
+ string[] dnSplitted = distinguishedName.Substring(start).ToLower().Split(new string[] { "dc=" }, StringSplitOptions.RemoveEmptyEntries);
bool setDomainName = true;
foreach (string dc in dnSplitted)
{
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
deleted file mode 100644
index 7a79e10..0000000
--- a/azure-pipelines.yml
+++ /dev/null
@@ -1,398 +0,0 @@
-name: $(BuildVersion).$(date:yyyyMMdd).$(Build.BuildId)
-resources:
-- repo: self
-variables:
- BuildPlatform: 'Any CPU'
- SolutionFileName: 'LDAPCP.sln'
- ProductDescription: 'This claims provider connects SharePoint with Active Directory and LDAP servers to provide a great search experience in the people picker with federated authentication'
-jobs:
-- job: Compile
- strategy:
- maxParallel: 2
- matrix:
- debugJob:
- configuration: debug
- platform: $(BuildPlatform)
- releaseJob:
- configuration: release
- platform: $(BuildPlatform)
- displayName: Compile
- pool:
- name: Hosted VS2017
- demands:
- - msbuild
- - visualstudio
- - azureps
- steps:
- - task: DownloadSecureFile@1
- displayName: 'Download signing key'
- inputs:
- secureFile: '$(SigningKeySecureFileID)'
-
- - powershell: |
- # Set variables
- $azureStorageBaseDirectory = "Resources\$(system.teamProject)"
- $projectLocalPath = "$(System.DefaultWorkingDirectory)\$(system.teamProject)"
- $devTestLabsLocalPath = "$(Build.ArtifactStagingDirectory)\DevTestLabs"
- $buildResourcesLocalPath = "$(Build.ArtifactStagingDirectory)\BuildPipeline"
-
- # Create the DevTestLabs directory if it doesn't exist
- if ((Test-Path -Path $devTestLabsLocalPath -PathType Container) -eq $false) {
- New-Item -ItemType Directory -Path $devTestLabsLocalPath
- }
-
- # Create the Build pipeline directory if it doesn't exist
- if ((Test-Path -Path $buildResourcesLocalPath -PathType Container) -eq $false) {
- New-Item -ItemType Directory -Path $buildResourcesLocalPath
- }
-
- Write-Output ("Copy files to build $(system.teamProject) from Azure storage account")
- $azureContext = New-AzureStorageContext $(AzureStorageAccountName) $(AzureStorageAccountKey)
- $azureShare = Get-AzureStorageShare $(AzureStorageShareName) –Context $azureContext
- #Get-AzureStorageFileContent –Share $azureShare –Path "$azureStorageBaseDirectory\$(system.teamProject).snk" "$projectLocalPath\$(system.teamProject).snk"
- Write-Output ("Copy signing key from $(DownloadSecureFile.secureFilePath) to $projectLocalPath")
- Copy-Item "$(DownloadSecureFile.secureFilePath)" -Destination "$projectLocalPath"
- Get-AzureStorageFileContent –Share $azureShare –Path "$azureStorageBaseDirectory\SharePoint 2013\Microsoft.SharePoint.dll" "$projectLocalPath\Microsoft.SharePoint.dll"
-
- Write-Output ("Copy DevTestLabs content from Azure storage account")
- $azurePath = Join-Path -Path $azureStorageBaseDirectory -ChildPath "DevTestLabs"
- Get-AzureStorageFile -ShareName $(AzureStorageShareName) -Context $azureContext -Path $azurePath | Get-AzureStorageFile | ?{$_.GetType().Name -eq "CloudFile"} | Get-AzureStorageFileContent -Destination $devTestLabsLocalPath
-
- Write-Output ("Copy BuildResources content from Azure storage account")
- $azurePath = Join-Path -Path $azureStorageBaseDirectory -ChildPath "BuildPipeline"
- Get-AzureStorageFile -ShareName $(AzureStorageShareName) -Context $azureContext -Path $azurePath | Get-AzureStorageFile | ? {$_.GetType().Name -eq "CloudFile"} | Get-AzureStorageFileContent -Destination $buildResourcesLocalPath
-
- Write-Output ("Add assembly Microsoft.SharePoint.dll to the GAC")
- [System.Reflection.Assembly]::Load("System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
- $publish = New-Object System.EnterpriseServices.Internal.Publish
- $publish.GacInstall("$projectLocalPath\Microsoft.SharePoint.dll")
-
- displayName: 'Import resources from Azure storage account'
- - task: NuGetToolInstaller@0
- displayName: 'Use NuGet 4.4.1'
- inputs:
- versionSpec: 4.4.1
-
- - task: NuGetCommand@2
- displayName: 'NuGet restore'
- inputs:
- restoreSolution: '$(SolutionFileName)'
-
- - task: bleddynrichards.Assembly-Info-Task.Assembly-Info-Task.Assembly-Info-NetFramework@2
- displayName: 'Set $(system.teamProject) assemblies manifest'
- inputs:
- FileNames: '**\AssemblyInfo.cs'
- Title: $(system.teamProject)
- Product: $(system.teamProject)
- Description: '$(ProductDescription)'
- Company: GitHub.com/Yvand
- Copyright: 'Copyright © $(date:YYYY) Yvan Duhamel, All rights reserved'
- Trademark: '$(system.teamProject)'
- VersionNumber: 1.0.0.0
- FileVersionNumber: '$(Build.BuildNumber)'
- InformationalVersion: '$(Build.BuildNumber)'
-
- - task: VSBuild@1
- displayName: 'Build $(system.teamProject) solution'
- inputs:
- solution: '$(SolutionFileName)'
- msbuildArgs: '/p:IsPackaging=true'
- platform: '$(BuildPlatform)'
- configuration: '$(configuration)'
- msbuildArchitecture: x64
-
- - task: CopyFiles@2
- displayName: 'Copy binaries to artifacts'
- inputs:
- SourceFolder: '$(Build.SourcesDirectory)'
- Contents: |
- $(system.teamProject)/bin/$(configuration)/?($(system.teamProject).*)
- $(system.teamProject).Tests/bin/$(configuration)/?(*.dll)
- TargetFolder: '$(Build.ArtifactStagingDirectory)'
-
- - task: PublishBuildArtifacts@1
- displayName: 'Publish Artifact: drop'
- inputs:
- pathtoPublish: '$(Build.ArtifactStagingDirectory)'
- artifactName: drop
-
-- job: CreateTestEnvironment
- displayName: Create test environment
- timeoutInMinutes: 90
- pool:
- name: Hosted VS2017
- steps:
- - checkout: none #skip checking out the default repository resource
- - task: ms-azuredevtestlabs.tasks.azure-dtl-task-createEnvironment.AzureDevTestLabsCreateEnvironment@1
- displayName: 'Create Azure DevTest Labs Environment'
- inputs:
- ConnectedServiceName: '$(Test.AzureConnectionName)'
- LabId: '/subscriptions/$(Test.AzureSubscriptionId)/resourceGroups/$(Test.DevTestLabName)/providers/Microsoft.DevTestLab/labs/$(Test.DevTestLabName)'
- RepositoryId: '/subscriptions/$(Test.AzureSubscriptionId)/resourcegroups/$(Test.DevTestLabName)/providers/microsoft.devtestlab/labs/$(Test.DevTestLabName)/artifactsources/privaterepo897'
- TemplateId: '/subscriptions/$(Test.AzureSubscriptionId)/resourceGroups/$(Test.DevTestLabName)/providers/Microsoft.DevTestLab/labs/$(Test.DevTestLabName)/artifactSources/privaterepo897/armTemplates/SharePoint-ADFS-DevTestLabs'
- EnvironmentName: 'IntegrationTests'
- ParameterOverrides: "-location 'west europe' -provisionSharePoint2013 '$(Test.ProvisionSharePoint2013)' -provisionSharePoint2016 '$(Test.ProvisionSharePoint2016)' -provisionSharePoint2019 '$(Test.ProvisionSharePoint2019)' -enableHybridBenefitServerLicenses 'Yes' -adminUserName '$(Test.AdminUserName)' -adminPassword '$(Test.AdminPassword)' -serviceAccountsPassword '$(Test.ServiceAccountsPassword)'"
- TemplateOutputVariables: true
- ExportEnvironmentTemplate: true
- timeoutInMinutes: 90
-
-- job: ApplyArtifactsSP2013
- condition: and(succeeded(), eq(variables['Test.ProvisionSharePoint2013'], 'yes'))
- dependsOn:
- - Compile
- - CreateTestEnvironment
- displayName: Apply artifacts on SP2013
- timeoutInMinutes: 30
- variables:
- jobSharePointVersion: 2013
- pool:
- name: Hosted VS2017
- steps:
- - checkout: none #skip checking out the default repository resource
- - task: DownloadBuildArtifacts@0
- displayName: 'Download Build Artifacts'
- inputs:
- artifactName: drop
- downloadPath: $(Build.ArtifactStagingDirectory)
-
- - task: AzurePowerShell@3
- displayName: 'Apply artifact 7-zip'
- inputs:
- azureSubscription: '$(Test.AzureConnectionName)'
- ScriptPath: '$(Build.ArtifactStagingDirectory)\drop\BuildPipeline\DevTestLab_ApplyArtifact.ps1'
- ScriptArguments: '-DevTestLabName "$(Test.DevTestLabName)" -VirtualMachineName "SP$(jobSharePointVersion)" -RepositoryName "Public Repo" -ArtifactName "windows-7zip"'
- preferredAzurePowerShellVersion: 5.1.1
- enabled: false
-
- - task: AzurePowerShell@3
- displayName: 'Apply artifact "Azure Pipelines Agent"'
- inputs:
- azureSubscription: '$(Test.AzureConnectionName)'
- ScriptPath: '$(Build.ArtifactStagingDirectory)\drop\BuildPipeline\DevTestLab_ApplyArtifact.ps1'
- ScriptArguments: '-DevTestLabName "$(Test.DevTestLabName)" -VirtualMachineName "SP$(jobSharePointVersion)" -RepositoryName "Yvand/AzureRM-Templates" -ArtifactName "windows-vsts-build-agent" -param_vstsAccount "$(Test.DevOpsOrganizationName)" -param_vstsPassword "$(AccessTokenDevOpsYvand)" -param_poolName "$(system.teamProject)-Tests-$(jobSharePointVersion)" -param_windowsLogonAccount "$(Test.Domain)\$(Test.AdminUserName)" -param_windowsLogonPassword "$(Test.AdminPassword)" -param_agentName "SP$(jobSharePointVersion)" -param_agentNameSuffix "-$(Build.BuildNumber)" -param_RunAsAutoLogon false -param_driveLetter C -param_workDirectory ""'
- preferredAzurePowerShellVersion: 5.1.1
-
- - task: AzurePowerShell@3
- displayName: 'Apply artifact "Download Azure Pipelines Artifact and Run Script"'
- inputs:
- azureSubscription: '$(Test.AzureConnectionName)'
- ScriptPath: '$(Build.ArtifactStagingDirectory)\drop\BuildPipeline\DevTestLab_ApplyArtifact.ps1'
- ScriptArguments: -DevTestLabName '$(Test.DevTestLabName)' -VirtualMachineName 'SP$(jobSharePointVersion)' -RepositoryName 'Yvand/AzureRM-Templates' -ArtifactName 'windows-vsts-download-and-run-script' -param_vstsProjectUri 'https://dev.azure.com/$(Test.DevOpsOrganizationName)/$(system.teamProject)' -param_buildDefinitionName '$(Build.DefinitionName)' -param_personalAccessToken $(AccessTokenDevOpsYvand) -param_pathToScript 'drop\SPTestServer artifacts\ConfigureLab.ps1' -param_scriptArguments "-pathToPackage ''..\$(system.teamProject)\bin\$(BuildConfiguration)\$(system.teamProject).wsp' -claimsProviderName '$(system.teamProject)' -spTrustName '$(Test.DomainFQDN)' -adminUserName '$(Test.Domain)\$(Test.AdminUserName)' -adminPassword '$(Test.AdminPassword)'"
- preferredAzurePowerShellVersion: 5.1.1
-
- - task: ms-azuredevtestlabs.tasks.azure-dtl-task-deleteEnvironment.AzureDevTestLabsDeleteEnvironment@1
- displayName: 'Delete Azure DevTest Labs deployed in previous task'
- inputs:
- ConnectedServiceName: '$(Test.AzureConnectionName)'
- LabId: '/subscriptions/$(Test.AzureSubscriptionId)/resourceGroups/$(Test.DevTestLabName)/providers/Microsoft.DevTestLab/labs/$(Test.DevTestLabName)'
- EnvironmentId: '$(BaseEnv.environmentResourceId)'
- enabled: false
-
-- job: ApplyArtifactsSP2016
- condition: and(succeeded(), eq(variables['Test.ProvisionSharePoint2016'], 'yes'))
- dependsOn:
- - Compile
- - CreateTestEnvironment
- displayName: Apply artifacts on SP2016
- timeoutInMinutes: 30
- variables:
- jobSharePointVersion: 2016
- pool:
- name: Hosted VS2017
- steps:
- - checkout: none #skip checking out the default repository resource
- - task: DownloadBuildArtifacts@0
- displayName: 'Download Build Artifacts'
- inputs:
- artifactName: drop
- downloadPath: $(Build.ArtifactStagingDirectory)
-
- - task: AzurePowerShell@3
- displayName: 'Apply artifact 7-zip'
- inputs:
- azureSubscription: '$(Test.AzureConnectionName)'
- ScriptPath: '$(Build.ArtifactStagingDirectory)\drop\BuildPipeline\DevTestLab_ApplyArtifact.ps1'
- ScriptArguments: '-DevTestLabName "$(Test.DevTestLabName)" -VirtualMachineName "SP$(jobSharePointVersion)" -RepositoryName "Public Repo" -ArtifactName "windows-7zip"'
- preferredAzurePowerShellVersion: 5.1.1
- enabled: false
-
- - task: AzurePowerShell@3
- displayName: 'Apply artifact "Azure Pipelines Agent"'
- inputs:
- azureSubscription: '$(Test.AzureConnectionName)'
- ScriptPath: '$(Build.ArtifactStagingDirectory)\drop\BuildPipeline\DevTestLab_ApplyArtifact.ps1'
- ScriptArguments: '-DevTestLabName "$(Test.DevTestLabName)" -VirtualMachineName "SP$(jobSharePointVersion)" -RepositoryName "Yvand/AzureRM-Templates" -ArtifactName "windows-vsts-build-agent" -param_vstsAccount "$(Test.DevOpsOrganizationName)" -param_vstsPassword "$(AccessTokenDevOpsYvand)" -param_poolName "$(system.teamProject)-Tests-$(jobSharePointVersion)" -param_windowsLogonAccount "$(Test.Domain)\$(Test.AdminUserName)" -param_windowsLogonPassword "$(Test.AdminPassword)" -param_agentName "SP$(jobSharePointVersion)" -param_agentNameSuffix "-$(Build.BuildNumber)" -param_RunAsAutoLogon false -param_driveLetter C -param_workDirectory ""'
- preferredAzurePowerShellVersion: 5.1.1
-
- - task: AzurePowerShell@3
- displayName: 'Apply artifact "Download Azure Pipelines Artifact and Run Script"'
- inputs:
- azureSubscription: '$(Test.AzureConnectionName)'
- ScriptPath: '$(Build.ArtifactStagingDirectory)\drop\BuildPipeline\DevTestLab_ApplyArtifact.ps1'
- ScriptArguments: -DevTestLabName '$(Test.DevTestLabName)' -VirtualMachineName 'SP$(jobSharePointVersion)' -RepositoryName 'Yvand/AzureRM-Templates' -ArtifactName 'windows-vsts-download-and-run-script' -param_vstsProjectUri 'https://dev.azure.com/$(Test.DevOpsOrganizationName)/$(system.teamProject)' -param_buildDefinitionName '$(Build.DefinitionName)' -param_personalAccessToken $(AccessTokenDevOpsYvand) -param_pathToScript 'drop\SPTestServer artifacts\ConfigureLab.ps1' -param_scriptArguments "-pathToPackage ''..\$(system.teamProject)\bin\$(BuildConfiguration)\$(system.teamProject).wsp' -claimsProviderName '$(system.teamProject)' -spTrustName '$(Test.DomainFQDN)' -adminUserName '$(Test.Domain)\$(Test.AdminUserName)' -adminPassword '$(Test.AdminPassword)'"
- preferredAzurePowerShellVersion: 5.1.1
-
- - task: ms-azuredevtestlabs.tasks.azure-dtl-task-deleteEnvironment.AzureDevTestLabsDeleteEnvironment@1
- displayName: 'Delete Azure DevTest Labs deployed in previous task'
- inputs:
- ConnectedServiceName: '$(Test.AzureConnectionName)'
- LabId: '/subscriptions/$(Test.AzureSubscriptionId)/resourceGroups/$(Test.DevTestLabName)/providers/Microsoft.DevTestLab/labs/$(Test.DevTestLabName)'
- EnvironmentId: '$(BaseEnv.environmentResourceId)'
- enabled: false
-
-- job: ApplyArtifactsSP2019
- condition: and(succeeded(), eq(variables['Test.ProvisionSharePoint2019'], 'yes'))
- dependsOn:
- - Compile
- - CreateTestEnvironment
- displayName: Apply artifacts on SP2019
- timeoutInMinutes: 30
- variables:
- jobSharePointVersion: 2019
- pool:
- name: Hosted VS2017
- steps:
- - checkout: none #skip checking out the default repository resource
- - task: DownloadBuildArtifacts@0
- displayName: 'Download Build Artifacts'
- inputs:
- artifactName: drop
- downloadPath: $(Build.ArtifactStagingDirectory)
-
- - task: AzurePowerShell@3
- displayName: 'Apply artifact 7-zip'
- inputs:
- azureSubscription: '$(Test.AzureConnectionName)'
- ScriptPath: '$(Build.ArtifactStagingDirectory)\drop\BuildPipeline\DevTestLab_ApplyArtifact.ps1'
- ScriptArguments: '-DevTestLabName "$(Test.DevTestLabName)" -VirtualMachineName "SP$(jobSharePointVersion)" -RepositoryName "Public Repo" -ArtifactName "windows-7zip"'
- preferredAzurePowerShellVersion: 5.1.1
- enabled: false
-
- - task: AzurePowerShell@3
- displayName: 'Apply artifact "Azure Pipelines Agent"'
- inputs:
- azureSubscription: '$(Test.AzureConnectionName)'
- ScriptPath: '$(Build.ArtifactStagingDirectory)\drop\BuildPipeline\DevTestLab_ApplyArtifact.ps1'
- ScriptArguments: '-DevTestLabName "$(Test.DevTestLabName)" -VirtualMachineName "SP$(jobSharePointVersion)" -RepositoryName "Yvand/AzureRM-Templates" -ArtifactName "windows-vsts-build-agent" -param_vstsAccount "$(Test.DevOpsOrganizationName)" -param_vstsPassword "$(AccessTokenDevOpsYvand)" -param_poolName "$(system.teamProject)-Tests-$(jobSharePointVersion)" -param_windowsLogonAccount "$(Test.Domain)\$(Test.AdminUserName)" -param_windowsLogonPassword "$(Test.AdminPassword)" -param_agentName "SP$(jobSharePointVersion)" -param_agentNameSuffix "-$(Build.BuildNumber)" -param_RunAsAutoLogon false -param_driveLetter C -param_workDirectory ""'
- preferredAzurePowerShellVersion: 5.1.1
-
- - task: AzurePowerShell@3
- displayName: 'Apply artifact "Download Azure Pipelines Artifact and Run Script"'
- inputs:
- azureSubscription: '$(Test.AzureConnectionName)'
- ScriptPath: '$(Build.ArtifactStagingDirectory)\drop\BuildPipeline\DevTestLab_ApplyArtifact.ps1'
- ScriptArguments: -DevTestLabName '$(Test.DevTestLabName)' -VirtualMachineName 'SP$(jobSharePointVersion)' -RepositoryName 'Yvand/AzureRM-Templates' -ArtifactName 'windows-vsts-download-and-run-script' -param_vstsProjectUri 'https://dev.azure.com/$(Test.DevOpsOrganizationName)/$(system.teamProject)' -param_buildDefinitionName '$(Build.DefinitionName)' -param_personalAccessToken $(AccessTokenDevOpsYvand) -param_pathToScript 'drop\SPTestServer artifacts\ConfigureLab.ps1' -param_scriptArguments "-pathToPackage ''..\$(system.teamProject)\bin\$(BuildConfiguration)\$(system.teamProject).wsp' -claimsProviderName '$(system.teamProject)' -spTrustName '$(Test.DomainFQDN)' -adminUserName '$(Test.Domain)\$(Test.AdminUserName)' -adminPassword '$(Test.AdminPassword)'"
- preferredAzurePowerShellVersion: 5.1.1
-
- - task: ms-azuredevtestlabs.tasks.azure-dtl-task-deleteEnvironment.AzureDevTestLabsDeleteEnvironment@1
- displayName: 'Delete Azure DevTest Labs deployed in previous task'
- inputs:
- ConnectedServiceName: '$(Test.AzureConnectionName)'
- LabId: '/subscriptions/$(Test.AzureSubscriptionId)/resourceGroups/$(Test.DevTestLabName)/providers/Microsoft.DevTestLab/labs/$(Test.DevTestLabName)'
- EnvironmentId: '$(BaseEnv.environmentResourceId)'
- enabled: false
-
-- job: RunTestSP2013
- dependsOn: ApplyArtifactsSP2013
- #dependsOn: Compile
- displayName: Run tests on SP2013
- timeoutInMinutes: 15
- variables:
- jobSharePointVersion: 2013
- pool:
- name: LDAPCP-Tests-2013
- steps:
- - task: DownloadBuildArtifacts@0
- displayName: 'Download Build Artifacts'
- inputs:
- artifactName: drop
- downloadPath: $(Build.ArtifactStagingDirectory)
- itemPattern: |
- drop/LDAPCP.Tests/bin/Release/*.dll
- drop/DevTestLabs/*.csv
-
- - task: VisualStudioTestPlatformInstaller@1
- displayName: 'Visual Studio Test Platform Installer'
-
- - task: VSTest@2
- displayName: 'Run Visual Studio tests'
- inputs:
- searchFolder: '$(System.ArtifactsDirectory)\drop'
- vsTestVersion: toolsInstaller
- runSettingsFile: LDAPCP.Tests/local.runsettings
- overrideTestrunParameters: '-DataFile_AllAccounts_Search "$(System.ArtifactsDirectory)\drop\SPTestServer artifacts\LDAPCP_Tests_AllAccounts_Search.csv" -DataFile_AllAccounts_Validate "$(System.ArtifactsDirectory)\drop\SPTestServer artifacts\LDAPCP_Tests_AllAccounts_Validate.csv" -TestSiteCollectionName "LDAPCP.$(Build.BuildNumber)"'
- codeCoverageEnabled: false
- otherConsoleOptions: '/Platform:x64'
- testRunTitle: 'LDAPCP-Tests-SP$(jobSharePointVersion)'
- platform: '$(BuildPlatform)'
- configuration: $(BuildConfiguration)
-
-- job: RunTestSP2016
- dependsOn: ApplyArtifactsSP2016
- #dependsOn: Compile
- displayName: Run tests on SP2016
- timeoutInMinutes: 15
- variables:
- jobSharePointVersion: 2016
- pool:
- name: LDAPCP-Tests-2016
- steps:
- - task: DownloadBuildArtifacts@0
- displayName: 'Download Build Artifacts'
- inputs:
- artifactName: drop
- downloadPath: $(Build.ArtifactStagingDirectory)
- itemPattern: |
- drop/LDAPCP.Tests/bin/Release/*.dll
- drop/DevTestLabs/*.csv
-
- - task: VisualStudioTestPlatformInstaller@1
- displayName: 'Visual Studio Test Platform Installer'
-
- - task: VSTest@2
- displayName: 'Run Visual Studio tests'
- inputs:
- searchFolder: '$(System.ArtifactsDirectory)\drop'
- vsTestVersion: toolsInstaller
- runSettingsFile: LDAPCP.Tests/local.runsettings
- overrideTestrunParameters: '-DataFile_AllAccounts_Search "$(System.ArtifactsDirectory)\drop\SPTestServer artifacts\LDAPCP_Tests_AllAccounts_Search.csv" -DataFile_AllAccounts_Validate "$(System.ArtifactsDirectory)\drop\SPTestServer artifacts\LDAPCP_Tests_AllAccounts_Validate.csv" -TestSiteCollectionName "LDAPCP.$(Build.BuildNumber)"'
- codeCoverageEnabled: false
- otherConsoleOptions: '/Platform:x64'
- testRunTitle: 'LDAPCP-Tests-SP$(jobSharePointVersion)'
- platform: '$(BuildPlatform)'
- configuration: $(BuildConfiguration)
-
-- job: RunTestSP2019
- dependsOn: ApplyArtifactsSP2019
- #dependsOn: Compile
- displayName: Run tests on SP2019
- timeoutInMinutes: 15
- variables:
- jobSharePointVersion: 2019
- pool:
- name: LDAPCP-Tests-2019
- steps:
- - task: DownloadBuildArtifacts@0
- displayName: 'Download Build Artifacts'
- inputs:
- artifactName: drop
- downloadPath: $(Build.ArtifactStagingDirectory)
- itemPattern: |
- drop/LDAPCP.Tests/bin/Release/*.dll
- drop/DevTestLabs/*.csv
-
- - task: VisualStudioTestPlatformInstaller@1
- displayName: 'Visual Studio Test Platform Installer'
-
- - task: VSTest@2
- displayName: 'Run Visual Studio tests'
- inputs:
- searchFolder: '$(System.ArtifactsDirectory)\drop'
- vsTestVersion: toolsInstaller
- runSettingsFile: LDAPCP.Tests/local.runsettings
- overrideTestrunParameters: '-DataFile_AllAccounts_Search "$(System.ArtifactsDirectory)\drop\SPTestServer artifacts\LDAPCP_Tests_AllAccounts_Search.csv" -DataFile_AllAccounts_Validate "$(System.ArtifactsDirectory)\drop\SPTestServer artifacts\LDAPCP_Tests_AllAccounts_Validate.csv" -TestSiteCollectionName "LDAPCP.$(Build.BuildNumber)"'
- codeCoverageEnabled: false
- otherConsoleOptions: '/Platform:x64'
- testRunTitle: 'LDAPCP-Tests-SP$(jobSharePointVersion)'
- platform: '$(BuildPlatform)'
- configuration: $(BuildConfiguration)
diff --git a/DevOps-ApplyDTLArtifacts.yml b/azure-pipelines/ci-apply-dtl-artifacts.yml
similarity index 60%
rename from DevOps-ApplyDTLArtifacts.yml
rename to azure-pipelines/ci-apply-dtl-artifacts.yml
index e862aef..bbfb89e 100644
--- a/DevOps-ApplyDTLArtifacts.yml
+++ b/azure-pipelines/ci-apply-dtl-artifacts.yml
@@ -3,7 +3,7 @@ resources:
jobs:
- job: ApplyArtifactsSP2013
- condition: eq(variables['Deployment.ProvisionSharePoint2013'], 'yes')
+ condition: eq(variables['Deployment.ProvisionSharePoint2013'], true)
displayName: Apply artifacts on SP2013
timeoutInMinutes: 30
variables:
@@ -15,11 +15,11 @@ jobs:
- task: automagically.DownloadFile.DownloadFile.DownloadFile@1
displayName: 'Download apply-dtl-artifact.ps1'
inputs:
- FileUrl: 'https://raw.githubusercontent.com/Yvand/AzureRM-Templates/dev/DevTestLabs-Artifacts/manage-artifacts/apply-dtl-artifact.ps1'
+ FileUrl: 'https://raw.githubusercontent.com/Yvand/AzureRM-Templates/master/DevTestLabs-Artifacts/manage-artifacts/apply-dtl-artifact.ps1'
DestinationFolder: '$(System.DefaultWorkingDirectory)\scripts'
- task: AzurePowerShell@3
- displayName: 'Apply artifact "Azure Pipelines Agent"'
+ displayName: 'Create and register a VSTS agent in DevOps agent pools by applying artifact "Azure Pipelines Agent"'
inputs:
azureSubscription: '$(DevTestLabs.AzureConnectionName)'
ScriptPath: '$(System.DefaultWorkingDirectory)\scripts\apply-dtl-artifact.ps1'
@@ -31,11 +31,11 @@ jobs:
inputs:
azureSubscription: '$(DevTestLabs.AzureConnectionName)'
ScriptPath: '$(System.DefaultWorkingDirectory)\scripts\apply-dtl-artifact.ps1'
- ScriptArguments: -DevTestLabName '$(DevTestLabs.LabName)' -VirtualMachineName 'SP$(jobSharePointVersion)' -RepositoryName 'Yvand/AzureRM-Templates' -ArtifactName 'windows-vsts-download-and-run-script' -param_vstsProjectUri 'https://dev.azure.com/$(DevOps.OrganizationName)/$(system.teamProject)' -param_buildDefinitionName '$(DevOps.BuildArtifactsPipelineName)' -param_personalAccessToken $(DevOps.AccessToken) -param_pathToScript 'drop_$(Tests.BuildConfiguration)\$(Deployment.ConfigureServerFolderName)\ConfigureLab.ps1' -param_scriptArguments "-pathToPackage ''..\$(system.teamProject)\bin\$(Tests.BuildConfiguration)\$(system.teamProject).wsp' -claimsProviderName '$(system.teamProject)' -spTrustName '$(Deployment.DomainFQDN)' -adminUserName '$(Deployment.DomainName)\$(Deployment.AdminUserName)' -adminPassword '$(Deployment.AdminPassword)'"
+ ScriptArguments: -DevTestLabName '$(DevTestLabs.LabName)' -VirtualMachineName 'SP$(jobSharePointVersion)' -RepositoryName 'Yvand/AzureRM-Templates' -ArtifactName 'windows-vsts-download-and-run-script' -param_vstsProjectUri 'https://dev.azure.com/$(DevOps.OrganizationName)/$(system.teamProject)' -param_buildDefinitionName '$(DevOps.BuildArtifactsPipelineName)' -param_personalAccessToken $(DevOps.AccessToken) -param_pathToScript 'drop_$(Tests.BuildConfiguration)\$(Deployment.ConfigureServerFolderName)\ConfigureLab.ps1' -param_scriptArguments "-pathToPackage '..\$(system.teamProject)\bin\$(Tests.BuildConfiguration)\$(system.teamProject).wsp' -claimsProviderName '$(system.teamProject)' -spTrustName '$(Deployment.DomainFQDN)' -adminUserName '$(Deployment.DomainName)\$(Deployment.AdminUserName)' -adminPassword '$(Deployment.AdminPassword)'"
preferredAzurePowerShellVersion: 5.1.1
- job: ApplyArtifactsSP2016
- condition: eq(variables['Deployment.ProvisionSharePoint2016'], 'yes')
+ condition: eq(variables['Deployment.ProvisionSharePoint2016'], true)
displayName: Apply artifacts on SP2016
timeoutInMinutes: 30
variables:
@@ -47,11 +47,11 @@ jobs:
- task: automagically.DownloadFile.DownloadFile.DownloadFile@1
displayName: 'Download apply-dtl-artifact.ps1'
inputs:
- FileUrl: 'https://raw.githubusercontent.com/Yvand/AzureRM-Templates/dev/DevTestLabs-Artifacts/manage-artifacts/apply-dtl-artifact.ps1'
+ FileUrl: 'https://raw.githubusercontent.com/Yvand/AzureRM-Templates/master/DevTestLabs-Artifacts/manage-artifacts/apply-dtl-artifact.ps1'
DestinationFolder: '$(System.DefaultWorkingDirectory)\scripts'
- task: AzurePowerShell@3
- displayName: 'Apply artifact "Azure Pipelines Agent"'
+ displayName: 'Create and register a VSTS agent in DevOps agent pools by applying artifact "Azure Pipelines Agent"'
inputs:
azureSubscription: '$(DevTestLabs.AzureConnectionName)'
ScriptPath: '$(System.DefaultWorkingDirectory)\scripts\apply-dtl-artifact.ps1'
@@ -63,11 +63,11 @@ jobs:
inputs:
azureSubscription: '$(DevTestLabs.AzureConnectionName)'
ScriptPath: '$(System.DefaultWorkingDirectory)\scripts\apply-dtl-artifact.ps1'
- ScriptArguments: -DevTestLabName '$(DevTestLabs.LabName)' -VirtualMachineName 'SP$(jobSharePointVersion)' -RepositoryName 'Yvand/AzureRM-Templates' -ArtifactName 'windows-vsts-download-and-run-script' -param_vstsProjectUri 'https://dev.azure.com/$(DevOps.OrganizationName)/$(system.teamProject)' -param_buildDefinitionName '$(DevOps.BuildArtifactsPipelineName)' -param_personalAccessToken $(DevOps.AccessToken) -param_pathToScript 'drop_$(Tests.BuildConfiguration)\$(Deployment.ConfigureServerFolderName)\ConfigureLab.ps1' -param_scriptArguments "-pathToPackage ''..\$(system.teamProject)\bin\$(Tests.BuildConfiguration)\$(system.teamProject).wsp' -claimsProviderName '$(system.teamProject)' -spTrustName '$(Deployment.DomainFQDN)' -adminUserName '$(Deployment.DomainName)\$(Deployment.AdminUserName)' -adminPassword '$(Deployment.AdminPassword)'"
+ ScriptArguments: -DevTestLabName '$(DevTestLabs.LabName)' -VirtualMachineName 'SP$(jobSharePointVersion)' -RepositoryName 'Yvand/AzureRM-Templates' -ArtifactName 'windows-vsts-download-and-run-script' -param_vstsProjectUri 'https://dev.azure.com/$(DevOps.OrganizationName)/$(system.teamProject)' -param_buildDefinitionName '$(DevOps.BuildArtifactsPipelineName)' -param_personalAccessToken $(DevOps.AccessToken) -param_pathToScript 'drop_$(Tests.BuildConfiguration)\$(Deployment.ConfigureServerFolderName)\ConfigureLab.ps1' -param_scriptArguments "-pathToPackage '..\$(system.teamProject)\bin\$(Tests.BuildConfiguration)\$(system.teamProject).wsp' -claimsProviderName '$(system.teamProject)' -spTrustName '$(Deployment.DomainFQDN)' -adminUserName '$(Deployment.DomainName)\$(Deployment.AdminUserName)' -adminPassword '$(Deployment.AdminPassword)'"
preferredAzurePowerShellVersion: 5.1.1
- job: ApplyArtifactsSP2019
- condition: eq(variables['Deployment.ProvisionSharePoint2019'], 'yes')
+ condition: eq(variables['Deployment.ProvisionSharePoint2019'], true)
displayName: Apply artifacts on SP2019
timeoutInMinutes: 30
variables:
@@ -79,11 +79,11 @@ jobs:
- task: automagically.DownloadFile.DownloadFile.DownloadFile@1
displayName: 'Download apply-dtl-artifact.ps1'
inputs:
- FileUrl: 'https://raw.githubusercontent.com/Yvand/AzureRM-Templates/dev/DevTestLabs-Artifacts/manage-artifacts/apply-dtl-artifact.ps1'
+ FileUrl: 'https://raw.githubusercontent.com/Yvand/AzureRM-Templates/master/DevTestLabs-Artifacts/manage-artifacts/apply-dtl-artifact.ps1'
DestinationFolder: '$(System.DefaultWorkingDirectory)\scripts'
- task: AzurePowerShell@3
- displayName: 'Apply artifact "Azure Pipelines Agent"'
+ displayName: 'Create and register a VSTS agent in DevOps agent pools by applying artifact "Azure Pipelines Agent"'
inputs:
azureSubscription: '$(DevTestLabs.AzureConnectionName)'
ScriptPath: '$(System.DefaultWorkingDirectory)\scripts\apply-dtl-artifact.ps1'
@@ -95,5 +95,37 @@ jobs:
inputs:
azureSubscription: '$(DevTestLabs.AzureConnectionName)'
ScriptPath: '$(System.DefaultWorkingDirectory)\scripts\apply-dtl-artifact.ps1'
- ScriptArguments: -DevTestLabName '$(DevTestLabs.LabName)' -VirtualMachineName 'SP$(jobSharePointVersion)' -RepositoryName 'Yvand/AzureRM-Templates' -ArtifactName 'windows-vsts-download-and-run-script' -param_vstsProjectUri 'https://dev.azure.com/$(DevOps.OrganizationName)/$(system.teamProject)' -param_buildDefinitionName '$(DevOps.BuildArtifactsPipelineName)' -param_personalAccessToken $(DevOps.AccessToken) -param_pathToScript 'drop_$(Tests.BuildConfiguration)\$(Deployment.ConfigureServerFolderName)\ConfigureLab.ps1' -param_scriptArguments "-pathToPackage ''..\$(system.teamProject)\bin\$(Tests.BuildConfiguration)\$(system.teamProject).wsp' -claimsProviderName '$(system.teamProject)' -spTrustName '$(Deployment.DomainFQDN)' -adminUserName '$(Deployment.DomainName)\$(Deployment.AdminUserName)' -adminPassword '$(Deployment.AdminPassword)'"
+ ScriptArguments: -DevTestLabName '$(DevTestLabs.LabName)' -VirtualMachineName 'SP$(jobSharePointVersion)' -RepositoryName 'Yvand/AzureRM-Templates' -ArtifactName 'windows-vsts-download-and-run-script' -param_vstsProjectUri 'https://dev.azure.com/$(DevOps.OrganizationName)/$(system.teamProject)' -param_buildDefinitionName '$(DevOps.BuildArtifactsPipelineName)' -param_personalAccessToken $(DevOps.AccessToken) -param_pathToScript 'drop_$(Tests.BuildConfiguration)\$(Deployment.ConfigureServerFolderName)\ConfigureLab.ps1' -param_scriptArguments "-pathToPackage '..\$(system.teamProject)\bin\$(Tests.BuildConfiguration)\$(system.teamProject).wsp' -claimsProviderName '$(system.teamProject)' -spTrustName '$(Deployment.DomainFQDN)' -adminUserName '$(Deployment.DomainName)\$(Deployment.AdminUserName)' -adminPassword '$(Deployment.AdminPassword)'"
preferredAzurePowerShellVersion: 5.1.1
+
+- job: ApplyArtifactsSPSubscription
+ condition: eq(variables['Deployment.ProvisionSharePointSubscription'], true)
+ displayName: Apply artifacts on SPSubscription
+ timeoutInMinutes: 30
+ variables:
+ jobSharePointVersion: Subscription
+ pool:
+ vmImage: 'windows-latest'
+ steps:
+ - checkout: none #skip checking out the default repository resource
+ - task: automagically.DownloadFile.DownloadFile.DownloadFile@1
+ displayName: 'Download apply-dtl-artifact.ps1'
+ inputs:
+ FileUrl: 'https://raw.githubusercontent.com/Yvand/AzureRM-Templates/master/DevTestLabs-Artifacts/manage-artifacts/apply-dtl-artifact.ps1'
+ DestinationFolder: '$(System.DefaultWorkingDirectory)\scripts'
+
+ - task: AzurePowerShell@3
+ displayName: 'Create and register a VSTS agent in DevOps agent pools by applying artifact "Azure Pipelines Agent"'
+ inputs:
+ azureSubscription: '$(DevTestLabs.AzureConnectionName)'
+ ScriptPath: '$(System.DefaultWorkingDirectory)\scripts\apply-dtl-artifact.ps1'
+ ScriptArguments: '-DevTestLabName "$(DevTestLabs.LabName)" -VirtualMachineName "SP$(jobSharePointVersion)" -RepositoryName "Yvand/AzureRM-Templates" -ArtifactName "windows-vsts-build-agent" -param_vstsAccount "$(DevOps.OrganizationName)" -param_vstsPassword "$(DevOps.AccessToken)" -param_poolName "$(system.teamProject)-Tests-$(jobSharePointVersion)" -param_windowsLogonAccount "$(Deployment.DomainName)\$(Deployment.AdminUserName)" -param_windowsLogonPassword "$(Deployment.AdminPassword)" -param_agentName "SP$(jobSharePointVersion)" -param_agentNameSuffix "-$(Build.BuildNumber)" -param_RunAsAutoLogon false -param_driveLetter C -param_workDirectory ""'
+ preferredAzurePowerShellVersion: 5.1.1
+
+ - task: AzurePowerShell@3
+ displayName: 'Apply artifact "Download Azure Pipelines Artifact and Run Script"'
+ inputs:
+ azureSubscription: '$(DevTestLabs.AzureConnectionName)'
+ ScriptPath: '$(System.DefaultWorkingDirectory)\scripts\apply-dtl-artifact.ps1'
+ ScriptArguments: -DevTestLabName '$(DevTestLabs.LabName)' -VirtualMachineName 'SP$(jobSharePointVersion)' -RepositoryName 'Yvand/AzureRM-Templates' -ArtifactName 'windows-vsts-download-and-run-script' -param_vstsProjectUri 'https://dev.azure.com/$(DevOps.OrganizationName)/$(system.teamProject)' -param_buildDefinitionName '$(DevOps.BuildArtifactsPipelineName)' -param_personalAccessToken $(DevOps.AccessToken) -param_pathToScript 'drop_$(Tests.BuildConfiguration)\$(Deployment.ConfigureServerFolderName)\ConfigureLab.ps1' -param_scriptArguments "-pathToPackage '..\$(system.teamProject)\bin\$(Tests.BuildConfiguration)\$(system.teamProject).wsp' -claimsProviderName '$(system.teamProject)' -spTrustName '$(Deployment.DomainFQDN)' -adminUserName '$(Deployment.DomainName)\$(Deployment.AdminUserName)' -adminPassword '$(Deployment.AdminPassword)'"
+ preferredAzurePowerShellVersion: 5.1.1
\ No newline at end of file
diff --git a/DevOps-Compile.yml b/azure-pipelines/ci-compile.yml
similarity index 95%
rename from DevOps-Compile.yml
rename to azure-pipelines/ci-compile.yml
index 5255f36..9b5ffd9 100644
--- a/DevOps-Compile.yml
+++ b/azure-pipelines/ci-compile.yml
@@ -12,10 +12,8 @@ jobs:
matrix:
debugJob:
configuration: debug
- platform: $(BuildPlatform)
releaseJob:
configuration: release
- platform: $(BuildPlatform)
displayName: Compile
pool:
vmImage: 'windows-2019'
@@ -65,13 +63,13 @@ jobs:
- task: automagically.DownloadFile.DownloadFile.DownloadFile@1
displayName: 'Download ConfigureLab.ps1'
inputs:
- FileUrl: 'https://raw.githubusercontent.com/Yvand/AzureRM-Templates/dev/DevTestLabs-Artifacts/manage-artifacts/ConfigureLab.ps1'
+ FileUrl: 'https://raw.githubusercontent.com/Yvand/AzureRM-Templates/master/DevTestLabs-Artifacts/manage-artifacts/ConfigureLab.ps1'
DestinationFolder: '$(Build.ArtifactStagingDirectory)\$(Deployment.ConfigureServerFolderName)'
- task: automagically.DownloadFile.DownloadFile.DownloadFile@1
displayName: 'Download ConfigureLab.psm1'
inputs:
- FileUrl: 'https://raw.githubusercontent.com/Yvand/AzureRM-Templates/dev/DevTestLabs-Artifacts/manage-artifacts/ConfigureLab.psm1'
+ FileUrl: 'https://raw.githubusercontent.com/Yvand/AzureRM-Templates/master/DevTestLabs-Artifacts/manage-artifacts/ConfigureLab.psm1'
DestinationFolder: '$(Build.ArtifactStagingDirectory)\$(Deployment.ConfigureServerFolderName)'
- task: NuGetToolInstaller@0
diff --git a/DevOps-CreateDTLEnvironment.yml b/azure-pipelines/ci-create-dtl-environment.yml
similarity index 58%
rename from DevOps-CreateDTLEnvironment.yml
rename to azure-pipelines/ci-create-dtl-environment.yml
index 7f7440a..658ef1e 100644
--- a/DevOps-CreateDTLEnvironment.yml
+++ b/azure-pipelines/ci-create-dtl-environment.yml
@@ -6,18 +6,16 @@ jobs:
displayName: Create test environment
timeoutInMinutes: 90
pool:
- vmImage: 'windows-2019'
+ vmImage: 'windows-latest'
steps:
- checkout: none #skip checking out the default repository resource
- - task: ms-azuredevtestlabs.tasks.azure-dtl-task-createEnvironment.AzureDevTestLabsCreateEnvironment@1
+ - task: ms-azuredevtestlabs.tasks.azure-dtl-task-createEnvironment.AzureDevTestLabsCreateEnvironment@3
displayName: 'Create Azure DevTest Labs Environment'
inputs:
- ConnectedServiceName: '$(DevTestLabs.AzureConnectionName)'
+ azureSubscription: '$(DevTestLabs.AzureConnectionName)'
LabId: '/subscriptions/$(DevTestLabs.AzureSubscriptionId)/resourceGroups/$(DevTestLabs.LabName)/providers/Microsoft.DevTestLab/labs/$(DevTestLabs.LabName)'
RepositoryId: '/subscriptions/$(DevTestLabs.AzureSubscriptionId)/resourcegroups/$(DevTestLabs.LabName)/providers/microsoft.devtestlab/labs/$(DevTestLabs.LabName)/artifactsources/$(DevTestLabs.RepoID)'
TemplateId: '/subscriptions/$(DevTestLabs.AzureSubscriptionId)/resourceGroups/$(DevTestLabs.LabName)/providers/Microsoft.DevTestLab/labs/$(DevTestLabs.LabName)/artifactSources/$(DevTestLabs.RepoID)/armTemplates/$(DevTestLabs.ARMTemplateName)'
EnvironmentName: 'Tests-$(system.teamProject)'
- ParameterOverrides: "-provisionSharePoint2013 '$(Deployment.ProvisionSharePoint2013)' -provisionSharePoint2016 '$(Deployment.ProvisionSharePoint2016)' -provisionSharePoint2019 '$(Deployment.ProvisionSharePoint2019)' -enableHybridBenefitServerLicenses 'Yes' -adminUserName '$(Deployment.AdminUserName)' -adminPassword '$(Deployment.AdminPassword)' -serviceAccountsPassword '$(Deployment.ServiceAccountsPassword)' -createPublicIPAndDNS '$(Deployment.CreatePublicIPAndDNS)'"
- TemplateOutputVariables: true
- ExportEnvironmentTemplate: true
+ ParameterOverrides: "-provisionSharePoint2013 $(Deployment.ProvisionSharePoint2013) -provisionSharePoint2016 $(Deployment.ProvisionSharePoint2016) -provisionSharePoint2019 $(Deployment.ProvisionSharePoint2019) -provisionSharePointSubscription $(Deployment.ProvisionSharePointSubscription) -adminUserName '$(Deployment.AdminUserName)' -adminPassword '$(Deployment.AdminPassword)' -serviceAccountsPassword '$(Deployment.ServiceAccountsPassword)' -addPublicIPAddressToEachVM true -configureADFS true -addAzureBastion true -enableHybridBenefitServerLicenses true -enableAutomaticUpdates false"
timeoutInMinutes: 90
diff --git a/azure-pipelines/ci-run-integration-tests.yml b/azure-pipelines/ci-run-integration-tests.yml
new file mode 100644
index 0000000..39b5f1a
--- /dev/null
+++ b/azure-pipelines/ci-run-integration-tests.yml
@@ -0,0 +1,56 @@
+resources:
+- repo: self
+
+jobs:
+- job: RunTests
+ strategy:
+ maxParallel: 4
+ matrix:
+ OnSharePoint2013:
+ deployThisSharePointVersion: variables['Deployment.ProvisionSharePoint2013']
+ sharePointVersion: 2013
+ OnSharePoint2016:
+ deployThisSharePointVersion: variables['Deployment.ProvisionSharePoint2016']
+ sharePointVersion: 2016
+ OnSharePoint2019:
+ deployThisSharePointVersion: variables['Deployment.ProvisionSharePoint2019']
+ sharePointVersion: 2019
+ OnSharePointSubscription:
+ deployThisSharePointVersion: variables['Deployment.ProvisionSharePointSubscription']
+ sharePointVersion: Subscription
+ displayName: Run integration tests
+ #condition: eq(variables['deployThisSharePointVersion'], 'yes') # Not working: variables['deployThisSharePointVersion'] is evaluated to Null
+ timeoutInMinutes: 30
+ pool:
+ name: $(System.TeamProject)-Tests-$(sharePointVersion)
+ steps:
+ - checkout: none #skip checking out the default repository resource
+ - task: DownloadBuildArtifacts@0
+ displayName: 'Download Build Artifacts'
+ inputs:
+ buildType: specific
+ project: '$(System.TeamProjectId)'
+ pipeline: $(DevOps.BuildArtifactsPipelineID)
+ specificBuildWithTriggering: true
+ artifactName: 'drop_$(Tests.BuildConfiguration)'
+ downloadPath: $(Build.ArtifactStagingDirectory)
+ itemPattern: |
+ drop_$(Tests.BuildConfiguration)/$(System.TeamProject)/bin/Release/$(System.TeamProject).pdb
+ drop_$(Tests.BuildConfiguration)/$(System.TeamProject).Tests/bin/Release/*.dll
+ drop_$(Tests.BuildConfiguration)/$(Tests.DataFolderName)/?(*.csv|*.json|*.runsettings)
+
+ - task: VisualStudioTestPlatformInstaller@1
+ displayName: 'Visual Studio Test Platform Installer'
+
+ - task: VSTest@2
+ displayName: 'Run Visual Studio tests'
+ inputs:
+ searchFolder: '$(Build.ArtifactStagingDirectory)/drop_$(Tests.BuildConfiguration)/$(System.TeamProject).Tests/bin/Release'
+ vsTestVersion: toolsInstaller
+ runSettingsFile: '$(Build.ArtifactStagingDirectory)/drop_$(Tests.BuildConfiguration)/$(Tests.DataFolderName)/DTLServer.runsettings'
+ overrideTestrunParameters: '$(Tests.OverrideTestrunParameters)'
+ codeCoverageEnabled: $(Tests.CodeCoverageEnabled)
+ otherConsoleOptions: '/Platform:x64'
+ testRunTitle: '$(System.TeamProject)-Tests-SP$(sharePointVersion)'
+ platform: '$(BuildPlatform)'
+ configuration: $(Tests.BuildConfiguration)
|