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.
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.
Accept the Microsoft License Agreement and click Next.
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
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.
On the Ready to install screen Click Install to start the installation.
Click Finish to complete the installation.
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.
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.
On the Destination port range type the ports 80 and 8172 and give the rule a name and click add.
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.
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.
In the right side pane select PublishàStart and on the Azure App Service, create New,
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.
Once the Virtual Machine has been selected click Create Profile to create the web deployment profile.
Click Edit to edit the profile to validate the connection and save the connection settings.
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.
And click save to save the settings.
Now, select the profile that you have created and publish to publish the web deployment.
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.
1 Comment on "How to Web Deploy From Visual Studio Part 2"
Like!! Thank you for publishing this awesome article.