Skip to content

Commit 7f6d5c9

Browse files
committed
Clarity edits and update redirection file
1 parent cf02da6 commit 7f6d5c9

File tree

3 files changed

+51
-36
lines changed

3 files changed

+51
-36
lines changed

.openpublishing.redirection.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7899,6 +7899,11 @@
78997899
"redirect_url": "/azure/container-instances/container-instances-jenkins",
79007900
"redirect_document_id": false
79017901
},
7902+
{
7903+
"source_path": "articles/jenkins/java-deploy-webapp-tutorial.md",
7904+
"redirect_url": "/azure/jenkins/tutorial-jenkins-deploy-web-app-azure-app-service",
7905+
"redirect_document_id": true
7906+
},
79027907
{
79037908
"source_path": "articles/container-service/dcos-swarm/container-service-deployment.md",
79047909
"redirect_url": "/azure/container-service/dcos-swarm",
-78 Bytes
Loading

articles/jenkins/tutorial-jenkins-deploy-web-app-azure-app-service.md

Lines changed: 46 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,28 @@ ms.date: 11/15/2018
1313

1414
This tutorial deploys a sample Java web app from GitHub to
1515
[Azure App Service on Linux](/azure/app-service/containers/app-service-linux-intro)
16-
by setting up continuous integration (CI) and continuous deployment (CD) in Jenkins.
17-
That way, when you update your app by pushing commits to GitHub,
18-
Jenkins automatically builds and republishes your app to Azure App Service.
19-
The sample app in this tutorial was developed by using the
16+
by setting up continuous integration (CI) and continuous
17+
deployment (CD) in Jenkins. When you update the app by
18+
pushing commits to GitHub, Jenkins automatically builds
19+
and republishes your app to Azure App Service. The sample
20+
app in this tutorial was developed by using the
2021
[Spring Boot](http://projects.spring.io/spring-boot/) framework.
2122

2223
![Overview](media/jenkins-java-quickstart/overview.png)
2324

2425
In this tutorial, you'll complete these tasks:
2526

2627
> [!div class="checklist"]
27-
> * Install Jenkins plug-ins so you can work with GitHub,
28+
> * Install Jenkins plug-ins so you can build from GitHub,
2829
> deploy to Azure App Service, and other related tasks.
29-
> * Fork the GitHub sample repo so you have a copy for the sample app.
30+
> * Fork the sample GitHub repo so you have a working copy.
3031
> * Connect Jenkins to GitHub.
31-
> * Create an Azure service principal for authentication
32-
> without using your own credentials.
33-
> * Set up your Azure service principal in Jenkins.
34-
> * Create a Jenkins pipeline that builds and deploys the sample app
35-
> app each time you push an update to the sample app in GitHub.
36-
> * Create a build and deployment script for your Jenkins pipeline.
32+
> * Create an Azure service principal so Jenkins
33+
> can access Azure without using your credentials.
34+
> * Add your service principal to Jenkins.
35+
> * Create a Jenkins pipeline for building and deploying
36+
> the sample app each time you update the app in GitHub.
37+
> * Create a build and deployment script that your Jenkins pipeline can use.
3738
> * Point your Jenkins pipeline at the build and deployment script.
3839
> * Deploy your sample app to Azure by running a manual build.
3940
> * Push an app update in GitHub, which triggers Jenkins to build and redeploy to Azure.
@@ -95,6 +96,8 @@ the Jenkins management page for future steps.
9596

9697
1. Follow the prompts to select your GitHub account and finish forking.
9798

99+
Next, set up Jenkins with your GitHub credentials.
100+
98101
## Connect Jenkins to GitHub
99102

100103
To have Jenkins monitor GitHub and respond when new
@@ -144,15 +147,18 @@ by choosing **Test connection**.
144147

145148
![Check connection to GitHub server with new PAT](media/jenkins-java-quickstart/check-github-connection.png)
146149

150+
Next, create the Azure service principal that Jenkins
151+
uses for authenticating and accessing Azure resources.
152+
147153
## Create service principal
148154

149-
Later in this tutorial, you create a Jenkins pipeline job that builds
155+
In a later section, you create a Jenkins pipeline job that builds
150156
your app from GitHub and deploys your app to Azure App Service.
151-
To have Jenkins work access Azure without entering your credentials,
152-
create a [service principal in Azure Active Directory](https://docs.microsoft.com/azure/active-directory/develop/app-objects-and-service-principals).
153-
A service principal is a separate identity that Jenkins
154-
can use for authenticating and accessing Azure resources.
155-
To create this service principal, run the Azure CLI command
157+
To have Jenkins access Azure without entering your credentials,
158+
create a [service principal](https://docs.microsoft.com/azure/active-directory/develop/app-objects-and-service-principals)
159+
in Azure Active Directory for Jenkins. A service principal is
160+
a separate identity that Jenkins can use for authenticating access
161+
to Azure resources. To create this service principal, run the Azure CLI command
156162
[**`az ad sp create-for-rbac`**](https://docs.microsoft.com/cli/azure/create-an-azure-service-principal-azure-cli?view=azure-cli-latest),
157163
either from your local command line or Azure Cloud Shell, for example:
158164

@@ -198,7 +204,7 @@ select **Global credentials (unrestricted)**.
198204
1. From the **Kind** list, select **Azure Service Principal**.
199205

200206
1. Assign these values from your service principal
201-
and elsewhere to these credential properties:
207+
and Azure subscription to these properties:
202208

203209
| Property | Value | Description |
204210
|----------|-------|-------------|
@@ -213,11 +219,12 @@ and elsewhere to these credential properties:
213219

214220
![Add Azure service principal credentials](media/jenkins-java-quickstart/add-service-principal-credentials.png)
215221

216-
1. To confirm your service principal works,
217-
choose **Verify Service Principal**.
218-
When you're done, choose **OK**.
222+
1. To confirm that your service principal works,
223+
choose **Verify Service Principal**. When you're done, choose **OK**.
219224

220-
## Create build and deploy pipeline
225+
Next, create the Jenkins pipeline that builds and deploys your app.
226+
227+
## Create pipeline
221228

222229
In Jenkins, create the pipeline job for building and deploying your app.
223230

@@ -247,17 +254,21 @@ can deploy to Azure without using your own credentials.
247254
WEB_APP=yourWebAppName
248255
```
249256
250-
Here's how the **Properties Content** box appears when you're done:
257+
Here's how the **Properties Content** box appears:
251258
252259
![Select "Prepare an environment for the run" and set environment variables](media/jenkins-java-quickstart/prepare-environment-for-run.png)
253260
254261
1. When you're done, choose **Save**.
255262
256-
## Create build and deploy scripts
263+
Next, create build and deployment scripts for Jenkins.
264+
265+
## Create scripts
257266
258-
1. In your GitHub fork's `src/main/resources/` folder,
259-
create a config file named `web.config` that contains this XML
260-
but replaces `$(JAR_FILE_NAME)` with `gs-spring-boot-0.1.0.jar`:
267+
Now create the files that Jenkins uses for building and deploying your app.
268+
269+
1. In your GitHub fork's `src/main/resources/` folder, create this
270+
app configuration file named `web.config`, which contains this XML
271+
but replace `$(JAR_FILE_NAME)` with `gs-spring-boot-0.1.0.jar`:
261272
262273
```xml
263274
<?xml version="1.0" encoding="UTF-8">
@@ -266,14 +277,13 @@ but replaces `$(JAR_FILE_NAME)` with `gs-spring-boot-0.1.0.jar`:
266277
<handlers>
267278
<add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
268279
</handlers>
269-
<httpPlatform processPath="%JAVA_HOME%\bin\java.exe"
270-
arguments="-Djava.net.preferIPv4Stack=true -Dserver.port=%HTTP_PLATFORM_PORT% -jar &quot;%HOME%\site\wwwroot\${JAR_FILE_NAME}&quot;"></httpPlatform>
280+
<httpPlatform processPath="%JAVA_HOME%\bin\java.exe" arguments="-Djava.net.preferIPv4Stack=true -Dserver.port=%HTTP_PLATFORM_PORT% -jar &quot;%HOME%\site\wwwroot\${JAR_FILE_NAME}&quot;"></httpPlatform>
271281
</system.webServer>
272282
</configuration>
273283
```
274284

275-
1. In your GitHub fork's root folder, create a build and deployment
276-
script named `Jenkinsfile` that contains this text
285+
1. In your GitHub fork's root folder, create this build and
286+
deployment script named `Jenkinsfile`, which contains this text
277287
([source in GitHub here](https://github.com/Microsoft/todo-app-java-on-azure/blob/master/doc/resources/jenkins/Jenkinsfile-webapp-se)):
278288

279289
```text
@@ -326,13 +336,13 @@ select **Pipeline script from SCM**.
326336
1. In the **Script Path** box,
327337
add the path to your "Jenkinsfile" script.
328338

329-
1. When you're done, choose **Save**.
339+
Your pipeline definition looks like this example:
330340

331-
For example:
341+
![Point pipeline at script](media/jenkins-java-quickstart/set-up-jenkins-github.png)
332342

333-
![Point pipeline at script](media/jenkins-java-quickstart/set-up-jenkins-github.png)
343+
1. When you're done, choose **Save**.
334344

335-
Next, you'll build and deploy your app to Azure App Service.
345+
Next, build and deploy your app to Azure App Service.
336346

337347
## Build and deploy to Azure
338348

0 commit comments

Comments
 (0)