Skip to content

Commit 25718c9

Browse files
committed
remove indents
1 parent bbe4499 commit 25718c9

File tree

2 files changed

+65
-65
lines changed

2 files changed

+65
-65
lines changed

articles/app-service/quickstart-webjobs.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: 'Create a scheduled Python WebJob'
3-
description: WebJobs on App Service enable you to automate repetitive tasks on your app. Learn how to create scheduled WebJobs in Azure App Service.
2+
title: 'Create a scheduled WebJob using a prebuilt script'
3+
description: Quickly schedule a time-based WebJob in Azure App Service using a prebuilt script for Windows or Linux.
44
ms.topic: quickstart
55
ms.date: 4/24/2025
66
author: msangapu-msft
@@ -18,7 +18,7 @@ WebJobs in Azure App Service let you run scripts or programs as background tasks
1818
- An Azure account. [Create one for free](https://azure.microsoft.com/free/).
1919
- An existing App Service app running on your preferred OS:
2020
- Windows App Service (any stack: code or container)
21-
- Linux App Service (any stack: code or container))
21+
- Linux App Service (any stack: code or container)
2222
- Enable **Always On** in the App Service settings: [Configure Always On](configure-common.md?tabs=portal#configure-general-settings)
2323
- For Windows containers and all Linux apps, set the app setting `WEBSITE_SKIP_RUNNING_KUDUAGENT = false`
2424

articles/app-service/tutorial-webjobs.md

Lines changed: 62 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: 'Create a scheduled WebJob'
2+
title: 'Create a custom scheduled WebJob'
33
description: WebJobs on App Service enable you to automate repetitive tasks on your app. Learn how to create scheduled WebJobs in Azure App Service.
44
ms.topic: tutorial
55
ms.date: 5/1/2025
@@ -127,19 +127,19 @@ You can [download a pre-built sample project](https://github.com/Azure-Samples/A
127127

128128
The Python script, `webjob.py`, outputs the current time to the console as shown below:
129129

130-
```Python
131-
import datetime
132-
133-
current_datetime = datetime.datetime.now()
134-
print(current_datetime) # Output: 2025-03-27 10:27:21.240752
135-
```
130+
```Python
131+
import datetime
132+
133+
current_datetime = datetime.datetime.now()
134+
print(current_datetime) # Output: 2025-03-27 10:27:21.240752
135+
```
136136

137137
The file, `run.sh`, calls WebJob.py as shown below:
138138

139-
```Bash
140-
#!/bin/bash
141-
/opt/python/3/bin/python3.13 webjob.py
142-
```
139+
```Bash
140+
#!/bin/bash
141+
/opt/python/3/bin/python3.13 webjob.py
142+
```
143143

144144
## Create a scheduled WebJob
145145

@@ -185,24 +185,24 @@ You can [download a pre-built sample project](https://github.com/Azure-Samples/A
185185
186186
The JavaScript, `webjob.js`, outputs the current time to the console as shown below:
187187
188-
```JavaScript
189-
// Import the 'Date' object from JavaScript
190-
const currentTime = new Date();
191-
192-
// Format the time as a string
193-
const formattedTime = currentTime.toLocaleTimeString();
194-
195-
// Output the formatted time to the console
196-
console.log(`Current system time is: ${formattedTime}`);
197-
```
188+
```JavaScript
189+
// Import the 'Date' object from JavaScript
190+
const currentTime = new Date();
191+
192+
// Format the time as a string
193+
const formattedTime = currentTime.toLocaleTimeString();
194+
195+
// Output the formatted time to the console
196+
console.log(`Current system time is: ${formattedTime}`);
197+
```
198198
199199
The file, `run.sh`, calls webjob.js as shown below:
200200
201-
```Bash
202-
#!/bin/bash
203-
204-
node webjob.js
205-
```
201+
```Bash
202+
#!/bin/bash
203+
204+
node webjob.js
205+
```
206206
207207
## Create a scheduled WebJob
208208
@@ -251,42 +251,42 @@ WebJobs is a feature of Azure App Service that enables you to run a program
251251

252252
The Java project located at `project/src/main/java/webjob/HelloWorld.java` outputs a message & the current time to the console.
253253

254-
```Java
255-
import java.time.LocalDateTime;
256-
257-
public class HelloWorld {
258-
259-
public static void main(String[] args) {
260-
261-
System.out.println("------------------------------------------------------------");
262-
System.out.println("Hello World from WebJob: " + LocalDateTime.now());
263-
System.out.println("------------------------------------------------------------");
264-
}
254+
```Java
255+
import java.time.LocalDateTime;
256+
257+
public class HelloWorld {
258+
259+
public static void main(String[] args) {
260+
261+
System.out.println("------------------------------------------------------------");
262+
System.out.println("Hello World from WebJob: " + LocalDateTime.now());
263+
System.out.println("------------------------------------------------------------");
265264
}
266-
```
265+
}
266+
```
267267
268268
### Build the Java WebJob
269269
270270
1. The `run.sh` script runs a jar with the name that set in the Maven configuration. This script will run when our WebJob is triggered.
271271
272-
```bash
273-
java -jar webjob-artifact-1.0.0.jar
274-
```
272+
```bash
273+
java -jar webjob-artifact-1.0.0.jar
274+
```
275275
276276
1. Next, we compile the Java project to produce the executable `.jar`. There are multiple ways to do this, but for this example, we’ll use Maven. Run the following commands from the `project/` directory:
277277
278-
```bash
279-
mvn install
280-
mvn package
281-
```
278+
```bash
279+
mvn install
280+
mvn package
281+
```
282282
283283
The jar files will be located at `project/target/webjob-artifact-1.0.0.jar` after a successful build.
284284
285285
1. Move the jar file to the root of the git repo with `mv project/target/webjob-artifact-1.0.0.jar .` Next you package our application as a `.zip` file.
286286
287-
```bash
288-
zip webjob.zip run.sh webjob-artifact-1.0.0.jar
289-
```
287+
```bash
288+
zip webjob.zip run.sh webjob-artifact-1.0.0.jar
289+
```
290290
291291
## Create a scheduled WebJob on Azure
292292
@@ -333,23 +333,23 @@ You can [download a pre-built sample project](https://github.com/Azure-Samples/A
333333
334334
The PHP script, `webjob.php`, outputs the current time to the console as shown below:
335335
336-
```PHP
337-
<?php
338-
// Get the current time
339-
$current_time = date("Y-m-d H:i:s");
340-
341-
// Display the current time
342-
echo "The current time is: " . $current_time;
343-
?>
344-
```
336+
```PHP
337+
<?php
338+
// Get the current time
339+
$current_time = date("Y-m-d H:i:s");
340+
341+
// Display the current time
342+
echo "The current time is: " . $current_time;
343+
?>
344+
```
345345
346346
The file, `run.sh`, calls webjob.php as shown below:
347347
348-
```Bash
349-
#!/bin/bash
350-
351-
php -f webjob.php
352-
```
348+
```Bash
349+
#!/bin/bash
350+
351+
php -f webjob.php
352+
```
353353
354354
## Create a scheduled WebJob
355355

0 commit comments

Comments
 (0)