Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Prerequisites

You have the choice between running the workshop on your local machine, in GitHub Codespaces or in a Development Containers.

Open in GitHub Codespaces Open in Remote - Dev Containers

Store shell and environment variables in a file

There are 2 scripts in /scripts folder to store the shell and environment variables in a file: one for Linux/Unix shell and one for Powershell. To know how to use them, please refer to the Store Variables section below. It is important to store the variables in a file to be sure to keep them if you close your terminal window or if you restart your machine.

Local machine

Make sure you have the following prerequisites installed on your machine:

  • Git
  • Azure CLI
  • A code editor or IDE like:
  • Download Docker Desktop or Rancher Desktop
  • Install the Dapr CLI and initialize Dapr locally
  • OpenJDK 17
  • Apache Maven 3.8.x+ (Optional if Maven Wrapper is used)
    • Make sure that Maven uses the correct Java version by running mvn -version.

    Using Maven Wrapper

    Maven wrappers are provided for each maven module (i.e. each microservice) and for the whole project. You can use them instead of installing Maven. To do so, you need to replace mvn by ./mvnw for Linux/Unix shell and by .\mvnw for Powershell.

    When using Dapr CLI, you need to replace mvn at the end of the command by ./mvnw for Linux/Unix shell and by .\mvnw for Powershell.

    To be sure you use the correct Java version, execute the following command at the root of the project: ./mvnw -version for Linux/Unix shell and .\mvnw -version for Powershell.

  • Clone the source code repository:

      git clone https://github.com/Azure/java-aks-aca-dapr-workshop.git
    

From now on, this folder is referred to as the ‘source code’ folder.

Powershell

If you are using Powershell, you need to replace in multiline commands \ by ` at then end of each line.

Store Variables

There are 2 scripts in /scripts folder to store the shell and environment variables in a file:

  • export-variables.sh for Linux/Unix shell
  • export-variables.ps1 for Powershell

Linux/Unix shell

Store variables in a file

  1. Open a terminal window.

  2. Go to the root of the project.

  3. Execute the following command:

     source ./scripts/export-variables.sh
    

    This command will store the shell variables in a file named set-vars.sh.

Set the variables

To set the variables, you need to execute the following command at the root of the project:

source ./set-vars.sh

Powershell

Store variables in a file

  1. Open Powershell.

  2. Go to the root of the project.

  3. Execute the following command:

     .\scripts\export-variables.ps1
    

    This command will store the environment variables in a file named set-vars.ps1.

Set the variables

To set the variables, you need to execute the following command at the root of the project:

.\set-vars.ps1

< Dapr Overview Assignment 1 - Run without Dapr >