Skip to content

Commit 626ca7d

Browse files
committed
Quick formatting fixes
1 parent 7ecdc7b commit 626ca7d

1 file changed

Lines changed: 45 additions & 49 deletions

File tree

support/azure/app-service/troubleshoot-dotnet-visual-studio.md

Lines changed: 45 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,10 @@ Visual Studio provides access to a subset of the app management functions and co
4949

5050
1. If you aren't already signed in to Azure in Visual Studio, right-click **Azure** and select Connect to **Microsoft Azure Subscription** in **Server Explorer**.
5151

52-
An alternative is to install a management certificate that enables access to your account. If you choose to install a certificate, right-click the **Azure** node in **Server Explorer**, and then select **Manage and Filter Subscriptions** in the context menu. In the **Manage Microsoft Azure Subscriptions** dialog box, click the **Certificates** tab, and then click **Import**. Follow the directions to download and then import a subscription file (also called a *.publishsettings* file) for your Azure account.
52+
An alternative is to install a management certificate that enables access to your account. If you choose to install a certificate, right-click the **Azure** node in **Server Explorer**, and then select **Manage and Filter Subscriptions** in the context menu. In the **Manage Microsoft Azure Subscriptions** dialog box, click the **Certificates** tab, and then click **Import**. Follow the directions to download and then import a subscription file (also called a *.publishsettings* file) for your Azure account.
5353

5454
> [!NOTE]
5555
> If you download a subscription file, save it to a folder outside your source code directories (for example, in the Downloads folder), and then delete it once the import has completed. A malicious user who gains access to the subscription file can edit, create, and delete your Azure services.
56-
>
57-
>
5856
5957
For more information about connecting to Azure resources from Visual Studio, see [Assign Azure roles using the Azure portal](/azure/role-based-access-control/role-assignments-portal).
6058
2. In **Server Explorer**, expand **Azure** and expand **App Service**.
@@ -443,43 +441,43 @@ Detailed error logs provide some additional information about HTTP requests that
443441
1. In the **Azure Web App Configuration** tab that you opened from **Server Explorer**, change **Detailed Error Messages** to **On**, and then click **Save**.
444442

445443
![Enable detailed error messages](./media/web-sites-dotnet-troubleshoot-visual-studio/tws-detailedlogson.png)
446-
447-
2. In the **Output** Window, click the **Specify which Microsoft Azure logs to monitor** button.
444+
445+
1. In the **Output** Window, click the **Specify which Microsoft Azure logs to monitor** button.
448446

449447
1. In the **Microsoft Azure Logging Options** dialog box, click **All logs**, and then click **OK**.
450448

451-
![Monitor all logs](./media/web-sites-dotnet-troubleshoot-visual-studio/tws-monitorall.png)
452-
449+
![Monitor all logs](./media/web-sites-dotnet-troubleshoot-visual-studio/tws-monitorall.png)
450+
453451
1. In the address bar of the browser window, add an extra character to the URL to cause a 404 error (for example, `http://localhost:53370/Home/Contactx`), and press Enter.
454452
455-
After several seconds, the detailed error log appears in the Visual Studio **Output** window.
453+
After several seconds, the detailed error log appears in the Visual Studio **Output** window.
456454

457-
![Detailed error log - Output window](./media/web-sites-dotnet-troubleshoot-visual-studio/tws-detailederrorlog.png)
458-
459-
Control+click the link to see the log output formatted in a browser:
455+
![Detailed error log - Output window](./media/web-sites-dotnet-troubleshoot-visual-studio/tws-detailederrorlog.png)
456+
457+
Control+click the link to see the log output formatted in a browser:
458+
459+
![Detailed error log - browser window](./media/web-sites-dotnet-troubleshoot-visual-studio/tws-detailederrorloginbrowser.png)
460460

461-
![Detailed error log - browser window](./media/web-sites-dotnet-troubleshoot-visual-studio/tws-detailederrorloginbrowser.png)
462-
463461
## <a name="downloadlogs"></a>Download file system logs
464462
Any logs that you can monitor in the **Output** window can also be downloaded as a *.zip* file.
465463

