How to Web Deploy From Visual Studio Part 2

Publish Web Application Using Web Deploy

How to Web Deploy From Visual Studio Part 2

Overview

This is part 2 of the two-part series of the topic Publish Web Application Using Web Deploy from Visual Studio 2019, we are going to cover the installation of web deploy 4.0. There are some ports that need to be opened on the Azure Network Group to access the Management Service feature on the Web server running as Azure VM. The DNS label name must be configured on Azure Portal to connect to the server with the name of the server. At the end of the part, we are going to look at how to create a web deployment of the profile and publishing a web deployment project with the profile created.

How to Web Deploy from Visual Studio Part 1

Download and Install Web Deploy 4.0 to publish Web Application Using Web Deploy from Visual Studio

Web Deploy 4.0 is available as a separate download on the Microsoft website. This MSI extension file can be download at the link below.

https://download.visualstudio.microsoft.com/download/pr/e1828da1-907a-46fe-a3cf-f3b9ea1c485c/035860f3c0d2bab0458e634685648385/webdeploy_amd64_en-us.msi

Once downloaded double click the MSI file to start the installation wizard. The Wizard will start with a welcome screen and click Next to move to the next screen.

 Web Application Using Web Deploy

Accept the Microsoft License Agreement and click Next.

 Web Application Using Web Deploy

You would get connection validation if you have not installed all the features of the Web Deploy when you validate the connection from Visual Studio So Click Custom and Click Next

 Web Application Using Web Deploy

The next screen shows us Custom setup where we need to select the topmost drop-down which is ‘Web Deployment Framework’ and select ‘Entire feature will be installed on local hard drive’ option. After the selection Click Next to continue.

 Web Application Using Web Deploy

On the Ready to install screen Click Install to start the installation.

 Web Application Using Web Deploy

Click Finish to complete the installation.

 Web Application Using Web Deploy

Once the installation of the Web Deployment Framework is completed, Go to  Start->Run and type SERVICES.MSC to open the Services console and check ‘Web Deployment Agent Service’ and ‘Web Management Service’ startup type is automatic and it is running, if it is not running click the service and start.

 Web Application Using Web Deploy

Create Inbound Firewall Rule to open Port 80 and 8172

The Web deployment port 80 and Web Management Service port 8172 are allowed in the inbound rule of Windows Firewall. But the Azure Network Security Group should be created with the inbound port rule. This must be done navigating to the networking page of the Azure Virtual Machine.

Navigate to the Networking page and click Inbound port rule.

 Web Application Using Web Deploy

On the Destination port range type the ports 80 and 8172 and give the rule a name and click add.

 Web Application Using Web Deploy

Configure DNS name for Azure Virtual Machine

To configure web deploy we need to give a DNA name for the Virtual Machine. Navigate to Overview and click Configure in the right side pane.

Give a unique name in the DNS label name box and click Save on the top.

 Web Application Using Web Deploy

Publish ASP.NET web application from Visual Studio using web deploy

Now we have come to the step to publish the web application. In order to do that we are going to create a profile.

Right-click the web application and click publish as in the screen below.

A screenshot of a computer

Description automatically generated

In the  right side pane select PublishàStart and on the Azure App Service, create New,

A screenshot of a computer screen

Description automatically generated

You need to sign in with the Microsoft account with the one Azure subscription and Virtual machine attached to it. To Select an Azure Virtual Machine click browse and select the virtual machine that we have set up web deploy.

A screenshot of a cell phone

Description automatically generated

Once the Virtual Machine has been selected click Create Profile to create the web deployment profile.

A screenshot of a social media post

Description automatically generated

Click Edit to edit the profile to validate the connection and save the connection settings.

A screenshot of a computer

Description automatically generated

Type the password of the user and click Validate Connection. You would see a green tick mark next to the validate Connection, then click Next.

A screenshot of a cell phone

Description automatically generated

And click save to save the settings.

A screenshot of a cell phone

Description automatically generated

Now, select the profile that you have created and publish to publish the web deployment.

A screenshot of a computer

Description automatically generated

Conclusion

In this two-part article series, we have demonstrated the deploying Windows Server 2019 as Virtual Machine on Azure Portal, we connected the server using RDP, added Web Server Role and added the role service management service and ASP.NET 4.7 feature and we installed Web Deploy 4.0. After that, we created a web deployment profile and published a web deployment project from Visual Studio 2019.

How to Web Deploy from Visual Studio Part 1

1 Comment on "How to Web Deploy From Visual Studio Part 2"

Leave a Reply

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


*