Can we run a custom PowerShell script in Release Management Deployment Agent? One way is to create a PowerShell script and add it as a resource and create a tool and an action in Release Management Inventory. This is more suitable for adding a generic tool. But if we want to run a custom PowerShell script specific to a given release template, copied to deployment machine from the build drop, can we do that? Out of the box set of tools and actions in Release Management Server do not support this. We can do this by creating a generic tool and an action.
Let me show you how to do this step by step.
In Release Management Client go to Inventory tab Tools, click on New.
For the execution command type “powershell” and for the arguments type
-command __ScriptToExecute__ __Arguments__
This will add two parameters in the tool “ScriptToExecute” and “Arguments”. Provide a suitable Name and a Description as well.
Click on Save & Close to add the new tool.
Go to Actions and click on New to add new action.
Select the tool we have created and add a new Category for Custom Actions. Fill the Name and Description.
Save to create the new Action.
Let’s test our Tool and Action in action. First we need a very simple PowerShell script like below.
In a test release template now we can see our custom action available.
Fill the script name with the path and arguments(for testing purpose script copied manually to deployment machine, this can be a script downloaded to deployment machine from the build drop using an XCOPY action in the release template).
Save the release template and click New Release to test. This example does not use a build out put, but the action can be used with a template bound to a build drop as well, as a matter of fact it can be used with any release template.
Start the release by clicking on Start.
Script execution succeeded.
Click on View Log to see the output from script.
To fail a script based on a condition throw an exception like below and release action will fail.
Saturday 26 July 2014
Sunday 20 July 2014
Setup Release Management Client
This is the second step of setting up VS 2013 Release Management environment. Prerequisite for this step is Release Management Server which is described here.
Trial version of VS 2013 Release Management with update 2 can be downloaded from http://go.microsoft.com/?linkid=9843020.
Note: You cannot apply a license key for the trial to make it licensed version. Instead you have to uninstall trial and install licensed copy downloaded with MSDN or Volume License to apply license.
In the downloaded ISO run rm_Client.exe to install Release Management Client. This is a very quick install.
Installation is quick and smooth.
Once lunched provide the url of the release management server. example – http://ReleaseManagmentServer:1000
Below picture shows TFS since this installation of the Release Management Client is done on tfs box.
This url is correct but cannot be connected by the client.
Check if Release Management Server app pool is running and if not start it.
Try browsing to http://releasemanagemntserver:1000/ReleaseManagement
This could happen, if the Release Management Server is installed in TFS box with Sharepoint Foundation. To resolve this issue refer Release Management Server in TFS box with Sharepoint Foundation, the fix specified in there is below.
On the machine where the Release Management Server was installed with TFS and Sharepoint, start a Command Prompt. Run as Administrator but not sure this was required.
Navigate to C:\Windows\System32\Inetsrv
Enter the following command
appcmd.exe set config -section:system.webServer/globalModules /[name='SPNativeRequestModule'].preCondition:integratedMode,bitness64
Browsing to http://releasemanagemntserver:1000/ReleaseManagement succeeds.
Below error occur if the user running Release Management Client is not added as a user in Release Management Server.
To resolve this issue add the user to Release Management Server, users, by clicking new on Administration tab Manage Users. (To do this log on to the Release Management Client with a user already available in release management server – example - run client as installation user of release management server).
Add the required user.
Release manager is the super user role in Release Management Server.
The user should be able to connect to the Release Management Server from a remote machine using the Release Management Client.
We have setup a Release Management Server, and Release Management Client accessing the server from a remote machine successfully. Next step is to set up Deployment Agent(s).
Trial version of VS 2013 Release Management with update 2 can be downloaded from http://go.microsoft.com/?linkid=9843020.
Note: You cannot apply a license key for the trial to make it licensed version. Instead you have to uninstall trial and install licensed copy downloaded with MSDN or Volume License to apply license.
In the downloaded ISO run rm_Client.exe to install Release Management Client. This is a very quick install.
Installation is quick and smooth.
Once lunched provide the url of the release management server. example – http://ReleaseManagmentServer:1000
Below picture shows TFS since this installation of the Release Management Client is done on tfs box.
This url is correct but cannot be connected by the client.
Check if Release Management Server app pool is running and if not start it.
Try browsing to http://releasemanagemntserver:1000/ReleaseManagement
This could happen, if the Release Management Server is installed in TFS box with Sharepoint Foundation. To resolve this issue refer Release Management Server in TFS box with Sharepoint Foundation, the fix specified in there is below.
appcmd.exe set config -section:system.webServer/globalModules /[name='SPNativeRequestModule'].preCondition:integratedMode,bitness64
Browsing to http://releasemanagemntserver:1000/ReleaseManagement succeeds.
Below error occur if the user running Release Management Client is not added as a user in Release Management Server.
To resolve this issue add the user to Release Management Server, users, by clicking new on Administration tab Manage Users. (To do this log on to the Release Management Client with a user already available in release management server – example - run client as installation user of release management server).
Add the required user.
Release manager is the super user role in Release Management Server.
The user should be able to connect to the Release Management Server from a remote machine using the Release Management Client.
We have setup a Release Management Server, and Release Management Client accessing the server from a remote machine successfully. Next step is to set up Deployment Agent(s).
Tuesday 8 July 2014
Setup VS 2013 Release Management Server
Let’s look at step by step “How to setup a VS 2013 Release Management Server”, which is the heart of VS Release Management. To understand more, the best and the official resource you must go through is VS 2013 Release Management Installation Guide. Trial version of VS 2013 Release Management with update 2 can be downloaded from http://go.microsoft.com/?linkid=9843020.
Note: You cannot apply a license key for the trial to make it licensed version. Instead you have to uninstall trial and install licensed copy downloaded with MSDN or Volume License to apply license.
Prerequisites for VS 2013 RM (Release Management) Server is below as per VS 2013 Release Management Installation Guide.
Processor: 1 GHz Pentium processor or equivalent (Minimum); 2GHz Pentium processor or equivalent (Recommended).
RAM: 1024 MB (Minimum); 2048 MB (Recommended).
Hard Disk: On a clean machine, up to 2.2 GB of available space may be required. This is due to the dependency on .NET. Database can grow up to 1 GB per year (could be as low as 10 MB - depending on usage)
Display: 1024 x 768 high color, 16-bit colors (Minimum); 1280 x 1024 high color, 32-bit (Recommended).
Supported platform: • Windows Server 2008 R2 SP1 • Windows Server 2012 • Windows Server 2012 R2
Database requirements: Microsoft SQL Server 2008 or 2008 R2 or 2012
The installing user (user who is setting up the Release Management Server) requires local administrator rights and sysadmin rights on the SQL Server (SQL Server that is going to have Release Management Server database). I will be using TFS Admin as the installation user of the RM Server since I am setting up the RM Server in the same box where the TFS is installed. Ideally the RM Server should be set up in a different clean computer and TFS is not mandatory to do release panning and execution with VS 2013 Release Management. (TFS is optional, but can be integrated really well with VS 2013 RM to automate from builds to release).
As the first step we need to setup an account, to be used as the service account for the Release Management Server.
Run the downloaded rm_server.exe to launch the setup.
Accept license agreement and click “Install”.
Once install launch to configure.
In the configuration window specify the release management service account and SQL Server to create the RM database.
Apply settings, you will encounter the first error in RM Server configuration, and fortunately it is a descriptive error “The account specified is not a member of the local administrators group”.
Add the RM Service account to local administrators group to resolve this issue.
Now the configuration proceeds.
The next error which might occur if the server resources are limited (This demo environment has only one cpu core and 4GB RAM while running SQL, SharePoint Foundation2013, TFS in same box). The error message is not very helpful.
Log file shows failing when getting RM site state, looks like some time out.
Increase resources in the machine and retry the configuration, now fails with application pool already exists (I believe MSFT will make this experience of retry configuration, better in a future release).
Manually deleting app pool and any web sites created for Release Management will resolve the issue.
Retry configuration succeeds.
To confirm the success state of configuration verify below check list.
1. Release Management database is created in SQL Server.
2. RM Service account mapped to RM database dbo schema.
3. Release Management app pool is created with identity RM Service account, and RM web site is created as below.
4. Release Management Monitor windows service is running with RM Service account.
Now we have a VS 2013 Release Management Server up and running. Next post of series VS Release Management, I will explain “How to setup and configure Release Management Client”.
Note: You cannot apply a license key for the trial to make it licensed version. Instead you have to uninstall trial and install licensed copy downloaded with MSDN or Volume License to apply license.
Prerequisites for VS 2013 RM (Release Management) Server is below as per VS 2013 Release Management Installation Guide.
Processor: 1 GHz Pentium processor or equivalent (Minimum); 2GHz Pentium processor or equivalent (Recommended).
RAM: 1024 MB (Minimum); 2048 MB (Recommended).
Hard Disk: On a clean machine, up to 2.2 GB of available space may be required. This is due to the dependency on .NET. Database can grow up to 1 GB per year (could be as low as 10 MB - depending on usage)
Display: 1024 x 768 high color, 16-bit colors (Minimum); 1280 x 1024 high color, 32-bit (Recommended).
Supported platform: • Windows Server 2008 R2 SP1 • Windows Server 2012 • Windows Server 2012 R2
Database requirements: Microsoft SQL Server 2008 or 2008 R2 or 2012
The installing user (user who is setting up the Release Management Server) requires local administrator rights and sysadmin rights on the SQL Server (SQL Server that is going to have Release Management Server database). I will be using TFS Admin as the installation user of the RM Server since I am setting up the RM Server in the same box where the TFS is installed. Ideally the RM Server should be set up in a different clean computer and TFS is not mandatory to do release panning and execution with VS 2013 Release Management. (TFS is optional, but can be integrated really well with VS 2013 RM to automate from builds to release).
As the first step we need to setup an account, to be used as the service account for the Release Management Server.
Run the downloaded rm_server.exe to launch the setup.
Accept license agreement and click “Install”.
Once install launch to configure.
In the configuration window specify the release management service account and SQL Server to create the RM database.
Apply settings, you will encounter the first error in RM Server configuration, and fortunately it is a descriptive error “The account specified is not a member of the local administrators group”.
Add the RM Service account to local administrators group to resolve this issue.
Now the configuration proceeds.
The next error which might occur if the server resources are limited (This demo environment has only one cpu core and 4GB RAM while running SQL, SharePoint Foundation2013, TFS in same box). The error message is not very helpful.
Log file shows failing when getting RM site state, looks like some time out.
Increase resources in the machine and retry the configuration, now fails with application pool already exists (I believe MSFT will make this experience of retry configuration, better in a future release).
Manually deleting app pool and any web sites created for Release Management will resolve the issue.
Retry configuration succeeds.
To confirm the success state of configuration verify below check list.
1. Release Management database is created in SQL Server.
2. RM Service account mapped to RM database dbo schema.
3. Release Management app pool is created with identity RM Service account, and RM web site is created as below.
4. Release Management Monitor windows service is running with RM Service account.
Now we have a VS 2013 Release Management Server up and running. Next post of series VS Release Management, I will explain “How to setup and configure Release Management Client”.
Subscribe to:
Posts (Atom)
Popular Posts
-
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...
-
Adding Azure Container Registry (ACR) service connection to Azure DevOps is really simple as described in " Create Service Connection ...
-
We have discueed, that we have to use an environment variable to handle input parameter default values, if we are using trigger for workflo...
-
Some times a silly mistake can waste lot of time of a developer. The exception “System.IO.IOException: The response ended prematurely.” whil...
-
Sometimes you may need to edit files especially the web.config or appsettings.json files after deploying your application to Azure App Servi...