Auto Deploy To Azure VM Using TFS Portal (Part 2)

In previos article, we leand how we can create a virtual machine and make auto-deploy to azure using the TFS portal. If you not read yet please read that article first. This is a continuous article of Part 1

Step 2: View build summary

Once the build completes, select the build number to view a summary of the build

Step 3: Create a deployment group

Deployment groups in VSTS make it easier to organize the servers that you want to use to host your app. A deployment group is a collection of machines with a VSTS agent on each of them. Each machine interacts with VSTS to coordinate the deployment of your app.

  1. Open the VSTS web portal (https://{your-account}, navigate to the Deployment groups. Click on Add a deployment group.

2. Enter a name for the group and click Create

3. In the Register machine section, make sure that Windows is selected, and that Use a personal access token in the script for authentication is also selected. Click Copy script to clipboard.

4. On your VM, in an Administrator PowerShellconsole, paste and run the script.

5. When you’re prompted to configure tags for the agent, press Enter (you don’t need any tags).

6. When you’re prompted for the user account, press Enter to accept the defaults.

7. When the script is done, it displays the message Service vstsagent.account.computername started successfully.

8. On the Deployment groups in VSTS, open the myIIS deployment group. On the Machines tab, verify that your VM is listed.

Step 4: Define your CD release process

Your CD release process picks up the artifacts published by your CI build and then deploys them to your IIS servers.

  1. Do one of the following:

a. If you’ve just completed a CI build then, in the build’s Summarytab under Deployments, choose to Create release followed by Yes. This starts a new release definition that’s automatically linked to the build definition.

b. Open the Releases tab of the Pipelines hub, and choose New Pipeline.

2.  In the Create release definition wizard, select IIS Website Deployment template, and then click Apply.

3. After apply this screen will be visible, please select the Add an Artifacts.

4. Select the Source of the build. Choose the pipeline we have created earlier.

5. Click the Tasks tab, and then click the IIS Deployment For the Deployment Group, click the deployment group you created earlier, such as myIIS.

6. Update the path of the host folder. Select the path where you want to deploy the code in VM.

7. Update the folder for the source.

8. Save the release definition.

9. Trigger Continuous deployment to automatically trigger the deployment after each trigger.

10. Deploy the created release manually and the new release will be automatically created after each commit.

11. View the status of the deployment

Submit a Comment

Your email address will not be published. Required fields are marked *


Select Categories