Skip to content

Commit

Permalink
Added a Recipe snippet section.
Browse files Browse the repository at this point in the history
Signed-off-by: jasonviviano <[email protected]>
  • Loading branch information
jasonviviano committed Nov 6, 2023
1 parent b394b43 commit f8784a4
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,15 @@ Portable resources provide **abstraction** and **portability** to Radius Applica

{{% codetab %}}

Recipes enable a separation of concerns between infrastructure operators and developers by automating infrastructure deployment. To learn more visit the [Recipes overview]({{< ref "/guides/recipes/overview" >}})
Recipes enable a separation of concerns between infrastructure operators and developers by automating infrastructure deployment. To learn more visit the [Recipes overview]({{< ref "/guides/recipes/overview" >}}). You can run a default recipe registered in your environment or select the specific Recipe you want to run.

#### Default Recipe

{{< rad file="snippets/app-redis-recipe.bicep" embed=true marker="//Recipe" >}}

#### Specifying a Recipe by name

{{< rad file="snippets/app-redis-manual.bicep" embed=true marker="//RecipeSpecified" >}}

{{% /codetab %}}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,4 @@ resource portableRedis 'Applications.Datastores/redisCaches@2023-10-01-preview'
}
}
//MANUAL

Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import radius as radius

@description('Specifies the environment for resources.')
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'
properties: {
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: {
source: recipeRedis.id
}
}
}
}
//CONTAINER

//Recipe
resource recipeRedis 'Applications.Datastores/redisCaches@2023-10-01-preview'= {
name: 'myresource'
properties: {
environment: environment
application: application
}
}
//Recipe

//RecipeSpecified
resource redis 'Applications.Datastores/redisCaches@2023-10-01-preview'= {
name: 'myresource'
properties: {
environment: environment
application: application
recipe: {
name: 'azure-prod'
}
}
}
//RecipeSpecified

0 comments on commit f8784a4

Please sign in to comment.