466464
1. In the **Output** window, click **Download Streaming Logs**.
467465

468-
:::image type="content" source="./media/web-sites-dotnet-troubleshoot-visual-studio/tws-downloadicon.png" alt-text="Screenshot of the Output window showing the Download Streaming Logs button highlighted.":::
466+
:::image type="content" source="./media/web-sites-dotnet-troubleshoot-visual-studio/tws-downloadicon.png" alt-text="Screenshot of the Output window showing the Download Streaming Logs button highlighted.":::
469467

470-
File Explorer opens to your *Downloads* folder with the downloaded file selected.
468+
File Explorer opens to your *Downloads* folder with the downloaded file selected.
471469

472-
:::image type="content" source="./media/web-sites-dotnet-troubleshoot-visual-studio/tws-downloadedfile.png" alt-text="Screenshot of the Downloads folder in File Explorer with a downloaded file selected.":::
470+
:::image type="content" source="./media/web-sites-dotnet-troubleshoot-visual-studio/tws-downloadedfile.png" alt-text="Screenshot of the Downloads folder in File Explorer with a downloaded file selected.":::
473471

474-
2. Extract the *.zip* file, and you see the following folder structure:
472+
1. Extract the *.zip* file, and you see the following folder structure:
475473

476-
:::image type="content" source="./media/web-sites-dotnet-troubleshoot-visual-studio/tws-logfilefolders.png" alt-text="Screenshot of the .zip file folder structure after the file has been extracted.":::
474+
:::image type="content" source="./media/web-sites-dotnet-troubleshoot-visual-studio/tws-logfilefolders.png" alt-text="Screenshot of the .zip file folder structure after the file has been extracted.":::
477475

