Skip to content

Commit

Permalink
Applied suggestions from code review
Browse files Browse the repository at this point in the history
Signed-off-by: jasonviviano <[email protected]>
  • Loading branch information
jasonviviano committed Nov 29, 2023
1 parent 69ede39 commit 36ba281
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,13 @@ Refer to the [Redis resource schema]({{< ref "reference/resource-schema/cache/re

In your Bicep file `app.bicep`, add a container resource that will be leveraged by your portable resource later:

{{< rad file="snippets/app.bicep" embed=true marker="//EMPTYCONTAINER" >}}
{{< rad file="snippets/app.bicep" embed=true >}}

## Step 3: Access your portable resources

You can access the portable resource via [`connections`]({{< ref "guides/author-apps/containers#connections" >}}). Update your container definition to add a connection to the new Redis cache. This results in environment variables for connection information automatically set on the container.


{{< rad file="snippets/app-redis-manual.bicep" embed=true marker="//CONTAINER" markdownConfig="{linenos=table,hl_lines=[\"19-22\"]}">}}
{{< rad file="snippets/app-redis-manual.bicep" embed=true >}}

## Step 4: Deploy your app

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ param environment string
@description('Specifies the application for resources.')
param application string

@description('Specifies the namespace for resources.')
param namespace string

//CONTAINER
resource container 'Applications.Core/containers@2023-10-01-preview' = {
name: 'demo'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,22 @@ resource container 'Applications.Core/containers@2023-10-01-preview' = {
application: application
container: {
image: 'ghcr.io/radius-project/samples/demo:latest'
ports: {
web: {
containerPort: 3000
}
}
livenessProbe: {
kind: 'httpGet'
containerPort: 3000
path: '/healthz'
initialDelaySeconds: 10
}
}
connections: {
redis: {
//...
}
}
}
}
Expand Down

0 comments on commit 36ba281

Please sign in to comment.