This is a session conducted by me @ MSFT Sri Lanka.
Friday, 22 August 2014
Configure TFS Connection for VS 2013 Release Management
Another optional configuration for VS Release Management is TFS connections. TFS Connections are optional because Release Management is capable of using package/payload built by any other build system.
If TFS is used in an organization it can be integrated with VS Release Management to provide as end to end solution, which tracks TFS based Requirements to Production Deployments.
With VS Release Management TFS can be integrated at the project collection level. This allows integration of project collections from different TFS servers with a single VS Release Management Server. In other words VS Release Management Server is capable of managing releases, using builds done manually, any other build system or any number of TFS build Servers.
First step is to setup an account to integrate TFS and VS Release Management Server.
In Administration tab of the VS Release Management Client go to Manage TFS and click on New button.
Select the TFS Integration account.
Provide the TFS Project Collection details.
Click on verify to check the connection to Project Collection.
Access denied. This is because the TFS integration account is not having required permissions in the Project Collection. Release management installation guide specifies the account requirement as below.
To enable the TFS integration account to be used to connect all the project collections with release management server, the TFS integration account should be added to “Team Foundation Service Accounts”.
This TFS group is not allowing to directly add remove users with TFS Console Admin. The option is to use the g+ command as shown below.
TFSSecurity /g+ groupIdentity memberIdentity [/collection:CollectionURL] [/server:ServerURL]
Example
tfssecurity /g+ "Team Foundation Service Accounts" n:ALM\rmtfsint ALLOW /server:http://tfs:8080/tfs
Above command should be executed in Developer Command prompt of VS. To find the Developer Command prompt for VS 2013 in Windows 8.1 right click on VS Shortcut and open file location.
Open the VS Tools folder
Pin the Developer Command Prompt for VS2013 to Start Menu.
Using VS Developer command prompt execute g+ command
tfssecurity /g+ "Team Foundation Service Accounts" n:ALM\rmtfsint ALLOW /server:http://tfs:8080/tfs
This will add the TFS integration account to "Team Foundation Service Accounts"
In Release Management Client connection to TFS project collection can be successfully verified and saved.
Next step is to define the Release Management Stages.
If TFS is used in an organization it can be integrated with VS Release Management to provide as end to end solution, which tracks TFS based Requirements to Production Deployments.
With VS Release Management TFS can be integrated at the project collection level. This allows integration of project collections from different TFS servers with a single VS Release Management Server. In other words VS Release Management Server is capable of managing releases, using builds done manually, any other build system or any number of TFS build Servers.
First step is to setup an account to integrate TFS and VS Release Management Server.
In Administration tab of the VS Release Management Client go to Manage TFS and click on New button.
Select the TFS Integration account.
Provide the TFS Project Collection details.
Click on verify to check the connection to Project Collection.
Access denied. This is because the TFS integration account is not having required permissions in the Project Collection. Release management installation guide specifies the account requirement as below.
To enable the TFS integration account to be used to connect all the project collections with release management server, the TFS integration account should be added to “Team Foundation Service Accounts”.
This TFS group is not allowing to directly add remove users with TFS Console Admin. The option is to use the g+ command as shown below.
TFSSecurity /g+ groupIdentity memberIdentity [/collection:CollectionURL] [/server:ServerURL]
Example
tfssecurity /g+ "Team Foundation Service Accounts" n:ALM\rmtfsint ALLOW /server:http://tfs:8080/tfs
Above command should be executed in Developer Command prompt of VS. To find the Developer Command prompt for VS 2013 in Windows 8.1 right click on VS Shortcut and open file location.
Open the VS Tools folder
Pin the Developer Command Prompt for VS2013 to Start Menu.
Using VS Developer command prompt execute g+ command
tfssecurity /g+ "Team Foundation Service Accounts" n:ALM\rmtfsint ALLOW /server:http://tfs:8080/tfs
This will add the TFS integration account to "Team Foundation Service Accounts"
In Release Management Client connection to TFS project collection can be successfully verified and saved.
Next step is to define the Release Management Stages.
Sunday, 17 August 2014
Configure SMTP for VS 2013 Release Management
After setting up Release Management Server, Client and Deployment Agent(s) configurations steps for VS Release Management should be done.
First step is setting up SMTP. This is a optional step, but necessary to configure for sending email notifications in release management workflows.
“Configure Apps” tab shows a guide for configurations, when VS Release Management Server is initially setup.
Click on “SMTP Server Settings” in “Configure Apps” tab or Click on Administration –> Settings to navigate to the settings tab.
Provide below (reference VS Release Management User Guide)
Server Name – Fully qualified address of the SMTP server to use.
Port – Optional. Port to be used when connecting to the SMTP server to send email notifications.
User Name – Optional. Name of the identity to be used to authenticate against the SMTP services.
User Password – Password of the identity to be used to authenticate against the SMTP services. Mandatory if User Name is specified. Otherwise, optional.
Sender Address – Email address as it will appear in the email client. No replies are expected to be sent to this address. Therefore, the email or text can be anything.
Once above configuration done Release Management Server is ready to send email notifications.
First step is setting up SMTP. This is a optional step, but necessary to configure for sending email notifications in release management workflows.
“Configure Apps” tab shows a guide for configurations, when VS Release Management Server is initially setup.
Click on “SMTP Server Settings” in “Configure Apps” tab or Click on Administration –> Settings to navigate to the settings tab.
Provide below (reference VS Release Management User Guide)
Server Name – Fully qualified address of the SMTP server to use.
Port – Optional. Port to be used when connecting to the SMTP server to send email notifications.
User Name – Optional. Name of the identity to be used to authenticate against the SMTP services.
User Password – Password of the identity to be used to authenticate against the SMTP services. Mandatory if User Name is specified. Otherwise, optional.
Sender Address – Email address as it will appear in the email client. No replies are expected to be sent to this address. Therefore, the email or text can be anything.
Once above configuration done Release Management Server is ready to send email notifications.
Tuesday, 5 August 2014
Custom Action to Run SQL Script With Parameters in VS 2013 Release Management Deployment Agent
How to pass parameters to SQL script running from VS 2013 Release Management? Let me show you step by step.
First we need a SQL Script to Run as a test. Here is a very simple SQL Script written in SQLCMD mode.
INSERT INTO [dbo].[Customer]
([Id]
,[Name])
VALUES
($(Id)
,'$(Name)')
GO
This script is inserting a record to a table with two columns. The script cannot be directly executed in SQL Management Studio since the $(Id) and $(Name) variables are not set. If tried will get below error.
To test the script run the below command in command prompt.
sqlcmd -S "POC-DOLPHINQA" -d "TestDB" -i "C:\Temp\TestSQL.sql" -v Id=3 Name="Chandrasekara" –b
This adds a row to the table successfully.
To create a new Action in the VS 2013 Release Management –> Log on to Client and go to Inventory tab and select Actions –> Click New
Create an action as shown below.
Arguments should be
-S "__ServerName__" -d "__DatabaseName__" -i "__ScriptName__" -v __Params__ -b
This will add below parameters to the action
ServerName – SQL Server Instance Name
DatabaseName – Database Name the script should run
ScriptName – Script to execute with full path (In deployment machine. Copying script to deployment machine can be done using XCOPY Deployer)
Params – Parameters for the SQL Script
Now this action can be used in Release template.
Let’s try a release.
The new action execution succeeded.
Table is added with new record.
This custom action can be used even to execute script while dynamically changing target DB, tables, columns etc. using SQLCMD syntax.
For example
Use $(MyDatabaseName)
SELECT x.$(ColumnName)
FROM Person.Person x
First we need a SQL Script to Run as a test. Here is a very simple SQL Script written in SQLCMD mode.
INSERT INTO [dbo].[Customer]
([Id]
,[Name])
VALUES
($(Id)
,'$(Name)')
GO
This script is inserting a record to a table with two columns. The script cannot be directly executed in SQL Management Studio since the $(Id) and $(Name) variables are not set. If tried will get below error.
To test the script run the below command in command prompt.
sqlcmd -S "POC-DOLPHINQA" -d "TestDB" -i "C:\Temp\TestSQL.sql" -v Id=3 Name="Chandrasekara" –b
This adds a row to the table successfully.
To create a new Action in the VS 2013 Release Management –> Log on to Client and go to Inventory tab and select Actions –> Click New
Create an action as shown below.
Arguments should be
-S "__ServerName__" -d "__DatabaseName__" -i "__ScriptName__" -v __Params__ -b
This will add below parameters to the action
ServerName – SQL Server Instance Name
DatabaseName – Database Name the script should run
ScriptName – Script to execute with full path (In deployment machine. Copying script to deployment machine can be done using XCOPY Deployer)
Params – Parameters for the SQL Script
Now this action can be used in Release template.
Let’s try a release.
The new action execution succeeded.
Table is added with new record.
This custom action can be used even to execute script while dynamically changing target DB, tables, columns etc. using SQLCMD syntax.
For example
Use $(MyDatabaseName)
SELECT x.$(ColumnName)
FROM Person.Person x
Monday, 4 August 2014
Setup Deployment Agent
Deployment Agent is responsible for downloading the payload for deployment form the Release Management Server and perform release steps in the deployment machine. Release Management Agent (Deployment Agent) is licensed separately for each target server and for details refer here.
Let’s have look at how to setup a deployment agent for VS 2013 Release Management. I have explained in earlier posts on setting up a Release Management Server and a Release Management Client.
Launch Deployment Agent setup.
Installer will be very quick.
Launch to configure.
We need an account to set up agent. Let’s add a domain account.
Make sure to add the rmagent account created above to the deployment machine local administrators group.
It is really easy when configuring a Deployment Agent in the same domain as Release Management Server. Use the created domain account as the account for Deployment Agent and provide Release Management Server url to configure. The user running the configuration should have Release Manger role in the server.
Configuration succeeds.
Successful configuration can be verified in services.
rmagent account is added as a service account to Release Management Server
Now the Deployment Agent machine can be registered in the Release Management Server.
Adding a deployment agent is easy in the same domain. To add a machine outside of domain follow below steps.
1. Create account rmshadowagent as window user in Release Management Server.
2. Create same account with same password in deployment agent machine, and add the rmshadowagent account to local admin group the deployment agent machine.
3. Add rmshadowagentwith only user name to RM server and make him ReleaseManager and a service user
4. Log on to deployment agent machine with rmshadowagent user or in deployment agent run the deployment agent configuration as rmshadowagent user (run as different user).
5. In configuration screen provide shadow agent user name (only rmshadowagent ) and password, and Release Management Server url. Release Management Server url can be exposed as https, so that this can be used to configure agent (example – Production machine in client’s environment) fully outside of the Release Management Server network.
Note use of .\rmshadowagent or machine\rmshadowagent will give error "user is not a release manager and service"
6. After “Apply Settings” and configured successfully, removal of shadow user (rmshadowagent ) release manger role is possible. (if adding new agent with this user again, temporary make him release manager)
Successfully configured agent machine can now be registered in the Release Management Server.
Let’s have look at how to setup a deployment agent for VS 2013 Release Management. I have explained in earlier posts on setting up a Release Management Server and a Release Management Client.
Launch Deployment Agent setup.
Installer will be very quick.
Launch to configure.
We need an account to set up agent. Let’s add a domain account.
Make sure to add the rmagent account created above to the deployment machine local administrators group.
It is really easy when configuring a Deployment Agent in the same domain as Release Management Server. Use the created domain account as the account for Deployment Agent and provide Release Management Server url to configure. The user running the configuration should have Release Manger role in the server.
Configuration succeeds.
Successful configuration can be verified in services.
rmagent account is added as a service account to Release Management Server
Now the Deployment Agent machine can be registered in the Release Management Server.
Adding a deployment agent is easy in the same domain. To add a machine outside of domain follow below steps.
1. Create account rmshadowagent as window user in Release Management Server.
2. Create same account with same password in deployment agent machine, and add the rmshadowagent account to local admin group the deployment agent machine.
3. Add rmshadowagentwith only user name to RM server and make him ReleaseManager and a service user
4. Log on to deployment agent machine with rmshadowagent user or in deployment agent run the deployment agent configuration as rmshadowagent user (run as different user).
5. In configuration screen provide shadow agent user name (only rmshadowagent ) and password, and Release Management Server url. Release Management Server url can be exposed as https, so that this can be used to configure agent (example – Production machine in client’s environment) fully outside of the Release Management Server network.
Note use of .\rmshadowagent or machine\rmshadowagent will give error "user is not a release manager and service"
6. After “Apply Settings” and configured successfully, removal of shadow user (rmshadowagent ) release manger role is possible. (if adding new agent with this user again, temporary make him release manager)
Successfully configured agent machine can now be registered in the Release Management Server.
Subscribe to:
Posts (Atom)
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...