Friday, 9 December 2016
Setup SonarQube Analysis with TFS Builds
To run Sonarqube analysis for a project with TFS follow the steps described below.
Thursday, 1 December 2016
Setting Up Sonar Server for TFS
Monday, 10 October 2016
Setup Test Farm and Test Clients for Test Execution
- Create Virtual Network in Azure
- Create Virtual Machines in Azure for the Test Farm.
- Setup release agents in the admin machine in Azure, to use with each test client following instructions in here.
- Enable PowerShell remoting in each test client and verify access from the test farm admin VM in Azure.
Setup to start and stop Resource Group
Use a blob in azure to keep the status of the test client. Once test client done create a text file as done to notify the farm stop environment. This is required since TFS 2015 is not yet able to wait for multiple environments in release management to start its execution. (have a look at Release Management - Deploy based on conditions in multiple environments in here).
Script to do this
param( [Parameter(mandatory=$true)] [string]$storageAccountName, [Parameter(mandatory=$true)] [string]$ResourceGroupName, [Parameter(mandatory=$true)] [string]$releaseContainerName ) #Add-AzureRmAccount $releaseContainerName = $releaseContainerName.ToLower(); $StorageAccount = Get-AzureRmStorageAccount -StorageAccountName $storageAccountName -ResourceGroupName $ResourceGroupName #-StorageAccountKey $storageKey Write-Host "Storage Account obtained" $StorageAccount $NewReleaseContainer = New-AzureStorageContainer -Name $releaseContainerName -Context $StorageAccount.Context -Permission Blob Write-Host ("Release container:{0} created in storage account:{1}" -f $releaseContainerName, $storageAccountName) $NewReleaseContainer
Wait script
param( [Parameter(mandatory=$true)] [string]$storageAccountName, [Parameter(mandatory=$true)] [string]$ResourceGroupName, [Parameter(mandatory=$true)] [string]$releaseContainerName, [Parameter(mandatory=$true)] [string]$releaseEnvName ) #Add-AzureRmAccount $releaseContainerName = $releaseContainerName.ToLower(); $StorageAccount = Get-AzureRmStorageAccount -StorageAccountName $storageAccountName -ResourceGroupName $ResourceGroupName #-StorageAccountKey $storageKey Write-Host "Storage Account obtained" $StorageAccount $releaseContainer = Get-AzureStorageContainer -Name $releaseContainerName -Context $StorageAccount.Context Write-Host ("Release container:{0} obtaned in storage account:{1}" -f $releaseContainerName, $storageAccountName) $BlobContainer = $releaseContainer.CloudBlobContainer; Write-Host "Blob Container obtained" $BlobContainer $releaseEnvBlob = $BlobContainer.GetBlockBlobReference($releaseEnvName) Write-Host ("Release env:{0} blob reference obtained." -f $releaseEnvName) $releaseEnvBlob.UploadText("Done"); Write-Host ("Release env:{0} done flag set." -f $releaseEnvName)
param( [Parameter(mandatory=$true)] [string]$storageAccountName, [Parameter(mandatory=$true)] [string]$ResourceGroupName, [Parameter(mandatory=$true)] [string]$releaseContainerName ) #Add-AzureRmAccount $releaseContainerName = $releaseContainerName.ToLower(); $StorageAccount = Get-AzureRmStorageAccount -StorageAccountName $storageAccountName -ResourceGroupName $ResourceGroupName #-StorageAccountKey $storageKey Write-Host "Storage Account obtained" $StorageAccount Remove-AzureStorageContainer -Name $releaseContainerName -Context $StorageAccount.Context -Force Write-Host ("Release container:{0} removed in storage account:{1}" -f $releaseContainerName, $storageAccountName)
http://chamindac.blogspot.com/2016/06/deploying-to-untrusted-domaintfs-2015.html
Machines created with same virtual network, enable file and printer sharing.. since same workgroup all will be accessible Same username password as administrator user.(Even different user would work.). All of the machines are in same workgroup in Azure (refer Create Virtual Machines in Azure for the Test Farm).
Setup the test agent deployment task and test execution task.
Windows file copy task to copy the test binaries to the test execution folder.
Test Run task to run the tests.
Once a test client is done it will be creating a text file in blob container to notify the waiting task monitoring the blob container.
Set environment done script.
param( [Parameter(mandatory=$true)] [string]$storageAccountName, [Parameter(mandatory=$true)] [string]$ResourceGroupName, [Parameter(mandatory=$true)] [string]$releaseContainerName, [Parameter(mandatory=$true)] [string]$releaseEnvName ) #Add-AzureRmAccount $releaseContainerName = $releaseContainerName.ToLower(); $StorageAccount = Get-AzureRmStorageAccount -StorageAccountName $storageAccountName -ResourceGroupName $ResourceGroupName #-StorageAccountKey $storageKey Write-Host "Storage Account obtained" $StorageAccount $releaseContainer = Get-AzureStorageContainer -Name $releaseContainerName -Context $StorageAccount.Context Write-Host ("Release container:{0} obtaned in storage account:{1}" -f $releaseContainerName, $storageAccountName) $BlobContainer = $releaseContainer.CloudBlobContainer; Write-Host "Blob Container obtained" $BlobContainer $releaseEnvBlob = $BlobContainer.GetBlockBlobReference($releaseEnvName) Write-Host ("Release env:{0} blob reference obtained." -f $releaseEnvName) $releaseEnvBlob.UploadText("Done"); Write-Host ("Release env:{0} done flag set." -f $releaseEnvName)
##[warning]DistributedTests: Task 'DownloadTestAgent' for machine do-tf-tc01:5985's Error : System.Management.Automation.Remoting.PSRemotingTransportException: Connecting to remote server do-tf-tc01 failed with the following error message : The WinRM client cannot process the request. If the authentication scheme is different
from Kerberos, or if the client computer is not joined to a domain, then HTTPS transport
must be used or the destination machine must be added to the TrustedHosts configuration
setting. Use winrm.cmd to configure TrustedHosts. Note that computers in the TrustedHosts
list might not be authenticated. You can get more information about that by running the
following command: winrm help config. For more information, see the
about_Remote_Troubleshooting Help topic.
This is because PowerShell remoting is not setup for test agent machine. Follow instructions in Enable PowerShell remoting in each test client and verify access from the test farm admin VM in Azure. to setup PowerShell remoting. Create directory in the test client from admin machine to verify.
Still you may run into below issue if you have more than one test client machine.
Unable to resolve path $env:SystemDrive\TestAgent. Connecting to remote server do-tf-tc01
failed with the following error message : The WinRM client cannot process the request. If
the authentication scheme is different from Kerberos, or if the client computer is not joined
to a domain, then HTTPS transport must be used or the destination machine must be added to the
TrustedHosts configuration setting. Use winrm.cmd to configure TrustedHosts. Note that
computers in the TrustedHosts list might not be authenticated. You can get more information
about that by running the following command: winrm help config. For more information, see the
about_Remote_Troubleshooting Help topic. ---> System.AggregateException: One or more errors
occurred. ---> System.Management.Automation.Remoting.PSRemotingTransportException:
Connecting to remote server do-tf-tc01 failed with the following error message : The WinRM
client cannot process the request. If the authentication scheme is different from Kerberos,
or if the client computer is not joined to a domain, then HTTPS transport must be used or the
destination machine must be added to the TrustedHosts configuration setting. Use winrm.cmd to
configure TrustedHosts. Note that computers in the TrustedHosts list might not be
authenticated. You can get more information about that by running the following command:
winrm help config. For more information, see the about_Remote_Troubleshooting Help topic.
to verify from the admin machine execute below command
Get-Item WSMan:\localhost\Client\TrustedHosts
Only last machine added to trusted hosts available.
To fix Add all machines (http://stackoverflow.com/questions/21548566/how-to-add-more-than-one-machine-to-the-trusted-hosts-list-using-winrm)
Set-Item WSMan:\localhost\Client\TrustedHosts -Value "do-tf-tc01,do-tf-tc02,do-tf-tc03"
Test agent deployment cannot copy files error
System.AggregateException: Failed to execute the powershell script. Consult the logs below for details of the error.
2016-09-09T06:25:55.6714118Z ##[warning]Failed to connect to the path \\do-tf-tc03 with the user do-tf-tc03\doadmin for copying.System error 53 has occurred.
2016-09-09T06:25:55.6714118Z ##[warning] The network path was not found.
2016-09-09T06:25:55.6714118Z ##[warning]
2016-09-09T06:25:55.6714118Z ##[warning] ---> System.Management.Automation.RuntimeException: Failed to connect to the path \\do-tf-tc03 with the user do-tf-tc03\doadmin for copying.System error 53 has occurred.
Fix by allowing file and printer sharing in test client machine firewall.
Once test agent machine restart this is causing issues.
[Window Title]
DTAExecutionHost.exe
[Main Instruction]
DTAExecutionHost.exe has stopped working
[Content]
A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available.
[Close program]
Disable to resolve – Not a good fix at all.
Another problem asking for login while trying to execute tests
To resolve
Setup a local account in Test Client and in TFS AT say tfstestsvcshadow. (This is used as the service account for Test Agent.
Add this user to team project collection test service account.
This resolves DTAExecution startup error as well. Enable the disabled DTAExecution in startup.
With this you will be able to execute the tests.
Look at Test Farm as Azure VMs–For TFS2015 Release Management to see how this is running.
Tuesday, 27 September 2016
Create First Team Project in TFS15 RC1 with VS15 Preview 4
- Using VS15 Preview
- Using TFS Web Portal.
Sunday, 25 September 2016
TFS15 RC1 Setup Guide
This is a step by step guide on setting up TFS 15 RC1 for evaluation purpose. This a “go-live” release and supported by Microsoft support team. Requirements for TFS15 is specified here.
Download TFS15 RC1, ISO image or web installer.
Make sure you have installed supported SQL Server version, with reporting services in native mode.
- SQL Server 2016
- SQL Server 2014
Setup SharePoint Foundation 2013. This is optional. How to setup SharePoint Foundation 2013 is here.
Launch the TFS Admin Console after restart and start configuration wizard for “Configure Team Foundation Server”.
Select new deployment and select advance configuration.
Provide the SQL Server name and verify.
Specify a service account for TFS.
You have option to provide HTTP or HTTPS access.
Optional search feature can be configured as well. More information of the feature here.
Report server urls are set to access local only.
Configure optional SharePoint for TFS, if the SharePoint foundation is setup earlier. Make sure alternate access mappings for SharePoint urls properly set.
Provide a project collection name and review.
Accept download and install of JRE (java Runtime Environment) which is a prerequisite of Search feature, and run configure.
JRE configuration might fail. If this happens manually download and install JRE.
Download Java runtime 8u102 from here and install.
Run the configuration wizard for TFS again and in readiness checks still shows JRE unavailability.
This happens because JAVA_HOME is not properly set with JRE install. how to set JAVA_HOME is here. Setting JRE_HOME is not working for TFS, You have to set JAVA_HOME environment variable. Make sure to use the shortened path name.
Readiness checks should pass and configuration of TFS should be successful.
To configure report services urls for network access with FQDN follow the steps below. Click edit on Reporting tab of TFS Admin Console.
Test warehouse analysis services connectivity.
Popular Posts
-
Dynamic block allows to create nested multi level block structures in terraform code. Conditional usage of such blocks are really useful in...
-
In Azure DevOps YAML pipelines there are several functions available for you to use. replace is such a useful function, which you can use t...
-
We have discueed, that we have to use an environment variable to handle input parameter default values, if we are using trigger for workflo...
-
Adding Azure Container Registry (ACR) service connection to Azure DevOps is really simple as described in " Create Service Connection ...
-
Some times a silly mistake can waste lot of time of a developer. The exception “System.IO.IOException: The response ended prematurely.” whil...