Overview: Radius Recipes

Learn how to automate infrastructure deployment for your resources with Radius Recipes

Recipes enable a separation of concerns between IT operators and developers by automating infrastructure deployment. Developers select the resource they want in their app (Mongo Database, Redis Cache, Dapr State Store, etc.), and IT operators codify in their environment how these resources should be deployed and configured (lightweight containers, Azure resources, AWS resources, etc.). When a developer deploys their application and its resources, Recipes automatically deploy the backing infrastructure and bind it to the developer’s resources.

Capabilities

Support for multiple IaC languages

Language Supported sources Notes
Bicep OCI registries Supports Azure, AWS, and Kubernetes
Terraform Public module sources
Private modules not yet configurable
Supports Azure, AWS, and Kubernetes providers
Other providers not yet configurable

Select the Recipe that meets your needs

Recipes can be used in any environment, from dev to prod. You can run a default recipe registered in your environment or select the specific Recipe you want to run. To run a default recipe, simply add the resource you want to your app and omit the Recipe name:

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

If you want to use a specific Recipe, you can specify the Recipe name in the recipe parameter:

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

Use rad recipe list to view the Recipes available to you in your environment.

Use lightweight “local-dev” Recipes

Radius Environments make it easy to get up and running with Recipes instantly. When you run rad init you get a set of containerized local-dev Recipes pre-registered in your environment. These Recipes are designed to help you get started quickly with Recipes using lightweight containers. You can use these Recipes to test your app locally, or deploy them to a dev environment.

Customize with parameters

Recipes can be customized with parameters, allowing developers to fine-tune infrastructure to meet their specific needs:

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

You can use rad recipe show to view the parameters available to you in a Recipe.

Author custom Recipes

It’s easy to author and register your own Recipes which define how to deploy and configure infrastructure that meets your organization’s needs. See the custom Recipes guide for more information.

Supported resources

Recipes currently support the following resources. Support for additional resources is actively being worked on.

Supported resources
Applications.Datastores/redisCaches
Applications.Datastores/mongoDatabases
Applications.Datastores/sqlDatabases
Applications.Messaging/rabbitmqQueues
Applications.Dapr/stateStores
Applications.Dapr/pubSubBrokers
Applications.Dapr/secretStores
Applications.Core/extenders

Infrastructure linking

When you use a Recipe to deploy infrastructure (e.g. Azure, AWS resources), that infrastructure can be linked and tracked as part of the Recipe-enabled resource. This means you can inspect what infrastructure supports the resource. Use rad resource show -o json to view this information.

Infrastructure lifecycle

The lifecycle of Recipe infrastructure is tied to the resource calling the Recipe. When a Recipe-supported resource is deployed it triggers the Recipe, which in turn deploys the underlying infrastructure. When the Recipe-supported resource is deleted the underlying infrastructure is deleted as well.

Further Reading