diff --git a/docs/content/guides/author-apps/portable-resources/howto-author-portable-resources/index.md b/docs/content/guides/author-apps/portable-resources/howto-author-portable-resources/index.md index e02b6e495..ccde6dae2 100644 --- a/docs/content/guides/author-apps/portable-resources/howto-author-portable-resources/index.md +++ b/docs/content/guides/author-apps/portable-resources/howto-author-portable-resources/index.md @@ -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 %}} diff --git a/docs/content/guides/author-apps/portable-resources/howto-author-portable-resources/snippets/app-redis-manual.bicep b/docs/content/guides/author-apps/portable-resources/howto-author-portable-resources/snippets/app-redis-manual.bicep index b95bd36e3..41e61ed82 100644 --- a/docs/content/guides/author-apps/portable-resources/howto-author-portable-resources/snippets/app-redis-manual.bicep +++ b/docs/content/guides/author-apps/portable-resources/howto-author-portable-resources/snippets/app-redis-manual.bicep @@ -53,3 +53,4 @@ resource portableRedis 'Applications.Datastores/redisCaches@2023-10-01-preview' } } //MANUAL + diff --git a/docs/content/guides/author-apps/portable-resources/howto-author-portable-resources/snippets/app-redis-recipe.bicep b/docs/content/guides/author-apps/portable-resources/howto-author-portable-resources/snippets/app-redis-recipe.bicep new file mode 100644 index 000000000..e8946211f --- /dev/null +++ b/docs/content/guides/author-apps/portable-resources/howto-author-portable-resources/snippets/app-redis-recipe.bicep @@ -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 +