I recently deployed an Adxstudio portal to Azure, and needed to debug it remotely. This article will not cover how to initially deploy a portal or website to Microsoft Azure App Service, but will walk you through how to set up remote debugging in Azure for Visual Studio 2015. The sample website I deployed to Azure for this article is just a simple ASP.NET forms website, but the steps are the same for an Adxstudio portal.
It is important to note that you should not debug on a production instance, because while you are debugging, your website will appear to be down to other users.
How to Remotely Debug an ASP.NET Website on Microsoft Azure App Service from Visual Studio 2015
- I already published my sample website to Azure, but I need to update it so I can debug it. In Visual Studio 2015, in the Solution Explorer, right click on the website project and select Publish.
- In the Settings tab, change Configuration to Debug and click Publish.
- Once you have published your website to Azure for debugging, log into the Azure portal at https://portal.azure.com/. On the left, click on App Services, then select your application.
- In the Settings pane, select Deployment credentials.
- In the Set deployment credentials pane, add a password to set your login credentials for remote debugging and save your changes.
- In the Settings area, select Application settings.
- In the Application settings pane, scroll down to Debugging. Set Remote Debugging to On, and Remote Visual Studio version to 2015 and save your changes.
- In Visual Studio 2015, click Debug and select Attach to Process.
- In the Qualifier box, type the URL of your website (don’t include the “http://www.” prefix) and hit enter. When it asks for you to enter your credentials, enter the deployment credentials you set up in Azure, being sure to use the full FTP/Deployment username. You can find this information in Azure where you view your URL, Resource Group, the Status of the app, etc.
- Select the w3wp.exe process and click Attach. If you get an error at this point, try running Visual Studio as an administrator.
- Now if you go to your website in your browser, and have any breakpoints set in your code, they should be hit and you can step through the code.