Debugging is among the key options utilized by each developer in any form of improvement platform or language. Nonetheless, to repair some vital points, typically debugging needs to be executed for the applying which is already deployed within the server.
We all know that the method may be connected to an utility to debug, however how will we do that for the applying hosted in Azure? You’ll get a solution right here, with easy steps.
Open your challenge in Visual Studio. Set the debug breakpoint at any line of the code you want to debug.
Proper-click the answer and select the “Publish” choice, which will provide you with a display screen just like the one proven beneath. Primarily based on the Visual Studio model you’re utilizing, the display screen UI will differ.
Click on the “Import Profile” choice. On the backside, subsequent to cancel, there’s a settings icon. Click on the settings icon to change the mode from Publish to “Create Profile”
Now click on “Create Profile” on the backside. It is going to open a FileDialog to pick the publishing profile which you downloaded in Step 1. It is going to configure the AppService to be out there for publishing from Visual Studio.
By default, publishing profiles can be configured to construct and publish in Launch mode. Nonetheless, right here we’re going to debug, so we have to configure the publish profile to construct and publish in Debug mode. To try this, go to the settings part, as proven beneath:
Within the subsequent display screen, select “Settings” from the left menu and within the configuration choice, select “Debug”, then click on save.
Now, click on the Publish button within the Publish Wizard. Your debug construct together with debugger data can be revealed to the Azure App Service.
Now time to allow distant debugging. In your Visual Studio, go to View -> Server Explorer. Within the server explorer, configure your Azure account, which is able to record all of your AppServices within the account.
Proper-click on the AppService that you just revealed in Step 8 and select “Connect Debugger” as proven beneath. It is going to publish your app once more and convert your Visual Studio in debug mode.
We’re all executed. In case you have positioned the debug breakpoint within the start-up file itself, you’ll get a debugging hit within the web page load itself. Elsewise, the breakpoint will hit when the particular performance is executed.
As soon as your debugging is completed, you possibly can once more configure the Publish Profile as Launch mode and publish once more, as a result of we can not depart the debug mode to run within the server.
I hope this text lets you debug your Azure App Service. In case you have any questions/points about this text, please let me know within the feedback.