domingo, 8 de septiembre de 2019

Enable remote publishing with Visual Studio 2019 and Azure VMs



This is a quick guide that covers how to enable remote publishing using Visual Studio 2019 and a Windows Server 2019 Azure Virtual Machine.


  1. Add web server role to the server:
    1. Open Server Manager
    2. Select add roles and features
    3. Web Server(IIS), also install Management tools
  2. Verify that the Management Service is running and configured
    1. Open Services and search for Web Management Service, start if necessary
    2. Open Control Panel and go to Programs and Features
    3. Select Microsoft Web Deploy and click change
    4. Install all missing modules
    5. Go to IIS Manager
    6. Click on Server and then Management Services
    7. Configure port and enable remote connections, leave default port
  3. Enable remote connections in Azure
    1. Login to Azure Admin. Portal
    2. Click on Virtual Machines and pick the desired one
    3. Go to Networking
    4. Add Inbound Port rule for port 8172 (default)
  4. Test remote publish through Visual Studio
    1. Left click on web project and then publish
    2. Use web deploy or VM, it will perform the same operation
    3. In the Server field use the following format: sample.westus2.cloudapp.azure.com:8172
    4. Fill the rest of the fields and test with validate connection
  5. At this point the remote publish should be successful