Skip to content

Commit ce5a804

Browse files
author
Glenn Gailey
committed
webjobs freshness
1 parent 3280cfc commit ce5a804

File tree

1 file changed

+23
-22
lines changed

1 file changed

+23
-22
lines changed

articles/app-service/webjobs-sdk-get-started.md

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ In this section, you set up console logging that uses the [ASP.NET Core logging
8383
Here's the **Package Manager Console** command:
8484
8585
```powershell
86-
Install-Package Microsoft.Extensions.Logging.Console -version <2_X_VERSION>
86+
Install-Package Microsoft.Extensions.Logging.Console -version <3_X_VERSION>
8787
```
8888

8989
1. In *Program.cs*, add a `using` statement:
@@ -92,7 +92,7 @@ In this section, you set up console logging that uses the [ASP.NET Core logging
9292
using Microsoft.Extensions.Logging;
9393
```
9494

95-
In this command, replace `<2_X_VERSION>` with a supported 2.x version of the package.
95+
In this command, replace `<3_X_VERSION>` with a supported 3.x version of the package.
9696

9797
1. Call the [`ConfigureLogging`](/dotnet/api/microsoft.aspnetcore.hosting.webhostbuilderextensions.configurelogging) method on [`HostBuilder`](/dotnet/api/microsoft.extensions.hosting.hostbuilder). The [`AddConsole`](/dotnet/api/microsoft.extensions.logging.consoleloggerextensions.addconsole) method adds console logging to the configuration.
9898

@@ -161,22 +161,22 @@ Starting with version 3.x, you must explicitly install the Storage binding exten
161161
1. Right-click the project, select **Add** > **New Item...**, choose **Class**, name the new C# class file *Functions.cs*, and select **Add**.
162162

163163
1. In Functions.cs, replace the generated template with the following code:
164-
165-
```cs
166-
using Microsoft.Azure.WebJobs;
167-
using Microsoft.Extensions.Logging;
168-
169-
namespace WebJobsSDKSample
170-
{
171-
public class Functions
172-
{
173-
public static void ProcessQueueMessage([QueueTrigger("queue")] string message, ILogger logger)
174-
{
175-
logger.LogInformation(message);
176-
}
177-
}
178-
}
179-
```
164+
165+
```cs
166+
using Microsoft.Azure.WebJobs;
167+
using Microsoft.Extensions.Logging;
168+
169+
namespace WebJobsSDKSample
170+
{
171+
public class Functions
172+
{
173+
public static void ProcessQueueMessage([QueueTrigger("queue")] string message, ILogger logger)
174+
{
175+
logger.LogInformation(message);
176+
}
177+
}
178+
}
179+
```
180180

181181
The `QueueTrigger` attribute tells the runtime to call this function when a new message is written on an Azure Storage queue called `queue`. The contents of the queue message are provided to the method code in the `message` parameter. The body of the method is where you process the trigger data. In this example, the code just logs the message.
182182

@@ -354,16 +354,17 @@ In this section, you do the following tasks to set up Application Insights loggi
354354

355355
To take advantage of [Application Insights](../azure-monitor/app/app-insights-overview.md) logging, update your logging code to do the following:
356356

357-
* Add an Application Insights logging provider with default [filtering](webjobs-sdk-how-to.md#log-filtering); all Information and higher-level logs goes to both the console and Application Insights when you're running locally.
357+
* Add an Application Insights logging provider with default [filtering](webjobs-sdk-how-to.md#log-filtering). When running locally, all Information and higher-level logs are written to both the console and Application Insights.
358358
* Put the [LoggerFactory](./webjobs-sdk-how-to.md#logging-and-monitoring) object in a `using` block to ensure that log output is flushed when the host exits.
359359

360-
1. Install the latest stable 3.x version of the NuGet package for the Application Insights logging provider: `Microsoft.Azure.WebJobs.Logging.ApplicationInsights`.
360+
1. Install the latest stable 3.x version of the [`Microsoft.Azure.WebJobs.Logging.ApplicationInsights` NuGet package](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Logging.ApplicationInsights/).
361361
362-
Here's the **Package Manager Console** command for version 3.0.2:
362+
Here's the **Package Manager Console** command:
363363

364364
```powershell
365-
Install-Package Microsoft.Azure.WebJobs.Logging.ApplicationInsights -Version 3.0.2
365+
Install-Package Microsoft.Azure.WebJobs.Logging.ApplicationInsights -Version <3_X_VERSION>
366366
```
367+
In this command, replace `<3_X_VERSION>` with a supported version of the package.
367368

368369
1. Open *Program.cs* and replace the code in the `Main` method with the following code:
369370

0 commit comments

Comments
 (0)