2. Create Resource Types
Resource Types are the building blocks of Radius and define what developers can deploy. In part two of this tutorial, you will create a PostgreSQL Resource Type.
Create a PostgreSQL Resource Type
To create a PostgreSQL Resource Type in Radius, create the resource type definition file then create the resource type in Radius. The resource type definition for PostgreSQL is in the Radius resource-types-contrib repository where all the Radius Resource Types and Recipes are maintained.
Download postgreSqlDatabases.yamlThe PostgreSQL Resource Type definition includes:
namespace: The namespace of the resource type, as a conventionRadius.Datais recommended but any name in the formPrimaryName.SecondaryNamecan be usedtypes: The name of the Resource Typedescription: The developer documentation on how and when to use the resource, formatted using MarkdownapiVersions: The version of the schema defined belowschema: The OpenAPI v3 schema which defines the properties of the resource typeenvironment: The Radius environment ID which the resource is deployed to, this property is set by the Radius CLI when the resource is deployedapplication: The application ID which the resource belongs tosize: The size of the PostgreSQL database which must be ‘S’,‘M’, or ‘L’host: The host name used to connect to the databaseport: The port used to connect to the databaseusername: The username used to connect to the databasepassword: The password used to connect to the database
The host, port, username, and password properties are read-only properties. These properties are set by the Recipe as outputs.
Create the Resource Type using the rad resource-type create command:
rad resource-type create postgreSqlDatabases -f postgreSqlDatabases.yaml
You should see output similar to:
Creating resource type Radius.Data/postgreSqlDatabases
Creating API Version Radius.Data/postgreSqlDatabases@2025-08-01-preview
Creating location Radius.Data/global/
Create a Bicep extension
The rad resource-type create command creates the Resource Type in the Radius control plane. The next step is to create a Bicep extension which will be used by the Radius CLI and VS Code (if you have the Bicep extension for VS Code installed).
Warning
This step is required even if you use Terraform-based Recipes to deploy the PostgreSQL Resource Type as part of the application.-
Generate the Bicep extension using the rad bicep publish-extension command.
rad bicep publish-extension -f postgreSqlDatabases.yaml --target radiusResources.tgzYou should see output similar to:
$ rad bicep publish-extension -f postgreSqlDatabases.yaml --target radiusResources.tgz Writing types to /var/folders/w8/89pqzjp52pbg4g256z9cpkww0000gn/T/bicep-extension-2214011863/types.json Writing index to /var/folders/w8/89pqzjp52pbg4g256z9cpkww0000gn/T/bicep-extension-2214011863/index.json Writing documentation to /var/folders/w8/89pqzjp52pbg4g256z9cpkww0000gn/T/bicep-extension-2214011863/index.md Successfully published Bicep extension "postgreSqlDatabases.yaml" to "radiusResources.tgz" -
Create a file called
bicepconfig.jsonfile and add the following contents:{ "extensions": { "radius": "br:biceptypes.azurecr.io/radius:latest", "radiusResources": "radiusResources.tgz" } }Now, any Bicep template with
extension radiusResourceswill reference theradiusResources.tgzfile for details about the PostgreSQL resource type.
View the Resource Type in Radius Dashboard
The Radius Dashboard is the GUI for viewing Resource types, Environments and Applications. In order to access it, Kubernetes must expose the Dashboard’s network port. The easiest way to do that is using the kubectl port-forward command:
kubectl port-forward --namespace=radius-system svc/dashboard 7007:80
Navigate to http://localhost:7007/resource-types/Radius.Data/postgreSqlDatabases to view the documentation of the PostgreSQL resource type. You should see the Dashboard similar to the screenshot below.
In part three of this tutorial, you will create a Recipe to deploy the PostgreSQL Resource Type you just created.
Next Step: Create Recipes
Feedback
Was this page helpful?
Glad to hear it! Please feel free to star our repo and join our Discord server to stay up to date with the project.
Sorry to hear that. If you would like to also contribute a suggestion visit and tell us how we can improve.