478476
* Application tracing logs are in *.txt* files in the *LogFiles\Application* folder.
479477
* Web server logs are in *.log* files in the *LogFiles\http\RawLogs* folder. You can use a tool such as [Log Parser](https://www.iis.net/downloads/community/2010/04/log-parser-22) to view and manipulate these files.
480478
* Detailed error message logs are in *.html* files in the *LogFiles\DetailedErrors* folder.
481479

482-
(The *deployments* folder is for files created by source control publishing; it doesn't have anything related to Visual Studio publishing. The *Git* folder is for traces related to source control publishing and the log file streaming service.)
480+
(The *deployments* folder is for files created by source control publishing; it doesn't have anything related to Visual Studio publishing. The *Git* folder is for traces related to source control publishing and the log file streaming service.)
483481

484482
<!-- ## <a name="storagelogs"></a>View storage logs
485483
Application tracing logs can also be sent to an Azure storage account, and you can view them in Visual Studio. To do that you'll create a storage account, enable storage logs in the Azure portal, and view them in the **Logs** tab of the **Azure Web App** window.
@@ -571,45 +569,44 @@ You can view failed request tracing logs in a browser directly via FTP or locall
571569

572570
1. In the **Configuration** tab of the **Azure Web App** window that you opened from **Server Explorer**, change **Failed Request Tracing** to **On**, and then click **Save**.
573571

574-
![Enable failed request tracing](./media/web-sites-dotnet-troubleshoot-visual-studio/tws-failedrequeston.png)
575-
2. In the address bar of the browser window that shows the app, add an extra character to the URL and click Enter to cause a 404 error.
572+
![Enable failed request tracing](./media/web-sites-dotnet-troubleshoot-visual-studio/tws-failedrequeston.png)
573+
1. In the address bar of the browser window that shows the app, add an extra character to the URL and click Enter to cause a 404 error.
576574

577-
This causes a failed request tracing log to be created, and the following steps show how to view or download the log.
575+
This causes a failed request tracing log to be created, and the following steps show how to view or download the log.
578576

579-
3. In Visual Studio, in the **Configuration** tab of the **Azure Web App** window, click **Open in Management Portal**.
577+
1. In Visual Studio, in the **Configuration** tab of the **Azure Web App** window, click **Open in Management Portal**.
580578

581579
1. In the [Azure portal](https://portal.azure.com) **Settings** page for your app, click **Deployment credentials**, and then enter a new user name and password.
582580
583-
![New FTP user name and password](./media/web-sites-dotnet-troubleshoot-visual-studio/tws-enterftpcredentials.png)
584-
585-
> [!NOTE]
586-
> When you log in, you have to use the full user name with the app name prefixed to it. For example, if you enter "myid" as a user name and the site is "myexample", you log in as "myexample\myid".
587-
>
581+
![New FTP user name and password](./media/web-sites-dotnet-troubleshoot-visual-studio/tws-enterftpcredentials.png)
588582

589-
5. In a new browser window, go to the URL that is shown under **FTP hostname** or **FTPS hostname** in the **Overview** page for your app.
583+
> [!NOTE]
584+
> When you log in, you have to use the full user name with the app name prefixed to it. For example, if you enter "myid" as a user name and the site is "myexample", you log in as "myexample\myid".
585+
586+
1. In a new browser window, go to the URL that is shown under **FTP hostname** or **FTPS hostname** in the **Overview** page for your app.
590587

591-
6. Sign in using the FTP credentials that you created earlier (including the app name prefix for the user name).
588+
1. Sign in using the FTP credentials that you created earlier (including the app name prefix for the user name).
592589

593-
The browser shows the root folder of the app.
590+
The browser shows the root folder of the app.
594591

595592
1. Open the *LogFiles* folder.
596593

597-
![Open LogFiles folder](./media/web-sites-dotnet-troubleshoot-visual-studio/tws-logfilesfolder.png)
598-
594+
![Open LogFiles folder](./media/web-sites-dotnet-troubleshoot-visual-studio/tws-logfilesfolder.png)
595+
599596
1. Open the folder that is named W3SVC plus a numeric value.
600597

601-
![Open W3SVC folder](./media/web-sites-dotnet-troubleshoot-visual-studio/tws-w3svcfolder.png)
602-
603-
The folder contains XML files for any errors that have been logged after you enabled failed request tracing, and an XSL file that a browser can use to format the XML.
598+
![Open W3SVC folder](./media/web-sites-dotnet-troubleshoot-visual-studio/tws-w3svcfolder.png)
599+
600+
The folder contains XML files for any errors that have been logged after you enabled failed request tracing, and an XSL file that a browser can use to format the XML.
604601

605-
![W3SVC folder](./media/web-sites-dotnet-troubleshoot-visual-studio/tws-w3svcfoldercontents.png)
602+
![W3SVC folder](./media/web-sites-dotnet-troubleshoot-visual-studio/tws-w3svcfoldercontents.png)
606603

607604
1. Click the XML file for the failed request that you want to see tracing information for.
608605

609-
The following illustration shows part of the tracing information for a sample error.
606+
The following illustration shows part of the tracing information for a sample error.
607+
608+
![Failed request tracing in browser](./media/web-sites-dotnet-troubleshoot-visual-studio/tws-failedrequestinbrowser.png)
610609

611-
![Failed request tracing in browser](./media/web-sites-dotnet-troubleshoot-visual-studio/tws-failedrequestinbrowser.png)
612-
613610
## <a name="nextsteps"></a>Related content
614611
You've seen how Visual Studio makes it easy to view logs created by an App Service app. The following sections provide links to more resources on related topics:
615612

@@ -658,7 +655,7 @@ There are no thorough and up-to-date introductions to ASP.NET tracing available
658655
* [Tracing in ASP.NET MVC Razor Views](https://devblogs.microsoft.com/aspnet/tracing-in-asp-net-mvc-razor-views/)<br/>
659656
Besides tracing in Razor views, the post also explains how to create an error filter in order to log all unhandled exceptions in an MVC application. For information about how to log all unhandled exceptions in a Web Forms application, see the Global.asax example in [Complete Example for Error Handlers](/previous-versions/bb397417(v=vs.140)) on MSDN. In either MVC or Web Forms, if you want to log certain exceptions but let the default framework handling take effect for them, you can catch and rethrow as in the following example:
660657

661-
```csharp
658+
```csharp
662659
try
663660
{
664661
// Your code that might cause an exception to be thrown.
@@ -668,9 +665,9 @@ There are no thorough and up-to-date introductions to ASP.NET tracing available
668665
Trace.TraceError("Exception: " + ex.ToString());
669666
throw;
670667
}
671-
```
668+
```
672669

673-
* [Streaming Diagnostics Trace Logging from the Azure Command Line (plus Glimpse!)](https://www.hanselman.com/blog/StreamingDiagnosticsTraceLoggingFromTheAzureCommandLinePlusGlimpse.aspx)<br/>
670+
* [Streaming Diagnostics Trace Logging from the Azure Command Line (plus Glimpse!)](https://www.hanselman.com/blog/StreamingDiagnosticsTraceLoggingFromTheAzureCommandLinePlusGlimpse.aspx)
674671
How to use the command line to do what this tutorial shows how to do in Visual Studio. [Glimpse](https://www.hanselman.com/blog/IfYoureNotUsingGlimpseWithASPNETForDebuggingAndProfilingYoureMissingOut.aspx) is a tool for debugging ASP.NET applications.
675672
676673
For error logging, an alternative to writing your own tracing code is to use an open-source logging framework such as [ELMAH](https://nuget.org/packages/elmah/). For more information, see [Scott Hanselman's blog posts about ELMAH](https://www.hanselman.com/blog/NuGetPackageOfTheWeek7ELMAHErrorLoggingModulesAndHandlersWithSQLServerCompact.aspx).
@@ -680,18 +677,17 @@ Also, you don't need to use ASP.NET or `System.Diagnostics` tracing to get strea
680677
### Analyzing web server logs
681678
For more information about analyzing web server logs, see the following resources:
682679

683-
* [LogParser](https://www.iis.net/downloads/community/2010/04/log-parser-22)<br/>
680+
* [LogParser](https://www.iis.net/downloads/community/2010/04/log-parser-22)
684681
A tool for viewing data in web server logs (*.log* files).
685-
* [Troubleshooting IIS Performance Issues or Application Errors using LogParser](https://www.iis.net/learn/troubleshoot/performance-issues/troubleshooting-iis-performance-issues-or-application-errors-using-logparser)<br/>
682+
* [Troubleshooting IIS Performance Issues or Application Errors using LogParser](https://www.iis.net/learn/troubleshoot/performance-issues/troubleshooting-iis-performance-issues-or-application-errors-using-logparser)
686683
An introduction to the Log Parser tool that you can use to analyze web server logs.
687-
* [Blog posts by Robert McMurray on using LogParser](/archive/blogs/robert_mcmurray/using-logparser-with-ftp-7-x-sessions)<br/>
684+
* [Blog posts by Robert McMurray on using LogParser](/archive/blogs/robert_mcmurray/using-logparser-with-ftp-7-x-sessions)
688685
* [The HTTP status code in IIS 7.0, IIS 7.5, and IIS 8.0](https://support.microsoft.com/kb/943891)
689686
690687
### Analyzing failed request tracing logs
691688
The Microsoft TechNet website includes a [Using Failed Request Tracing](https://www.iis.net/learn/troubleshoot/using-failed-request-tracing) section, which may be helpful for understanding how to use these logs. However, this documentation focuses mainly on configuring failed request tracing in IIS, which you can't do in Azure App Service.
692689
693690
[GetStarted]: quickstart-dotnetcore.md
694-
[GetStartedWJ]: https://github.com/Azure/azure-webjobs-sdk/wiki
695-
691+
[GetStartedWJ](https://github.com/Azure/azure-webjobs-sdk/wiki): https://github.com/Azure/azure-webjobs-sdk/wiki
696692
697-
[!INCLUDE [Third-party contact disclaimer](~/includes/third-party-contact-disclaimer.md)]
693+
[!INCLUDE [Third-party contact disclaimer](~/includes/third-party-contact-disclaimer.md)]

0 commit comments

Comments
 (0)