Environment

Learn how to define an environment

Resource format

resource environment 'Applications.Core/environments@2023-10-01-preview' = {
  name: 'myenv'
  properties: {
    compute: {
      kind: 'kubernetes'   // Required. The kind of container runtime to use
      namespace: 'default' // Required. The Kubernetes namespace in which to render application resources
      identity: {          // Optional. External identity providers to use for connections
        kind: 'azure.com.workload'
        oidcIssuer: oidcIssuer
      }
    }
    extensions: [
      {
        kind: 'kubernetesMetadata'
        labels: {
          'team.contact.name': 'frontend'
        }
      }
    ]
  }
}

Top-level

Key Required Description Example
name y The name of your resource. See common values for more information. frontend
location y The location of your resource. See common values for more information. global
properties y Properties of the resource. See below

properties

Key Required Description Example
compute y Container runtime configuration. See below
recipeConfig n Configuration for Recipes. Defines how each type of Recipe should be configured and run. See below
recipes n Recipes registered to the environment See below
simulated n When enabled, a simulated environment will not deploy any output resources or run any Recipes when an application is deployed. This is useful for dry runs or testing. Defaults to false. true
extensions n The environment extension. See below

compute

Details on what to run and how to run it are defined in the container property:

Key Required Description Example
kind y The kind of container runtime to use. Only option is 'kubernetes' 'kubernetes'
namespace y The Kubernetes namespace to render application resources into 'default'
resourceId n The resource ID of the AKS cluster to render application resources into. Only required for Azure environments aksCluster.id
identity n The cluster identity configuration See below

identity

Key Required Description Example
kind y The kind of identity. ‘azure.com.workload’ is currently only supported. 'azure.com.workload'
oidcIssuer n The OIDC issuer URL for your Kubernetes cluster. '{IssuerURL}/.well-known/openid-configuration'

recipeConfig

Key Required Description Example
terraform y Configuration for Terraform Recipes. Controls how Terraform plans and applies templates as part of Recipe deployment. See below
env n Environment variables injected during Terraform Recipe execution for the recipes in the environment. See below

terraform properties

Key Required Description Example
authentication y Authentication information used to access private Terraform module sources. Supported module sources: Git. See below
providers n Configuration for Terraform Recipe Providers. Controls how Terraform interacts with cloud providers, SaaS providers, and other APIs. For more information refer to the Terraform documentation.
authentication properties
Key Required Description Example
pat y Personal Access Token (PAT) configuration used to authenticate to Git platforms. See below
pat properties
Key Required Description Example
secret y The ID of an Applications.Core/SecretStore resource containing the Git platform personal access token (PAT). The secret store must have a secret named ‘pat’, containing the PAT value. A secret named ‘username’ is optional, containing the username associated with the pat. By default no username is specified. For more information refer to the Terraform documentation.

env properties

Key Required Description Example
<user-defined key-value pairs> n User-defined environment variables. 'env_var_1': 'env_value_1'

recipes

Key Required Description Example
<resource-type> y The type of resource to register Recipes for. 'Applications.Datastores/redisCaches'
recipes y The list of Recipes registered to a given resource type See below

recipe properties

Key Required Description Example
<recipe-name> y The name of the Recipe. Must be unique within the resource-type. myrecipe
templateKind y Format of the template provided by the recipe. Allowed values: bicep 'bicep'
templatePath y The path to the Recipe contents. For Bicep Recipes this is a Bicep module registry address. 'ghcr.io/USERNAME/recipes/myrecipe:1.0'
parameters n A list of parameters to set on the Recipe for every Recipe usage and deployment. Can be overridden by the resource calling the Recipe. capacity: 1

extensions

Extensions allow you to customize how resources are generated or customized as part of deployment.

kubernetesMetadata

The Kubernetes Metadata extension enables you set and cascade Kubernetes metadata such as labels and Annotations on all the Kubernetes resources defined with in your Radius Application. For examples, please refer to the extension overview page.

Properties
Key Required Description Example
kind y The kind of extension being used. Must be ‘kubernetesMetadata’ kubernetesMetadata
labels n The Kubernetes labels to be set on the application and its resources See below
annotations n The Kubernetes annotations to set on your application and its resources See below
labels
Key Required Description Example
user defined label key y The key and value of the label to be set on the application and its resources. 'team.name': 'frontend'
annotations
Key Required Description Example
user defined annotation key y The key and value of the annotation to be set on the application and its resources. 'app.io/port': '8081'

Further reading