You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Install <ahref="https://www.visualstudio.com/downloads/"target="_blank">Visual Studio 2022</a> with the **ASP.NET and web development** and **Azure development** workloads. You can add the workloads to an existing Visual Studio installation by selecting **Tools** > **Get Tools and Features** in Visual Studio.
33
+
- Install <ahref="https://www.visualstudio.com/downloads/"target="_blank">Visual Studio 2022</a> with the **ASP.NET and web development** and **Azure development** workloads. You can add the workloads to an existing Visual Studio installation by selecting **Get Tools and Features** in the Visual Studio**Tools** menu.
35
34
36
35
## Create and run the app
37
36
@@ -54,9 +53,9 @@ The sample project contains a basic [ASP.NET MVC](https://www.asp.net/mvc) creat
54
53
55
54
## Publish the app to Azure
56
55
57
-
The app uses a database context to connect with the database. The database context in this sample is a connection string named `MyDbConnection`.
56
+
To publish the app to Azure, you create and configure a Publish profile that has an Azure App Service and App Service Plan to host the app. You then create an Azure SQL Server and Azure SQL database to contain the app data, and configure a database context to connect the app with the database.
58
57
59
-
The connection string is set in the *Web.config* file and referenced in the *Models/MyDatabaseContext.cs* file. The Azure app uses the connection string name to connect to the Azure SQL database.
58
+
The database context in this sample is a connection string named `MyDbConnection`. The connection string is set in the *Web.config* file and referenced in the *Models/MyDatabaseContext.cs* file. The Azure app uses the connection string name to connect to the Azure SQL database.
60
59
61
60
1. In Visual Studio **Solution Explorer**, right-click the **DotNetAppSqlDb** project and select **Publish**.
62
61
@@ -123,7 +122,7 @@ Before you can create a database, you need a [logical SQL server](/azure/azure-s
123
122
124
123
1. On the **Azure SQL Database** screen, next to **Database server**, select **New**.
125
124
126
-
Change the server name to a value you want. The server name must be unique across all servers in Azure SQL.
125
+
1. Change the server name to a value you want. The server name must be unique across all servers in Azure SQL.
127
126
128
127
1. Add an administrator username and password. For password requirements, see [Password policy](/sql/relational-databases/security/password-policy).
129
128
@@ -322,7 +321,7 @@ Now that you enabled Code First Migrations in your Azure app, publish your code
322
321
323
322
You can stream tracing messages directly from your Azure app to Visual Studio.
324
323
325
-
Open _Controllers\TodosController.cs_, and note that each action starts with a `Trace.WriteLine()` method. This code is added to show you how to add trace messages to your Azure app.
324
+
Open _Controllers\TodosController.cs_, and note that each action starts with a `Trace.WriteLine()` method. This code shows you how to add trace messages to your Azure app.
326
325
327
326
### Enable log streaming
328
327
@@ -336,27 +335,27 @@ Open _Controllers\TodosController.cs_, and note that each action starts with a `
336
335
337
336

338
337
339
-
However, you don't see any trace messages yet. That's because when you first select **View streaming logs**, your Azure app sets the trace level to `Error`, which logs only error events using the `Trace.TraceError()` method.
340
-
338
+
You don't see any trace messages yet, because when you first select **View streaming logs**, your Azure app sets the trace level to `Error`, which logs only error events using the `Trace.TraceError()` method.
339
+
341
340
### Change trace levels
342
341
343
342
1. To change the trace levels to output other trace messages, in the **Hosting** section of the **Publish** page, select the **...** at upper right and select **Open in Azure portal**.
344
343
345
-
1. On the portal page for your app, select **App Service logs** under **Monitoring** in the left menu.
344
+
1. On the Azure portal page for your app, select **App Service logs** under **Monitoring** in the left menu.
346
345
347
346
1. Under **Application logging (Filesystem)**, select **Verbose** under **Level**, and then select **Save**.
348
347
349
348
> [!TIP]
350
349
> You can experiment with different trace levels to see what types of messages are displayed for each level. For example, the **Information** level includes all logs created by `Trace.TraceInformation()`, `Trace.TraceWarning()`, and `Trace.TraceError()`, but not logs created by `Trace.WriteLine()`.
351
350
352
-
1. In your browser, navigate to your app again at *http://<your app name>.azurewebsites.net*, then try clicking around the to-do list application in Azure. The trace messages are now streamed to the **Output** window in Visual Studio.
351
+
1. In your browser, go to your Azure to-do list application again and navigate around the app. Trace messages like the following examples now stream to the **Output** window in Visual Studio.
353
352
354
-
```console
353
+
```console
355
354
Application:2025-05-12T23:41:11 PID[17108] Verbose GET /Todos/Index
356
355
Application:2025-05-12T23:42:04 PID[17108] Verbose GET /Todos/Index
357
356
Application:2025-05-12T23:42:06 PID[17108] Verbose POST /Todos/Create
358
357
Application:2025-05-12T23:42:07 PID[17108] Verbose GET /Todos/Index
0 commit comments