Skip to content

Commit

Permalink
Add section in readme for debugging samples (#212)
Browse files Browse the repository at this point in the history
* add section to README.md to debug example.
  • Loading branch information
hui1110 authored Mar 16, 2022
1 parent 151c4a1 commit 0d03fc1
Show file tree
Hide file tree
Showing 25 changed files with 400 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,32 @@ source ./terraform/setup_env.sh
. terraform\setup_env.ps1
```

If you want to run the sample in debug mode, you can save the output value.

```shell
AZURE_SUBSCRIPTION_ID=...
AZURE_RESOURCE_GROUP=...
AZURE_CACHE_REDIS_NAME=...
```

## Run Locally

### Run the sample with Maven

In your terminal, run `mvn clean spring-boot:run`.

```shell
mvn clean spring-boot:run
```

### Run the sample in IDEs

You can debug your sample by adding the saved output values to the tool's environment variables or the sample's `application.yaml` file.

* If your tool is `IDEA`, please refer to [Debug your first Java application](https://www.jetbrains.com/help/idea/debugging-your-first-java-application.html) and [add environment variables](https://www.jetbrains.com/help/objc/add-environment-variables-and-program-arguments.html#add-environment-variables).

* If your tool is `ECLIPSE`, please refer to [Debugging the Eclipse IDE for Java Developers](https://www.eclipse.org/community/eclipse_newsletter/2017/june/article1.php) and [Eclipse Environment Variable Setup](https://examples.javacodegeeks.com/desktop-java/ide/eclipse/eclipse-environment-variable-setup-example/).

## Verify This Sample

1. Send a GET request to check, where `name` could be any string:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,40 @@ source ./terraform/setup_env.sh
. terraform\setup_env.ps1
```

If you want to run the sample in debug mode, you can save the output value.

```shell
AZURE_COSMOS_URI_1=...
AZURE_COSMOS_KEY_1=...
AZURE_COSMOS_SECONDARY_KEY_1=...
AZURE_COSMOS_DATABASE_1=...
AZURE_COSMOS_URI_2=...
AZURE_COSMOS_KEY_2=...
AZURE_COSMOS_SECONDARY_KEY_2=...
AZURE_COSMOS_DATABASE_2=...
AZURE_MYSQL_USERNAME=...
AZURE_MYSQL_PASSWORD=...
AZURE_MYSQL_HOST=...
```

## Run Locally

In your terminal, run `mvn clean spring-boot:run`.
### Run the sample with Maven

In your terminal, run `mvn clean spring-boot:run`.

```shell
mvn clean spring-boot:run
```

### Run the sample in IDEs

You can debug your sample by adding the saved output values to the tool's environment variables or the sample's `application.yaml` file.

* If your tool is `IDEA`, please refer to [Debug your first Java application](https://www.jetbrains.com/help/idea/debugging-your-first-java-application.html) and [add environment variables](https://www.jetbrains.com/help/objc/add-environment-variables-and-program-arguments.html#add-environment-variables).

* If your tool is `ECLIPSE`, please refer to [Debugging the Eclipse IDE for Java Developers](https://www.eclipse.org/community/eclipse_newsletter/2017/june/article1.php) and [Eclipse Environment Variable Setup](https://examples.javacodegeeks.com/desktop-java/ide/eclipse/eclipse-environment-variable-setup-example/).

## Verify This Sample

Verify in your app’s logs that similar messages were posted:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,13 @@ $env:AZURE_MYSQL_PASSWORD=$(terraform -chdir=terraform output -raw mysql_passwor
$env:AZURE_MYSQL_HOST=$(terraform -chdir=terraform output -raw mysql_url)

echo AZURE_COSMOS_URI_1=$env:AZURE_COSMOS_URI_1
echo AZURE_COSMOS_KEY_1=$env:AZURE_COSMOS_KEY_1
echo AZURE_COSMOS_SECONDARY_KEY_1=$env:AZURE_COSMOS_SECONDARY_KEY_1
echo AZURE_COSMOS_DATABASE_1=$env:AZURE_COSMOS_DATABASE_1
echo AZURE_COSMOS_URI_2=$env:AZURE_COSMOS_URI_2
echo AZURE_COSMOS_KEY_2=$env:AZURE_COSMOS_KEY_2
echo AZURE_COSMOS_SECONDARY_KEY_2=$env:AZURE_COSMOS_SECONDARY_KEY_2
echo AZURE_COSMOS_DATABASE_2=$env:AZURE_COSMOS_DATABASE_2
echo AZURE_MYSQL_USERNAME=$env:AZURE_MYSQL_USERNAME
echo AZURE_MYSQL_PASSWORD=$env:AZURE_MYSQL_PASSWORD
echo AZURE_MYSQL_HOST=$env:AZURE_MYSQL_HOST
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,13 @@ export AZURE_MYSQL_PASSWORD=$(terraform -chdir=./terraform output -raw mysql_pas
export AZURE_MYSQL_HOST=$(terraform -chdir=./terraform output -raw mysql_url)

echo AZURE_COSMOS_URI_1=$AZURE_COSMOS_URI_1
echo AZURE_COSMOS_KEY_1=$AZURE_COSMOS_KEY_1
echo AZURE_COSMOS_SECONDARY_KEY_1=$AZURE_COSMOS_SECONDARY_KEY_1
echo AZURE_COSMOS_DATABASE_1=$AZURE_COSMOS_DATABASE_1
echo AZURE_COSMOS_URI_2=$AZURE_COSMOS_URI_2
echo AZURE_COSMOS_KEY_2=$AZURE_COSMOS_KEY_2
echo AZURE_COSMOS_SECONDARY_KEY_2=$AZURE_COSMOS_SECONDARY_KEY_2
echo AZURE_COSMOS_DATABASE_2=$AZURE_COSMOS_DATABASE_2
echo AZURE_MYSQL_USERNAME=$AZURE_MYSQL_USERNAME
echo AZURE_MYSQL_PASSWORD=$AZURE_MYSQL_PASSWORD
echo AZURE_MYSQL_HOST=$AZURE_MYSQL_HOST
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,33 @@ source ./terraform/setup_env.sh
. terraform\setup_env.ps1
```

If you want to run the sample in debug mode, you can save the output value.

```shell
AZURE_COSMOS_URI=...
AZURE_COSMOS_KEY=...
AZURE_COSMOS_SECONDARY_KEY=...
AZURE_COSMOS_DATABASE=...
```

## Run Locally

In your terminal, run `mvn clean spring-boot:run`.
### Run the sample with Maven

In your terminal, run `mvn clean spring-boot:run`.

```shell
mvn clean spring-boot:run
```

### Run the sample in IDEs

You can debug your sample by adding the saved output values to the tool's environment variables or the sample's `application.yaml` file.

* If your tool is `IDEA`, please refer to [Debug your first Java application](https://www.jetbrains.com/help/idea/debugging-your-first-java-application.html) and [add environment variables](https://www.jetbrains.com/help/objc/add-environment-variables-and-program-arguments.html#add-environment-variables).

* If your tool is `ECLIPSE`, please refer to [Debugging the Eclipse IDE for Java Developers](https://www.eclipse.org/community/eclipse_newsletter/2017/june/article1.php) and [Eclipse Environment Variable Setup](https://examples.javacodegeeks.com/desktop-java/ide/eclipse/eclipse-environment-variable-setup-example/).

## Verify This Sample

Verify in your app’s logs that similar messages were posted:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ $env:AZURE_COSMOS_SECONDARY_KEY=$(terraform -chdir=terraform output -raw azure_c
$env:AZURE_COSMOS_DATABASE=$(terraform -chdir=terraform output -raw cosmos_database_name)

echo AZURE_COSMOS_URI=$env:AZURE_COSMOS_URI
echo AZURE_COSMOS_KEY=$env:AZURE_COSMOS_KEY
echo AZURE_COSMOS_SECONDARY_KEY=$env:AZURE_COSMOS_SECONDARY_KEY
echo AZURE_COSMOS_DATABASE=$env:AZURE_COSMOS_DATABASE
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ export AZURE_COSMOS_SECONDARY_KEY=$(terraform -chdir=./terraform output -raw azu
export AZURE_COSMOS_DATABASE=$(terraform -chdir=./terraform output -raw cosmos_database_name)

echo AZURE_COSMOS_URI=$AZURE_COSMOS_URI
echo AZURE_COSMOS_KEY=$AZURE_COSMOS_KEY
echo AZURE_COSMOS_SECONDARY_KEY=$AZURE_COSMOS_SECONDARY_KEY
echo AZURE_COSMOS_DATABASE=$AZURE_COSMOS_DATABASE

Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,30 @@ source ./terraform/setup_env.sh
. terraform\setup_env.ps1
```

If you want to run the sample in debug mode, you can save the output value.

```shell
AZURE_COSMOS_ENDPOINT=...
```

## Run Locally

In your terminal, run `mvn clean spring-boot:run`.
### Run the sample with Maven

In your terminal, run `mvn clean spring-boot:run`.

```shell
mvn clean spring-boot:run
```

### Run the sample in IDEs

You can debug your sample by adding the saved output values to the tool's environment variables or the sample's `application.yaml` file.

* If your tool is `IDEA`, please refer to [Debug your first Java application](https://www.jetbrains.com/help/idea/debugging-your-first-java-application.html) and [add environment variables](https://www.jetbrains.com/help/objc/add-environment-variables-and-program-arguments.html#add-environment-variables).

* If your tool is `ECLIPSE`, please refer to [Debugging the Eclipse IDE for Java Developers](https://www.eclipse.org/community/eclipse_newsletter/2017/june/article1.php) and [Eclipse Environment Variable Setup](https://examples.javacodegeeks.com/desktop-java/ide/eclipse/eclipse-environment-variable-setup-example/).

## Verify This Sample
Verify in your app’s logs that similar messages were posted:
```shell
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,31 @@ source ./terraform/setup_env.sh
. terraform\setup_env.ps1
```

If you want to run the sample in debug mode, you can save the output value.

```shell
AZURE_COSMOS_ENDPOINT=...
COSMOS_DATABASE=...
```

## Run Locally

In your terminal, run `mvn clean spring-boot:run`.
### Run the sample with Maven

In your terminal, run `mvn clean spring-boot:run`.

```shell
mvn clean spring-boot:run
```

### Run the sample in IDEs

You can debug your sample by adding the saved output values to the tool's environment variables or the sample's `application.yaml` file.

* If your tool is `IDEA`, please refer to [Debug your first Java application](https://www.jetbrains.com/help/idea/debugging-your-first-java-application.html) and [add environment variables](https://www.jetbrains.com/help/objc/add-environment-variables-and-program-arguments.html#add-environment-variables).

* If your tool is `ECLIPSE`, please refer to [Debugging the Eclipse IDE for Java Developers](https://www.eclipse.org/community/eclipse_newsletter/2017/june/article1.php) and [Eclipse Environment Variable Setup](https://examples.javacodegeeks.com/desktop-java/ide/eclipse/eclipse-environment-variable-setup-example/).

## Verify This Sample

Verify in your app’s logs that similar messages were posted:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,32 @@ source ./terraform/setup_env.sh
. terraform\setup_env.ps1
```

If you want to run the sample in debug mode, you can save the output value.

```shell
AZURE_EVENTHUBS_NAMESPACE=...
AZURE_STORAGE_CONTAINER_NAME=...
AZURE_STORAGE_ACCOUNT_NAME=...
```

## Run Locally

In your terminal, run `mvn clean spring-boot:run`.
### Run the sample with Maven

In your terminal, run `mvn clean spring-boot:run`.

```shell
mvn clean spring-boot:run
```

### Run the sample in IDEs

You can debug your sample by adding the saved output values to the tool's environment variables or the sample's `application.yaml` file.

* If your tool is `IDEA`, please refer to [Debug your first Java application](https://www.jetbrains.com/help/idea/debugging-your-first-java-application.html) and [add environment variables](https://www.jetbrains.com/help/objc/add-environment-variables-and-program-arguments.html#add-environment-variables).

* If your tool is `ECLIPSE`, please refer to [Debugging the Eclipse IDE for Java Developers](https://www.eclipse.org/community/eclipse_newsletter/2017/june/article1.php) and [Eclipse Environment Variable Setup](https://examples.javacodegeeks.com/desktop-java/ide/eclipse/eclipse-environment-variable-setup-example/).

## Verify This Sample

1. Send a POST request
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,34 @@ source ./terraform/setup_env.sh
. terraform\setup_env.ps1
```

If you want to run the sample in debug mode, you can save the output value.

```shell
AZURE_EVENTHUBS_CONNECTION_STRING=...
EVENTHUBS_KAFKA=...
AZURE_EVENTHUBS_SUBSCRIPTION_ID=...
AZURE_EVENTHUBS_RESOURCE_GROUP=...
AZURE_EVENTHUBS_NAMESPACE=...
```

## Run Locally

In your terminal, run `mvn clean spring-boot:run`.
### Run the sample with Maven

In your terminal, run `mvn clean spring-boot:run`.

```shell
mvn clean spring-boot:run
```

### Run the sample in IDEs

You can debug your sample by adding the saved output values to the tool's environment variables or the sample's `application.yaml` file.

* If your tool is `IDEA`, please refer to [Debug your first Java application](https://www.jetbrains.com/help/idea/debugging-your-first-java-application.html) and [add environment variables](https://www.jetbrains.com/help/objc/add-environment-variables-and-program-arguments.html#add-environment-variables).

* If your tool is `ECLIPSE`, please refer to [Debugging the Eclipse IDE for Java Developers](https://www.eclipse.org/community/eclipse_newsletter/2017/june/article1.php) and [Eclipse Environment Variable Setup](https://examples.javacodegeeks.com/desktop-java/ide/eclipse/eclipse-environment-variable-setup-example/).

## Verify This Sample


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,34 @@ source ./terraform/setup_env.sh
. terraform\setup_env.ps1
```

If you want to run the sample in debug mode, you can save the output value.

```shell
AZURE_EVENTHUBS_NAMESPACE=...
AZURE_STORAGE_CONTAINER_NAME=...
AZURE_STORAGE_ACCOUNT_NAME=...
AZURE_EVENTHUB_NAME=...
AZURE_EVENTHUB_CONSUMER_GROUP=...
```

## Run Locally

In your terminal, run `mvn clean spring-boot:run`.
### Run the sample with Maven

In your terminal, run `mvn clean spring-boot:run`.

```shell
mvn clean spring-boot:run
```

### Run the sample in IDEs

You can debug your sample by adding the saved output values to the tool's environment variables or the sample's `application.yaml` file.

* If your tool is `IDEA`, please refer to [Debug your first Java application](https://www.jetbrains.com/help/idea/debugging-your-first-java-application.html) and [add environment variables](https://www.jetbrains.com/help/objc/add-environment-variables-and-program-arguments.html#add-environment-variables).

* If your tool is `ECLIPSE`, please refer to [Debugging the Eclipse IDE for Java Developers](https://www.eclipse.org/community/eclipse_newsletter/2017/june/article1.php) and [Eclipse Environment Variable Setup](https://examples.javacodegeeks.com/desktop-java/ide/eclipse/eclipse-environment-variable-setup-example/).

## Verify This Sample

1. Verify in your app’s logs that similar messages were posted:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,37 @@ source ./terraform/setup_env.sh
. terraform\setup_env.ps1
```

If you want to run the sample in debug mode, you can save the output value.

```shell
AZURE_STORAGE_CONTAINER_NAME=...
AZURE_STORAGE_ACCOUNT_NAME=...
EVENTHUB_NAMESPACE_01=...
AZURE_EVENTHUB_NAME_01=...
AZURE_EVENTHUB_CONSUMER_GROUP_01=...
EVENTHUB_NAMESPACE_02=...
AZURE_EVENTHUB_NAME_02=...
AZURE_EVENTHUB_CONSUMER_GROUP_02=...
```

## Run Locally

In your terminal, run `mvn clean spring-boot:run`.
### Run the sample with Maven

In your terminal, run `mvn clean spring-boot:run`.

```shell
mvn clean spring-boot:run
```

### Run the sample in IDEs

You can debug your sample by adding the saved output values to the tool's environment variables or the sample's `application.yaml` file.

* If your tool is `IDEA`, please refer to [Debug your first Java application](https://www.jetbrains.com/help/idea/debugging-your-first-java-application.html) and [add environment variables](https://www.jetbrains.com/help/objc/add-environment-variables-and-program-arguments.html#add-environment-variables).

* If your tool is `ECLIPSE`, please refer to [Debugging the Eclipse IDE for Java Developers](https://www.eclipse.org/community/eclipse_newsletter/2017/june/article1.php) and [Eclipse Environment Variable Setup](https://examples.javacodegeeks.com/desktop-java/ide/eclipse/eclipse-environment-variable-setup-example/).

## Verify This Sample

1. Verify in your app’s logs that similar messages were posted:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,31 @@ source ./terraform/setup_env.sh
. terraform\setup_env.ps1
```

If you want to run the sample in debug mode, you can save the output value.

```shell
ENDPOINT_1=...
ENDPOINT_2=...
```

## Run Locally

### Run the sample with Maven

In your terminal, run `mvn clean spring-boot:run`.

```shell
mvn clean spring-boot:run
```

### Run the sample in IDEs

You can debug your sample by adding the saved output values to the tool's environment variables or the sample's `application.yaml` file.

* If your tool is `IDEA`, please refer to [Debug your first Java application](https://www.jetbrains.com/help/idea/debugging-your-first-java-application.html) and [add environment variables](https://www.jetbrains.com/help/objc/add-environment-variables-and-program-arguments.html#add-environment-variables).

* If your tool is `ECLIPSE`, please refer to [Debugging the Eclipse IDE for Java Developers](https://www.eclipse.org/community/eclipse_newsletter/2017/june/article1.php) and [Eclipse Environment Variable Setup](https://examples.javacodegeeks.com/desktop-java/ide/eclipse/eclipse-environment-variable-setup-example/).

## Verify This Sample

Start the application, you will see logs like this:
Expand Down
Loading

0 comments on commit 0d03fc1

Please sign in to comment.