Skip to content

Commit

Permalink
Added the steps to deploy the app with the sidecar to the docs based …
Browse files Browse the repository at this point in the history
…on the tutorial guide.

Signed-off-by: jasonviviano <[email protected]>
  • Loading branch information
jasonviviano committed Nov 27, 2023
1 parent bdaf620 commit 0e4e903
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 45 deletions.
27 changes: 22 additions & 5 deletions docs/content/guides/author-apps/dapr/how-to-dapr-sidecar/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ This how-to guide will provide an overview of how to:

## Step 1: Define a container

Begin by creating a file named `app.bicep` with a Radius [container]({{< ref "guides/author-apps/containers" >}}):

{{< rad file="snippets/app.bicep" embed=true >}}
Begin by creating a file named `app.bicep` with a Radius [container]({{< ref "guides/author-apps/containers" >}})

## Step 2: Define the Dapr sidecar extension

Expand All @@ -42,18 +40,37 @@ You'll need the following information `appId`, `appPort` and any additional `con
1. Deploy and run your app:

```bash
rad run ./app.bicep -a demo
rad deploy ./app.bicep -a demo
```

Your console output should look similar to:

```
Building ./app.bicep...
Deploying template './app.bicep' for application 'demo' and environment 'default' from workspace 'default'...
Deployment In Progress...
... backend Applications.Core/containers
Deployment Complete
Resources:
backend Applications.Core/containers
```

You've now deployed a Radius container with an extension connection to a Dapr sidecar!

## Cleanup

Run the following command to [delete]({{< ref "guides/deploy-apps/howto-delete" >}}) your app and container:

```bash
rad app delete demo
rad app delete -a demo
```

## Further reading

- [Radius Dapr tutorial]({{< ref "tutorials/tutorial-dapr" >}})
- [Dapr in Radius containers]({{< ref "guides/author-apps/containers/overview#kubernetes" >}})
- [Dapr sidecar schema]({{< ref "reference/resource-schema/dapr-schema/extension/" >}})
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
import radius as radius

@description('Specifies the environment for resources.')
param environment string
@description('The ID of your Radius Application. Automatically injected by the rad CLI.')
param application string

resource app 'Applications.Core/applications@2023-10-01-preview' = {
name: 'demo'
// The backend container that runs the Dapr sidecar
resource backend 'Applications.Core/containers@2023-10-01-preview' = {
name: 'backend'
properties: {
environment: environment
}
}

resource demo 'Applications.Core/containers@2023-10-01-preview' = {
name: 'demo'
properties: {
application: app.id
container: {...}
application: application
container: {
// This image is where the app's backend code lives
image: 'ghcr.io/radius-project/samples/dapr-backend:latest'
ports: {
orders: {
containerPort: 3000
}
}
}
extensions: [
{
kind: 'daprSidecar'
appId: 'demo'
appId: 'backend'
appPort: 3000
}
]
Expand Down

This file was deleted.

0 comments on commit 0e4e903

Please sign in to comment.