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
Copy file name to clipboardExpand all lines: articles/app-service/quickstart-webjobs.md
+22-20Lines changed: 22 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,30 +23,30 @@ WebJobs is a feature of Azure App Service that enables you to run a program
23
23
-**[Always on](configure-common.md?tabs=portal#configure-general-settings)** must be enabled on your app.
24
24
- Ensure the App setting `WEBSITE_SKIP_RUNNING_KUDUAGENT` is set to `false`.
25
25
26
-
## Create your sample locally
26
+
## Create your WebJob locally
27
27
28
28
1. In this step, you create a basic .NET WebJob project and navigate to the project root.
29
29
30
-
```bash
31
-
dotnet new console -n webjob –framework net9.0
32
-
33
-
cd webjob
34
-
```
30
+
```bash
31
+
dotnet new console -n webjob –framework net9.0
32
+
33
+
cd webjob
34
+
```
35
35
36
36
1. Next, replace `Program.cs` to the following code that writes the current time to the console:
37
37
38
-
```dotnet
39
-
using System;
40
-
41
-
class Program
42
-
{
43
-
static void Main()
38
+
```dotnet
39
+
using System;
40
+
41
+
class Program
44
42
{
45
-
DateTimeOffset now = DateTimeOffset.Now;
46
-
Console.WriteLine("Current time with is: " + now.ToString("hh:mm:ss tt zzz"));
47
-
}
48
-
}
49
-
```
43
+
static void Main()
44
+
{
45
+
DateTimeOffset now = DateTimeOffset.Now;
46
+
Console.WriteLine("Current time with is: " + now.ToString("hh:mm:ss tt zzz"));
47
+
}
48
+
}
49
+
```
50
50
51
51
1. From the *webjob* directory, run the webjob to confirm the current time is output to the console:
52
52
@@ -385,7 +385,7 @@ The file, `run.sh`, calls webjob.php as shown below:
385
385
386
386
Select the log for the WebJob you created earlier.
387
387
388
-
:::image type="content" source="media/quickstart-webjobs/review-webjobs-logs.png" alt-text="Screenshot that shows how to view WebJob logs in an App Service app in the portal (scheduled WebJob).":::
388
+
:::image type="content" source="media/quickstart-webjobs/review-webjobs-logs.png" alt-text="Screenshot that shows how to view WebJob logs in an App Service app in the portal (scheduled WebJob).":::
389
389
390
390
391
391
The output should look similar to the following.
@@ -396,8 +396,10 @@ The output should look similar to the following.
396
396
397
397
To remove the WebJob, selectthe WebJob in the portal and select`Delete`.
398
398
399
-
:::image type="content" source="media/quickstart-webjobs/delete-webjobs.png" alt-text="Screenshot showing how you can delete a WebJob in the portal.":::
399
+
:::image type="content" source="media/quickstart-webjobs/delete-webjobs.png" alt-text="Screenshot showing how you can delete a WebJob in the portal.":::
400
400
401
401
## <a name="NextSteps"></a> Next steps
402
402
403
-
How to run
403
+
## Next step
404
+
405
+
[Explore more advanced WebJob scenarios, including triggers and deployment options](https://learn.microsoft.com/en-us/azure/app-service/webjobs-create)
0 commit comments