This guide explains how to test Resource Types and Recipes locally using the standardized make commands provided in this repository.
Before testing, ensure you have:
- Docker installed (for running k3d)
k3dinstalledkubectlinstalledhelminstalledorasinstalledmakeavailable in your environment
Create a local Kubernetes cluster with Radius (and Dapr) installed:
# Install Radius CLI (optional: specify version with RAD_VERSION=0.48.0)
make install-radius-cli
# Create k3d cluster with Radius and Dapr configured
make create-radius-clusterThe
make create-radius-clustertarget provisions Dapr in the cluster so recipes that depend on the Dapr sidecar work out of the box.
Build and validate a Resource Type definition:
make build-resource-type TYPE_FOLDER=Data/mySqlDatabasesThis command:
- Creates the Resource Type in Radius using
rad resource-type create - Generates a Bicep extension file (
.tgz) - Updates
bicepconfig.jsonto reference the extension - Enables IntelliSense and validation in your Bicep files
make build-bicep-recipe RECIPE_PATH=Data/mySqlDatabases/recipes/kubernetes/bicepThis publishes the Bicep recipe to a local OCI registry.
make build-terraform-recipe RECIPE_PATH=Security/secrets/recipes/kubernetes/terraformThis packages the Terraform module and publishes it to an in-cluster HTTP server.
Test a recipe by registering it and deploying a test application:
# Test a Bicep recipe
make test-recipe RECIPE_PATH=Data/mySqlDatabases/recipes/kubernetes/bicep
# Test a Terraform recipe
make test-recipe RECIPE_PATH=Security/secrets/recipes/kubernetes/terraformThe test-recipe command:
- Auto-detects whether the recipe is Bicep or Terraform
- Registers the recipe as the default for its resource type
- Deploys the
test/app.bicepfile (if it exists) - Cleans up resources after testing
Run tests for all recipes in the repository:
make testThis discovers and tests every recipe automatically.
To run only Bicep or Terraform recipes, set the RECIPE_TYPE variable. You can also override the environment name with ENVIRONMENT if you created an isolated Radius environment for testing:
# Test only Bicep recipes
make test RECIPE_TYPE=bicep
# Test Terraform recipes in a custom environment
make test RECIPE_TYPE=terraform ENVIRONMENT=my-terraform-envBuild all resource types and recipes at once:
make buildList available resource types:
make list-resource-typesList all recipes (Bicep and Terraform):
make list-recipesFor recipes to be tested via make test-recipe or make test, create a test/app.bicep file in your Resource Type directory:
Data/mySqlDatabases/
├── mySqlDatabases.yaml
├── README.md
├── recipes/
│ └── kubernetes/
│ ├── bicep/
│ │ └── kubernetes-mysql.bicep
│ └── terraform/
│ └── main.tf
└── test/
└── app.bicep # Test application
Example test/app.bicep:
extension radius
extension mySqlDatabases
param environment string
resource app 'Applications.Core/applications@2023-10-01-preview' = {
name: 'testapp'
properties: {
environment: environment
}
}
resource mysql 'Radius.Data/mySqlDatabases@2025-08-01-preview' = {
name: 'mysql'
properties: {
environment: environment
application: app.id
}
}Delete your test cluster when done:
make delete-radius-clusterIf you prefer manual testing or need to test externally-published recipes:
Bicep Recipe:
rad recipe register default \
--environment default \
--resource-type "Radius.Data/mySqlDatabases" \
--template-kind bicep \
--template-path "reciperegistry:5000/recipes/mysql/kubernetes:latest" \
--plain-httpTerraform Recipe:
rad recipe register default \
--environment default \
--resource-type "Radius.Security/secrets" \
--template-kind terraform \
--template-path "http://tf-module-server.radius-test-tf-module-server.svc.cluster.local/secrets-kubernetes.zip"rad deploy test/app.bicep -p environment=defaultrad app delete testapp --yes
rad recipe unregister default --resource-type "Radius.Data/mySqlDatabases"# 1. Create directory structure
mkdir -p Data/newResource/recipes/kubernetes/{bicep,terraform}
mkdir -p Data/newResource/test
# 2. Create and edit resource type definition
# Edit Data/newResource/newResource.yaml
# 3. Build and validate the resource type
make build-resource-type TYPE_FOLDER=Data/newResource
# 4. Create recipes (Bicep or Terraform)
# Edit Data/newResource/recipes/kubernetes/bicep/*.bicep
# 5. Build the recipe
make build-bicep-recipe RECIPE_PATH=Data/newResource/recipes/kubernetes/bicep
# 6. Create test application
# Edit Data/newResource/test/app.bicep
# 7. Test the recipe
make test-recipe RECIPE_PATH=Data/newResource/recipes/kubernetes/bicep
# 8. Test all recipes (if you have multiple)
make test# Test all recipes in the repository
make test
# Test a specific recipe
make test-recipe RECIPE_PATH=Security/secrets/recipes/kubernetes/bicep# Environment setup
make install-radius-cli # Install Radius CLI
make create-radius-cluster # Create k3d cluster with Radius
make delete-radius-cluster # Delete test cluster
# Build commands
make build # Build all resources
make build-resource-type TYPE_FOLDER=<path> # Build single resource type
make build-bicep-recipe RECIPE_PATH=<path> # Build Bicep recipe
make build-terraform-recipe RECIPE_PATH=<path> # Build Terraform recipe
# Test commands
make test # Test all recipes
make test-recipe RECIPE_PATH=<path> # Test single recipe
# Utility commands
make list-resource-types # List resource type folders
make list-recipes # List all recipes
make help # Show all available commandsInstall kubectl by following the official installation guide.
Create a new cluster:
make create-radius-clusterVerify cluster is running:
kubectl cluster-info
rad env list --previewEnsure you've built the recipe first:
make build-bicep-recipe RECIPE_PATH=<path>
# or
make build-terraform-recipe RECIPE_PATH=<path>Make sure bicepconfig.json is updated:
make build-resource-type TYPE_FOLDER=<folder>Ensure the recipe is built before testing:
- Bicep:
make build-bicep-recipe RECIPE_PATH=<path> - Terraform:
make build-terraform-recipe RECIPE_PATH=<path>
- Alpha: Manual testing using
make test-recipeis sufficient - Beta: Automated testing with
test/app.bicepfiles required for all recipes - Stable: Full CI/CD integration (see Contributing Tests)