title | layout | nav_order |
---|---|---|
Install |
home |
2 |
{: .no_toc }
For running this lab with all the needed tooling, there are 3 options available:
-
TOC {:toc}
{: .important }
All the steps of this lab have been tested in the GitHub CodeSpace. This is the preferred option for running this lab!
The git repository of this lab contains a dev container for Java development. This container contains all the needed tools for running this lab. In case you want to use this dev container you can use a GitHub CodeSpace in case your GitHub account is enabled for Codespaces.
-
Navigate to the GitHub repository of this lab and select Fork.
{: .note }
In case you are using a GitHub EMU account, it might be you are not able to fork a public repository. In that case, create a new repository with the same name, clone the original repository, add your new repository as a remote and push to this new remote.
-
Make sure your own username is indicated as the fork
Owner
-
Select Create fork. This will create a copy or fork of this project in your own account.
-
Navigate to the newly forked GitHub project.
-
Select Code and next Codespaces.
-
Select Create a codespace.
Your codespace will now get created in your browser window. Once creation is done, you can start executing the next steps of the lab.
The git repository of this lab contains a dev container for Java development. This container contains all the needed tools for running this lab. For this option you need the following tools to be installed on your local system:
- Visual Studio Code available from Visual Studio Code Downloads
- Git for Windows available from Git Downloads, or similar on another OS.
- Note: If needed, reinstall Git and, during installation, ensure that the Git Credential Manager is enabled.
- Visual Studio Code Remote Containers option.
- docker.
{: .note }
Following the installation of Git, ensure to set the global configuration variables
user.email
anduser.name
by running the following commands from the commandline shell (replace the<your-email-address>
and<your-full-name>
placeholders with your email address and your full name):
git config --global user.email "<your-email-address>"
git config --global user.name "<your-full-name>"
To get started follow the below step by step instructions:
-
Navigate to the GitHub repository of this lab and select Fork.
-
Make sure your own username is indicated as the fork
Owner
-
Select Create fork. This will create a copy or fork of this project in your own account.
{: .note }
In case you are using a GitHub EMU account, it might be you are not able to fork a public repository. In that case, create a new repository with the same name, clone the original repository, add your new repository as a remote and push to this new remote.
-
On your lab computer, in the commandline window, run the following commands to clone your fork of the spring-petclinic-microservices project to your workstation. Make sure to replace
<your-github-account>
in the below command:mkdir workspaces cd workspaces git clone https://github.com/<your-github-account>/java-microservices-aca-lab.git
-
When prompted to sign in to GitHub, select the Sign in with your browser option. This will automatically open a new tab in the web browser window, prompting you to provide your GitHub username and password.
-
In the browser window, enter your GitHub credentials, select Sign in, and, once successfully signed in, close the newly opened browser tab.
-
In workspaces folder double check that the spring petclinic application got cloned correctly. You can use the repository in your workspaces folder to regularly push your changes to.
{: .note }
However in one of the lab steps you will put a GitHub PAT token in one of the configuration files, make sure to not commit this PAT token, since it will immediately get invalidated by GitHub. Once invalidated your next lab steps will fail. You can use the [LabTips]({% link tips.md %}) to recover from this.
-
Navigate into the
java-microservices-aca-lab
folder that got created and open the project with Visual Studio Codecd java-microservices-aca-lab code .
-
With the Visual Studio Code Remote Containers plugin installed, you can now open the project in a remote container. This will reopen the project in a docker container with all the tooling installed.
{: .note }
Only use this option in case you feel comfortable with installing a lot of tooling on your local workstation. Also note that it is impossible for us to test all lab steps with all possible local configurations. The above 2 install options have the absolute preference for running this lab! So basically: proceed at your own risk.
{: .note }
This lab contains guidance for a Windows workstation. Your workstation should contain the following components:
- Visual Studio Code available from Visual Studio Code Downloads
- Java and Spring Boot Visual Studio Code extension packs available from Java extensions for Visual Studio Code
- Git for Windows available from Git Downloads, or similar on another OS.
{: .note }
If needed, reinstall Git and, during installation, ensure that the Git Credential Manager is enabled.
- Apache Maven available from Apache Maven Project downloads
{: .note }
To install Apache Maven, extract the content of the .zip file by running
unzip apache-maven-3.8.5-bin.zip
. Next, add the path to the bin directory of the extracted content to thePATH
environment variable. Assuming that you extracted the content directly into your home directory, you could accomplish this by running the following command from the commandline shell:export PATH=~/apache-maven-3.8.5/bin:$PATH
.
- Java 17 and the Java Development Kit (JDK) available from JDK downloads
{: .note }
To install JDK on Windows, follow the instructions provided in JDK Installation Guide. Make sure to use the
FeatureJavaHome
feature during the install to update theJAVA_HOME
environment variable.
-
Install Azure CLI version 2.60.0 or higher from Install Azure CLI
Install the CLI extensions:
az extension add --name containerapp --upgrade --allow-preview true az extension add --name serviceconnector-passwordless --upgrade
Register the namespaces:
az provider register --namespace Microsoft.App az provider register --namespace Microsoft.OperationalInsights
{: .note }
If needed, upgrade the Azure CLI version by launching Command Prompt as administrator and running
az upgrade
.
{: .note }
Following the installation of Git, ensure to set the global configuration variables
user.email
anduser.name
by running the following commands from the commandline shell (replace the<your-email-address>
and<your-full-name>
placeholders with your email address and your full name):
git config --global user.email "<your-email-address>"
git config --global user.name "<your-full-name>"
Once all these tools are installed, to get started you need to:
-
Navigate to the GitHub repository of this lab and select Fork.
{: .note }
In case you are using a GitHub EMU account, it might be you are not able to fork a public repository. In that case, create a new repository with the same name, clone the original repository, add your new repository as a remote and push to this new remote.
-
Make sure your own username is indicated as the fork
Owner
-
Select Create fork. This will create a copy or fork of this project in your own account.
-
On your lab computer, in the commandline shell, run the following commands to clone your fork of the spring-petclinic-microservices project to your workstation. Make sure to replace
<your-github-account>
in the below command:mkdir workspaces cd workspaces git clone https://github.com/<your-github-account>/java-microservices-aca-lab.git
-
When prompted to sign in to GitHub, select the Sign in with your browser option. This will automatically open a new tab in the web browser window, prompting you to provide your GitHub username and password.
-
In the browser window, enter your GitHub credentials, select Sign in, and, once successfully signed in, close the newly opened browser tab.
-
In workspaces folder double check that the spring petclinic application got cloned correctly. You can use the repository in your workspaces folder to regularly push your changes to.
-
Navigate into the java-microservices-aca-lab folder and open it with Visual Studio Code
cd java-microservices-aca-lab code .