Skip to content

Commit

Permalink
app works now
Browse files Browse the repository at this point in the history
Signed-off-by: Will Tsai <[email protected]>
  • Loading branch information
willtsai committed Jul 18, 2023
1 parent 1dc4359 commit 67eee98
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 36 deletions.
42 changes: 7 additions & 35 deletions docs/content/getting-started/quickstarts/quickstart-dapr/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ This quickstart will teach you:
- [Radius environment]({{< ref "operations/environments/overview" >}})
- [kubectl CLI](https://kubernetes.io/docs/tasks/tools/)
- [Kubernetes cluster]({{< ref "supported-clusters" >}})
<!-- - Ensure that your cluster creation and Radius installation are configured to enable public endpoint override (e.g. instructions for [k3d here]({{< ref "supported-clusters#tabs-0-k3d" >}})) -->
- [Dapr installation into your cluster](https://docs.dapr.io/operations/hosting/kubernetes/kubernetes-deploy/)
- [Visual Studio Code](https://code.visualstudio.com/) (recommended)
- The [Radius VSCode extension]({{< ref "getting-started" >}}) is highly recommended to provide syntax highlighting, completion, and linting
Expand All @@ -34,7 +33,7 @@ Begin by creating a new file named `dapr.bicep` with a Radius application that c

{{< rad file="snippets/dapr.bicep" embed=true marker="//BACKEND" >}}

## Step 2: Deploy the backend application
## Step 2: Deploy the `backend` application

1. Deploy the application's `backend` container and Dapr state store:

Expand Down Expand Up @@ -66,37 +65,23 @@ Begin by creating a new file named `dapr.bicep` with a Radius application that c
statestore applications.link/daprstatestores
```

1. To test the Dapr state store, open a local tunnel on port 3000:

```sh
rad resource expose containers backend --application dapr --port 3000
```

1. Visit the the URL [http://localhost:3000/order](http://localhost:3000/order) in your browser. You should see the following message, which indicates that the `backend` container is able to communicate with the Dapr state store:

```json
{"message":"no orders yet"}
```

1. Press CTRL+C to terminate the port-forward

## Step 3: Define `frontend` container
## Step 3: Define the `frontend` container

Add a `frontend` [container]({{< ref container >}}) which will serve as the application's user interface.
{{< rad file="snippets/dapr.bicep" embed=true marker="//FRONTEND" >}}
## Step 4. Deploy the frontend application
## Step 4. Deploy and run the `frontend` application
1. Deploy and run the application:
1. Use Radius to deploy and run the application with a single command:
```sh
rad run dapr.bicep
```
1. Your console should now display deployment logs, which you may check to confirm the application was successfully deployed:
1. Your console should output a series deployment logs, which you may check to confirm the application was successfully deployed:
```sh
```
Deployment Complete
Resources:
Expand All @@ -108,20 +93,7 @@ Add a `frontend` [container]({{< ref container >}}) which will serve as the appl
## Step 5. Test your application
1. Run the following command in a new terminal window to get the `frontend` endpoint that was automatically provided by Radius:
```sh
rad app status -a dapr
```
```sh
APPLICATION RESOURCES
dapr 3
GATEWAY ENDPOINT
gateway <PUBLIC_ENDPOINT>
```
1. In your browser, navigate to the endpoint (e.g. [http://localhost:8081](http://localhost:8081)) to view and interact with your application:
In your browser, navigate to the endpoint (e.g. [http://localhost:8080](http://localhost:8080)) to view and interact with your application:
<img src="frontend.png" alt="Screenshot of frontend application" width=500 >
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,14 @@ resource frontend 'Applications.Core/containers@2022-03-15-privatepreview' = {
container: {
// This image is where the app's frontend code lives
image: 'radius.azurecr.io/quickstarts/dapr-frontend:edge'
env: {
// An environment variable to tell the frontend container where to find the backend
CONNECTION_BACKEND_APPID: 'backend'
}
// The frontend container exposes port 8080, which is used to serve the UI
ports: {
ui: {
containerPort: 80
containerPort: 8080
}
}
}
Expand Down

0 comments on commit 67eee98

Please sign in to comment.