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: docs/java/extensions.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ DateApproved: 11/14/2017
8
8
MetaDescription: Popular Java Extensions for VS Code
9
9
MetaSocialImage: TBD
10
10
---
11
-
# Java extensions for VS Code
11
+
# Java Extensions for VS Code
12
12
13
13
Visual Studio Code provides many features as an editor. In addition to that, you can install some high quality extensions to add features to VS Code for Java development.
Copy file name to clipboardExpand all lines: docs/java/java-container.md
+12-6Lines changed: 12 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,8 +12,6 @@ MetaSocialImage: TBD
12
12
13
13
This 15 minutes tutorial will walk you through the process of building a [Docker](https://docker.com/) image for running a Java application in Visual Studio Code.
14
14
15
-
## Scenario
16
-
17
15
We will continue using the same Spring Boot application we built in our first [Java Tutorial](/docs/java/java-tutorial.md).
18
16
19
17
[Docker](https://docker.com/) is a Linux container management toolkit which allows users to publish container images and consume those published by others. A Docker image is a recipe for running a containerized process. In this tutorial, we will build an Docker image for the web app, run the image locally and then finally deploy it to the cloud.
@@ -65,16 +63,24 @@ Test the web app by browsing to `http://localhost:8080` using a web browser. You
65
63
66
64

67
65
68
-
## Deploying images to Azure App Service
66
+
## Push your image to Docker Hub
69
67
70
-
With the Docker Explorer, you can deploy images from DockerHub Registries or Azure Container Registries, directly to an Azure App Service instance. This functionality requires installing the [Azure Account](https://marketplace.visualstudio.com/items?itemName=ms-vscode.azure-account) extension and an Azure Subscription. If you do not have an Azure subscription, [sign up today](https://azure.microsoft.com//free/?b=16.48) for a free 30 day account and get $200 in Azure Credits to try out any combination of Azure services.
68
+
You can deploy your docker image to Azure from either public or private container registory. In this tutorial, we will use Docker Hub. If you do not have a DockerHub account, create one from [Docker Hub](https://hub.docker.com/)
71
69
72
-
The first time you expand the DockerHub node, you'll be prompted to log into your DockerHub account.
70
+
The first time you expand the DockerHub node in Docker Explorer, you'll be prompted to log into your DockerHub account.
Your user name and password are stored in your operating system credentials vault (for example, MacOS keychain or Windows Credential Store) so that you don't need to log in every time. You can log out of DockerHub by right clicking on the DockerHub label and choosing **Log Out**. This will delete the credentials from the OS store.
77
75
76
+
Then push your image to DockHub. Make sure the name of your image starts with your Docker ID.
With the Docker Explorer, you can deploy images from DockerHub Registries or Azure Container Registries, directly to an Azure App Service instance. This functionality requires installing the [Azure Account](https://marketplace.visualstudio.com/items?itemName=ms-vscode.azure-account) extension and an Azure Subscription. If you do not have an Azure subscription, [sign up today](https://azure.microsoft.com//free/?b=16.48) for a free 30 day account and get $200 in Azure Credits to try out any combination of Azure services.
83
+
78
84
To log into Azure, run **Azure Login** from the **Command Palette** (`kb(workbench.action.showCommands)`). You can then sign into your account using the **Device Login** flow. Click on **Copy & Open** to open your default browser.
Copy file name to clipboardExpand all lines: docs/java/java-tutorial.md
+9-5Lines changed: 9 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,12 +3,12 @@ Order: 1
3
3
Area: java
4
4
TOCTitle: Java Tutorial
5
5
ContentId: 12d8264b-643f-4745-a7ea-8433dedb1331
6
-
PageTitle: Java Web App Tutorial in VS Code
6
+
PageTitle: Build Java Web App With VS Code
7
7
DateApproved: 11/14/2017
8
8
MetaDescription: Java tutorial showing Java language support in the Visual Studio Code editor.
9
9
MetaSocialImage: TBD
10
10
---
11
-
# Build a Java web app in VS Code
11
+
# Build Java Web App With VS Code
12
12
13
13
This 5 minutes tutorial shows you how to create a simple Java web application with Visual Studio Code. You'll learn how to run and debug it locally, and prepare for running it in the cloud.
14
14
@@ -22,9 +22,11 @@ A simple Spring Boot Getting Started web app
22
22
23
23
Before running and deploying this sample, you must have JDK and Maven on your local development environment. If not, please install them.
24
24
25
-
Download and install the Java SE Development Kit (JDK):
25
+
Download and install the Java SE Development Kit (JDK), version 8:
>**Note**: The `JAVA_HOME` environment variable must be set to the install location of the JDK to complete this tutorial.
28
30
29
31
Download Apache Maven version 3 or greater:
30
32
@@ -38,9 +40,11 @@ Install Apache Maven for your local development environment:
38
40
39
41
Clone the [Spring Boot Getting Started](https://github.com/spring-guides/gs-spring-boot) sample project to your local machine. You can clone a Git repository with the **Git: Clone** command in the **Command Palette** (`kb(workbench.action.showCommands)`). Paste `https://github.com/microsoft/gs-spring-boot.git` as the URL of the remote repository and then decide the parent directory under which to put the local repository. After that, you can open the cloned repository in VS Code.
40
42
43
+
>**Note**: You can install Visual Studio Code from https://code.visualstudio.com/ and Git from https://code.visualstudio.com/.
44
+
41
45

42
46
43
-
Open any of the Java files in the repository. If you haven't got the Java related extensions installed with your VS Code, you would be recommended to install the Java extension pack. Just follow the instruction and install the Java Extension Pack from Microsoft.
47
+
Open any of the Java files in the repository. If you haven't got the Java related extensions installed with your VS Code, you would be recommended to install the Java extension pack. Just follow the instruction and install the Java Extension Pack from Microsoft. Reload VS Code after the installation.
Copy file name to clipboardExpand all lines: docs/java/java-webapp.md
+8-64Lines changed: 8 additions & 64 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,12 +3,12 @@ Order: 2
3
3
Area: java
4
4
TOCTitle: Java Web App
5
5
ContentId: 98ddf1d3-6a8e-4b0f-a44d-e57cfdf2348c
6
-
PageTitle: Deploy Java Web App to Azure
6
+
PageTitle: Deploy Java Web App to Cloud
7
7
DateApproved: 11/14/2017
8
8
MetaDescription: Java web app tutorial showing how to deploy a Java web app to Azure
9
9
MetaSocialImage: TBD
10
10
---
11
-
# Deploy a Java Web App to Azure
11
+
# Deploy Java Web App to Cloud
12
12
13
13
In our [first tutorial](/docs/java/java-tutorial.md), we've build a Java web app running locally. This tutorial will show you how to run it in the cloud.
14
14
@@ -22,11 +22,11 @@ If you don't have an Azure subscription, you can sign up for a [free Azure accou
22
22
23
23
The [Azure Command-Line Interface (CLI)](https://docs.microsoft.com/cli/azure/overview):
[comment]: <>(Replace it with using App Service Extension once Java support is ready)
28
28
29
-
## Create an Azure service principal
29
+
## Login with Azure CLI
30
30
31
31
We'll use the [Integrated Terminal](/docs/editor/integrated-terminal.md) in VS Code. To open the terminal you can either:
32
32
@@ -44,69 +44,13 @@ az login
44
44
45
45
Follow the instructions to complete the sign-in process.
46
46
47
-
Create an Azure service principal:
47
+
## Update your project to use Azure CLI for authentication
48
48
49
-
```bash
50
-
az ad sp create-for-rbac --name "uuuuuuuu" --password "pppppppp"
51
-
```
52
-
53
-
where `uuuuuuuu` is the user name and `pppppppp` is the password for the service principal.
54
-
55
-
Azure responds with JSON that resembles the following example:
56
-
57
-
```bash
58
-
{
59
-
"appId": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa",
60
-
"displayName": "uuuuuuuu",
61
-
"name": "http://uuuuuuuu",
62
-
"password": "pppppppp",
63
-
"tenant": "tttttttt-tttt-tttt-tttt-tttttttttttt"
64
-
}
65
-
```
66
-
67
-
> You will use the values from this JSON response when you configure the Maven plugin to deploy your web app to Azure. The `aaaaaaaa`, `uuuuuuuu`, `pppppppp`, and `tttttttt` are placeholder values, which are used in this example to make it easier to map these values to their respective elements when you configure your Maven `settings.xml` file in the next section.
68
-
69
-
## Configure Maven to use your Azure service principal
70
-
71
-
Open your Maven `settings.xml` file in a text editor. There are two locations where the `settings.xml` file may live:
72
-
73
-
* The Maven install: ${maven.home}/conf/settings.xml
Open your `pom.xml` file in your project folder (complete). Find and remove the below snippet in azure-webapp-maven-plugin configuration section so we will authenticate with Azure using Azure CLI, which we've already logged in with.
100
50
101
-
Element | Description
102
-
---|---
103
-
`<id>` | Specifies a unique name which Maven uses to look up your security settings when you deploy your web app to Azure.
104
-
`<client>` | Contains the `appId` value from your service principal.
105
-
`<tenant>` | Contains the `tenant` value from your service principal.
106
-
`<key>` | Contains the `password` value from your service principal.
107
-
`<environment>` | Defines the target Azure cloud environment, which is `AZURE` in this example. (A full list of environments is available in the [Maven Plugin for Azure Web Apps](TBD) documentation)
>**Note**: This specific configuration will instead using Service Principal for authentication. More details could be found at [Configure Maven to use your Azure Service Principal](https://docs.microsoft.com/en-us/azure/app-service/app-service-web-deploy-spring-boot-app-with-maven-plugin#configure-maven-to-use-your-azure-service-principal)
0 commit comments