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
      }
    }
    providers: {
      azure: {
        scope: '/subscriptions/mySubscriptionId/resourceGroups/my-resource-group'
      }
    }
    extensions: [
      {
        kind: 'kubernetesMetadata'
        labels: {
          'team.contact.name': 'frontend'
        }
      }
    ]
  }
}

Top-level

KeyRequiredDescriptionExample
nameyThe name of your resource. See common values for more information.frontend
locationyThe location of your resource. See common values for more information.global
propertiesyProperties of the resource.See below

properties

KeyRequiredDescriptionExample
computeyContainer runtime configuration.See below
recipeConfignConfiguration for Recipes. Defines how each type of Recipe should be configured and run.See below
recipesnRecipes registered to the environment.See below
simulatednWhen 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
extensionsnThe environment extension.See below
providersnThe cloud provider configuration, either azure or aws.See below

compute

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

KeyRequiredDescriptionExample
kindyThe kind of container runtime to use, with 'kubernetes' and 'aci' currently supported.'kubernetes'
namespacenThe Kubernetes namespace to render application resources into, only required for Kubernetes environments.'default'
resourceIdnThe resource ID of the AKS cluster to render application resources into, only required for Azure environments.aksCluster.id
resourceGroupnThe resource group to render application resources into, only required for ACI environments.'/subscriptions/mySubscriptionId/resourceGroups/my-resource-group'
identitynThe cluster identity configuration.See below

identity

KeyRequiredDescriptionExample
kindyThe kind of identity, 'azure.com.workload', 'userAssigned', 'systemAssigned', and 'systemAssignedUserAssigned' are currently supported; if not provided and compute.kind is set to 'aci' then defaults to 'systemAssigned''systemAssigned'
oidcIssuernThe OIDC issuer URL for your Kubernetes cluster'{IssuerURL}/.well-known/openid-configuration'
managedIdentitynThe list of assigned managed identities, this is only required if the kind is set to 'userAssigned' or 'systemAssignedUserAssigned'['/subscriptions/mySubscriptionId/resourceGroups/my-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myManagedIdentity']

recipeConfig

KeyRequiredDescriptionExample
terraformyConfiguration for Terraform Recipes. Controls how Terraform plans and applies templates as part of Recipe deployment.See below
envnEnvironment variables injected during Terraform Recipe execution for the recipes in the environment.See below

terraform properties

KeyRequiredDescriptionExample
authenticationyAuthentication information used to access private Terraform module sources. Supported module sources: Git.See below
providersnConfiguration 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
KeyRequiredDescriptionExample
patyPersonal Access Token (PAT) configuration used to authenticate to Git platforms.See below
pat properties
KeyRequiredDescriptionExample
secretyThe 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

KeyRequiredDescriptionExample
<user-defined key-value pairs>nUser-defined environment variables.'env_var_1': 'env_value_1'

recipes

KeyRequiredDescriptionExample
<resource-type>yThe type of resource to register Recipes for.'Applications.Datastores/redisCaches'
recipesyThe list of Recipes registered to a given resource typeSee below

recipe properties

KeyRequiredDescriptionExample
<recipe-name>yThe name of the Recipe. Must be unique within the resource-type.myrecipe
templateKindyFormat of the template provided by the recipe. Allowed values: bicep'bicep'
templatePathyThe path to the Recipe contents. For Bicep Recipes this is a Bicep module registry address.'ghcr.io/USERNAME/recipes/myrecipe:1.0'
parametersnA 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
KeyRequiredDescriptionExample
kindyThe kind of extension being used. Must be ‘kubernetesMetadata’kubernetesMetadata
labelsnThe Kubernetes labels to be set on the application and its resourcesSee below
annotationsnThe Kubernetes annotations to set on your application and its resourcesSee below
labels
KeyRequiredDescriptionExample
user defined label keyyThe key and value of the label to be set on the application and its resources.'team.name': 'frontend'
annotations
KeyRequiredDescriptionExample
user defined annotation keyyThe key and value of the annotation to be set on the application and its resources.'app.io/port': '8081'

providers

KeyRequiredDescriptionExample
scopenThe target level for deploying the cloud resources.'/subscriptions/mySubscriptionId/resourceGroups/my-resource-group'

Further reading