You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit abd4152
Browse filesBrowse the repository at this point in the historyBrowse files
The Radius.Data/mySqlDatabases Resource Type deploys a MySQL database. To deploy a new MySQL database, first add a secret resource with the database credentials to the application definition Bicep file, then add a mySqlDatabases resource referencing the secret name.
8
+
```
9
+
resource mysql 'Radius.Data/mySqlDatabases@2025-08-01-preview' = {
When deploying the application definition, provide the database password value as a parameter. It is recommended to use a password generator such as `openssl` or equivalent. For example, `rad deploy app.bicep -p password=$(openssl rand -hex 16)`.
37
+
38
+
To connect your container to the database, create a connection from the Container resource to the database as shown below.
The connection automatically injects environment variables into the container for all properties from the database. The environment variables are named `CONNECTION_<CONNECTION-NAME>_<PROPERTY-NAME>`. In this example, the connection name is `mysqldb` so the environment variables will be:
65
+
66
+
- CONNECTION_MYSQLDB_DATABASE
67
+
- CONNECTION_MYSQLDB_HOST
68
+
- CONNECTION_MYSQLDB_PORT
69
+
70
+
apiVersions:
71
+
'2025-08-01-preview':
72
+
schema:
73
+
type: object
74
+
properties:
75
+
environment:
76
+
type: string
77
+
description: "(Required) The Radius EnvironmentID. Typically set by the rad CLI. Typically value should be `environment`"
78
+
application:
79
+
type: string
80
+
description: "(Optional) The Radius Application ID. `myApplication.id` for example."
81
+
database:
82
+
type: string
83
+
description: "(Optional) The name of the database. Defaults to `mysql_db` if not provided."
84
+
secretName:
85
+
type: string
86
+
description: "(Required) The name of the secret containing the database credentials."
87
+
version:
88
+
type: string
89
+
enum: ['5.7', '8.0', '8.4']
90
+
description: "(Optional) The major MySQL server version in the X.Y format. Assumed to be 8.4 if not specified."
91
+
host:
92
+
type: string
93
+
description: "(Read-only) The host name used to connect to the database."
94
+
readOnly: true
95
+
port:
96
+
type: integer
97
+
description: "(Read-only) The port number used to connect to the database."
description: (Optional) The access modes which are permitted to be requested by a Container. Assumed to be all modes if not specified.
729
729
required: [environment, sizeInGib]
730
+
containerImages:
731
+
description: |
732
+
The Radius.Compute/containerImages Resource Type builds a container image from source and pushes it to a container registry. It is always part of a Radius Application.
733
+
734
+
This resource type is designed for local development workflows where the source code is available on the Kubernetes node filesystem (e.g., via kind `extraMounts` or k3d `-v` flags). It uses BuildKit to build and push the image.
735
+
736
+
To build and push a container image, add a containerImages resource to your application definition Bicep file:
description: (Required) The Radius Environment ID. Typically set by the rad CLI. Typically value should be `environment`.
800
+
application:
801
+
type: string
802
+
description: (Required) The Radius Application ID. `myApplication.id` for example.
803
+
image:
804
+
type: string
805
+
description: (Required) The full container image reference including registry, repository, and tag. `ghcr.io/myorg/myapp:latest` for example. Must be lowercase.
806
+
build:
807
+
type: object
808
+
description: (Required) Build configuration for the container image.
809
+
properties:
810
+
context:
811
+
type: string
812
+
description: (Required) The path to the build context directory on the Kubernetes node. This must be a path available on the node, for example via kind extraMounts or k3d volume flags. `/app/src/myapp` for example.
813
+
dockerfile:
814
+
type: string
815
+
description: (Optional) The path to the Dockerfile relative to the build context. If not specified, `Dockerfile` is assumed.
816
+
required:
817
+
- context
818
+
registry:
819
+
type: object
820
+
description: (Optional) Registry authentication overrides. If not specified, the recipe uses credentials configured by the platform engineer as recipe parameters.
821
+
properties:
822
+
server:
823
+
type: string
824
+
description: (Optional) The registry server address. If not specified, `ghcr.io` is assumed.
825
+
username:
826
+
type: string
827
+
description: (Optional) The registry username.
828
+
token:
829
+
type: string
830
+
description: (Optional) The registry token or PAT.
The Radius.Data/mySqlDatabases Resource Type deploys a MySQL database. To deploy a new MySQL database, first add a secret resource with the database credentials to the application definition Bicep file, then add a mySqlDatabases resource referencing the secret name.
8
+
```
9
+
resource mysql 'Radius.Data/mySqlDatabases@2025-08-01-preview' = {
When deploying the application definition, provide the database password value as a parameter. It is recommended to use a password generator such as `openssl` or equivalent. For example, `rad deploy app.bicep -p password=$(openssl rand -hex 16)`.
37
+
38
+
To connect your container to the database, create a connection from the Container resource to the database as shown below.
The connection automatically injects environment variables into the container for all properties from the database. The environment variables are named `CONNECTION_<CONNECTION-NAME>_<PROPERTY-NAME>`. In this example, the connection name is `mysqldb` so the environment variables will be:
65
+
66
+
- CONNECTION_MYSQLDB_DATABASE
67
+
- CONNECTION_MYSQLDB_HOST
68
+
- CONNECTION_MYSQLDB_PORT
69
+
70
+
apiVersions:
71
+
'2025-08-01-preview':
72
+
schema:
73
+
type: object
74
+
properties:
75
+
environment:
76
+
type: string
77
+
description: "(Required) The Radius EnvironmentID. Typically set by the rad CLI. Typically value should be `environment`"
78
+
application:
79
+
type: string
80
+
description: "(Optional) The Radius Application ID. `myApplication.id` for example."
81
+
database:
82
+
type: string
83
+
description: "(Optional) The name of the database. Defaults to `mysql_db` if not provided."
84
+
secretName:
85
+
type: string
86
+
description: "(Required) The name of the secret containing the database credentials."
87
+
version:
88
+
type: string
89
+
enum: ['5.7', '8.0', '8.4']
90
+
description: "(Optional) The major MySQL server version in the X.Y format. Assumed to be 8.4 if not specified."
91
+
host:
92
+
type: string
93
+
description: "(Read-only) The host name used to connect to the database."
94
+
readOnly: true
95
+
port:
96
+
type: integer
97
+
description: "(Read-only) The port number used to connect to the database."
0 commit comments