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

Radius Recipes are designed to be pluggable across Infrastructure as Code (IaC) languages and currently supports Bicep and Terraform, with more to come in the future. This allows you to use the IaC language that best fits your needs and environment:

Language Supported sources Notes
Bicep OCI registries Supports Azure, AWS, and Kubernetes
Terraform Public and private module sources Supports Azure, AWS, Kubernetes, and any other Terraform provider

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 support all of the available portable resources listed here.

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