From 27771d86be63ecede760dc1349a8d77861855ebd Mon Sep 17 00:00:00 2001 From: Will Tsai <28876888+willtsai@users.noreply.github.com> Date: Tue, 8 Aug 2023 15:18:34 -0700 Subject: [PATCH] address feedback Signed-off-by: Will Tsai <28876888+willtsai@users.noreply.github.com> --- .../concepts/application-graph/index.md | 6 +++-- .../link-schema/cache/redis/index.md | 20 +++++++++------ .../dapr-schema/dapr-pubsub/_index.md | 10 +++++++- .../dapr-schema/dapr-secretstore/_index.md | 10 +++++++- .../dapr-schema/dapr-statestore/_index.md | 10 +++++++- .../databases/microsoft-sql/index.md | 25 ++++++++++--------- .../link-schema/databases/mongodb/index.md | 22 ++++++++-------- .../link-schema/messaging/rabbitmq/index.md | 20 +++++++++------ 8 files changed, 80 insertions(+), 43 deletions(-) diff --git a/docs/content/concepts/application-graph/index.md b/docs/content/concepts/application-graph/index.md index dab03c194..eeabcc2d7 100644 --- a/docs/content/concepts/application-graph/index.md +++ b/docs/content/concepts/application-graph/index.md @@ -28,9 +28,11 @@ For example, if you want a container to read from an Azure Storage Account witho ### Connections and injected values -The mechanism behind this automated application deployment is injected values into environment variables. When a connection between two resources is declared, Radius injects resource related information into environment variables that are then used to access the respective resource without having to hard code URIs, connection strings, access keys, or anything that application code needs to successfully communicate. Refer to the [reference documentation]({{< ref resource-schema >}}) of each resource for more information. +When a connection between two resources is declared, Radius injects resource related information into environment variables that are then used to access the respective resource without having to hard code URIs, connection strings, access keys, or anything that application code needs to successfully communicate. -These environment variables follow a naming convention that makes their use predictable. The naming pattern is derived from the connection name and resource type, which determines what values are required. This way the code that needs to read the values gets to define how they are named. For example, adding a connection called `myconnection` that connects to a MongoDB resource would result in the following environment variables being injected: +These environment variables follow a naming convention that makes their use predictable. The naming pattern is derived from the connection name and resource type, which determines what values are required. This way the code that needs to read the values gets to define how they are named. Refer to the [reference documentation]({{< ref resource-schema >}}) of each resource for more information. + +For example, adding a connection called `myconnection` that connects to a MongoDB resource would result in the following environment variables being injected: ```sh # the connection string to the resource diff --git a/docs/content/reference/resource-schema/link-schema/cache/redis/index.md b/docs/content/reference/resource-schema/link-schema/cache/redis/index.md index 2cedde702..a0e71b9ca 100644 --- a/docs/content/reference/resource-schema/link-schema/cache/redis/index.md +++ b/docs/content/reference/resource-schema/link-schema/cache/redis/index.md @@ -68,7 +68,7 @@ The `redislabs.com/Redis` link is a [portable link]({{< ref links-resources >}}) | Property | Required | Description | Example(s) | |----------|:--------:|-------------|------------| -| connectionString | n | The connection string for the Redis cache. Write only. | `https://mycache.redis.cache.windows.net,password=*****,....` +| connectionString | n | The connection string for the Redis cache. Write only. | `contoso5.redis.cache.windows.net,ssl=true,password=...` | password | n | The password for the Redis cache. Write only. | `mypassword` | url | n | The connection URL for the Redis cache. Set automatically based on the values provided for `host`, `port`, `username`, and `password`. Can be explicitly set to override default behavior. Write only. | `redis://username:password@localhost:6380/0?ssl=true` | @@ -94,10 +94,14 @@ If you want to manually manage your infrastructure provisioning without the use ## Environment variables for connections -Other Radius resources, such as [containers]({{< ref "container" >}}), may connect to a Redis resource via [connections]({{< ref "application-graph#connections-and-injected-values" >}}). When a connection to Redis is declared, Radius injects values into environment variables that are then used to access the connected Redis resource: - -| Environment variable | Description | Example(s) | -|----------------------|-------------|------------| -| CONNECTION_MYCONNECTION_USERNAME | The username for the Redis cache. | `admin` | -| CONNECTION_MYCONNECTION_CONNECTIONSTRING | The connection string for the Redis cache. | `https://mycache.redis.cache.windows.net,password=*****,....` | -| CONNECTION_MYCONNECTION_PASSWORD | The password for the Redis cache. | `mypassword` | \ No newline at end of file +Other Radius resources, such as [containers]({{< ref "container" >}}), may connect to a Redis resource via [connections]({{< ref "application-graph#connections-and-injected-values" >}}). When a connection to Redis named, for example, `myconnection` is declared, Radius injects values into environment variables that are then used to access the connected Redis resource: + +| Environment variable | Example(s) | +|----------------------|------------| +| CONNECTION_MYCONNECTION_HOST | `mycache.redis.cache.windows.net` | +| CONNECTION_MYCONNECTION_PORT | `6379` | +| CONNECTION_MYCONNECTION_TLS | `true` | +| CONNECTION_MYCONNECTION_USERNAME | `admin` | +| CONNECTION_MYCONNECTION_CONNECTIONSTRING | `contoso5.redis.cache.windows.net,ssl=true,password=...` | +| CONNECTION_MYCONNECTION_PASSWORD | `mypassword` | +| CONNECTION_MYCONNECTION_URL | `redis://username:password@localhost:6380/0?ssl=true` | diff --git a/docs/content/reference/resource-schema/link-schema/dapr-schema/dapr-pubsub/_index.md b/docs/content/reference/resource-schema/link-schema/dapr-schema/dapr-pubsub/_index.md index 4b9081411..523c56206 100644 --- a/docs/content/reference/resource-schema/link-schema/dapr-schema/dapr-pubsub/_index.md +++ b/docs/content/reference/resource-schema/link-schema/dapr-schema/dapr-pubsub/_index.md @@ -76,4 +76,12 @@ Parameters can also optionally be specified for the Recipe. ### Provision manually -If you want to manually manage your infrastructure provisioning outside of Recipes, you can set `resourceProvisioning` to `'manual'` and specify `type`, `metadata`, and `version` for the Dapr component. These values must match the schema of the intended [Dapr component](https://docs.dapr.io/reference/components-reference/supported-pubsub/). \ No newline at end of file +If you want to manually manage your infrastructure provisioning outside of Recipes, you can set `resourceProvisioning` to `'manual'` and specify `type`, `metadata`, and `version` for the Dapr component. These values must match the schema of the intended [Dapr component](https://docs.dapr.io/reference/components-reference/supported-pubsub/). + +## Environment variables for connections + +Other Radius resources, such as [containers]({{< ref "container" >}}), may connect to a Dapr pub/sub resource via [connections]({{< ref "application-graph#connections-and-injected-values" >}}). When a connection to Dapr pub/sub named, for example, `myconnection` is declared, Radius injects values into environment variables that are then used to access the connected Dapr pub/sub resource: + +| Environment variable | Example(s) | +|----------------------|------------| +| CONNECTION_MYCONNECTION_COMPONENTNAME | `myapp-mypubsub` | \ No newline at end of file diff --git a/docs/content/reference/resource-schema/link-schema/dapr-schema/dapr-secretstore/_index.md b/docs/content/reference/resource-schema/link-schema/dapr-schema/dapr-secretstore/_index.md index 7e15a1eba..f7cafb528 100644 --- a/docs/content/reference/resource-schema/link-schema/dapr-schema/dapr-secretstore/_index.md +++ b/docs/content/reference/resource-schema/link-schema/dapr-schema/dapr-secretstore/_index.md @@ -74,4 +74,12 @@ When no Recipe configuration is set Radius will use the Recipe registered as the ### Provision manually -If you want to manually manage your infrastructure provisioning outside of Recipes, you can set `resourceProvisioning` to `'manual'` and provide all necessary parameters and values the enable Radius to deploy or connect to the desired infrastructure. \ No newline at end of file +If you want to manually manage your infrastructure provisioning outside of Recipes, you can set `resourceProvisioning` to `'manual'` and provide all necessary parameters and values the enable Radius to deploy or connect to the desired infrastructure. + +## Environment variables for connections + +Other Radius resources, such as [containers]({{< ref "container" >}}), may connect to a Dapr secret store resource via [connections]({{< ref "application-graph#connections-and-injected-values" >}}). When a connection to Dapr secret store named, for example, `myconnection` is declared, Radius injects values into environment variables that are then used to access the connected Dapr secret store resource: + +| Environment variable | Example(s) | +|----------------------|------------| +| CONNECTION_MYCONNECTION_COMPONENTNAME | `mysecretstore` | \ No newline at end of file diff --git a/docs/content/reference/resource-schema/link-schema/dapr-schema/dapr-statestore/_index.md b/docs/content/reference/resource-schema/link-schema/dapr-schema/dapr-statestore/_index.md index 416587628..40281a6ad 100644 --- a/docs/content/reference/resource-schema/link-schema/dapr-schema/dapr-statestore/_index.md +++ b/docs/content/reference/resource-schema/link-schema/dapr-schema/dapr-statestore/_index.md @@ -76,4 +76,12 @@ When no Recipe configuration is set Radius will use the Recipe registered as the ### Provision manually -If you want to manually manage your infrastructure provisioning outside of Recipes, you can set `resourceProvisioning` to `'manual'` and provide all necessary parameters and values and values that enable Radius to deploy or connect to the desired infrastructure. \ No newline at end of file +If you want to manually manage your infrastructure provisioning outside of Recipes, you can set `resourceProvisioning` to `'manual'` and provide all necessary parameters and values and values that enable Radius to deploy or connect to the desired infrastructure. + +## Environment variables for connections + +Other Radius resources, such as [containers]({{< ref "container" >}}), may connect to a Dapr state store resource via [connections]({{< ref "application-graph#connections-and-injected-values" >}}). When a connection to Dapr state store named, for example, `myconnection` is declared, Radius injects values into environment variables that are then used to access the connected Dapr state store resource: + +| Environment variable | Example(s) | +|----------------------|------------| +| CONNECTION_MYCONNECTION_COMPONENTNAME | `mystatestore` | \ No newline at end of file diff --git a/docs/content/reference/resource-schema/link-schema/databases/microsoft-sql/index.md b/docs/content/reference/resource-schema/link-schema/databases/microsoft-sql/index.md index 4b7a213a3..230b68ae8 100644 --- a/docs/content/reference/resource-schema/link-schema/databases/microsoft-sql/index.md +++ b/docs/content/reference/resource-schema/link-schema/databases/microsoft-sql/index.md @@ -45,8 +45,8 @@ This application showcases how Radius can use a user-manged Azure SQL Database. | [resourceProvisioning](#resource-provisioning) | n | Specifies how the underlying service/resource is provisioned and managed. Options are to provision automatically via 'recipe' or provision manually via 'manual'. Selection determines which set of fields to additionally require. Defaults to 'recipe'. | `manual` | [recipe](#recipe) | n | Configuration for the Recipe which will deploy the backing infrastructure. | [See below](#recipe) | [resources](#resources) | n | An array of IDs of the underlying resources for the link. | [See below](#resources) -| server | n | The fully qualified domain name of the SQL server. | `sql.hello.com` -| database | n | The name of the SQL database. | `5000` +| server | n | The fully qualified domain name of the SQL server. | `mydatabase.database.windows.net` +| database | n | The name of the SQL database. | `mydatabase` | port | n | The SQL database port. | `1433` | username | n | The username for the SQL database. | `'myusername'` | [secrets](#secrets) | n | Secrets used when building the link from values. | [See below](#secrets) @@ -55,8 +55,8 @@ This application showcases how Radius can use a user-manged Azure SQL Database. | Property | Required | Description | Example(s) | |----------|:--------:|-------------|------------| -| connectionString | n | The connection string for the SQL database. Write only. | `'https://mysqlserver.cluster.svc.local,password=*****,....'` -| password | n | The password for the SQL database. Write only. | `'mypassword'` +| connectionString | n | The connection string for the SQL database. Write only. | `Server=.mysql.database.azure.com;Port=;Database=;UID=;PWD=` +| password | n | The password for the SQL database. Write only. | `mypassword` #### Recipe @@ -84,12 +84,13 @@ If you want to manually manage your infrastructure provisioning outside of Recip ## Environment variables for connections -Other Radius resources, such as [containers]({{< ref "container" >}}), may connect to a Azure SQL resource via [connections]({{< ref "application-graph#connections-and-injected-values" >}}). When a connection to Azure SQL is declared, Radius injects values into environment variables that are then used to access the connected Azure SQL resource: +Other Radius resources, such as [containers]({{< ref "container" >}}), may connect to a Azure SQL resource via [connections]({{< ref "application-graph#connections-and-injected-values" >}}). When a connection to Azure SQL named, for example, `myconnection` is declared, Radius injects values into environment variables that are then used to access the connected Azure SQL resource: -| Environment variable | Description | Example(s) | -|----------------------|-------------|------------| -| CONNECTION_MYCONNECTION_DATABASE | The name of the target Azure SQL database. | `mydatabase` | -| CONNECTION_MYCONNECTION_SERVER | The fully qualified domain name of the target Azure SQL server. | `sql.hello.com` | -| CONNECTION_MYCONNECTION_USERNAME | The username for the target Azure SQL database. | `admin` | -| CONNECTION_MYCONNECTION_PASSWORD | The password for the target Azure SQL database. | `mypassword` | -| CONNECTION_MYCONNECTION_CONNECTIONSTRING | The connection string for the target Azure SQL database. | `https://mysqlserver.cluster.svc.local,password=*****,....` | \ No newline at end of file +| Environment variable | Example(s) | +|----------------------|------------| +| CONNECTION_MYCONNECTION_DATABASE | `mydatabase` | +| CONNECTION_MYCONNECTION_SERVER | `mydatabase.database.windows.net` | +| CONNECTION_MYCONNECTION_PORT | `1433` | +| CONNECTION_MYCONNECTION_USERNAME | `myusername` | +| CONNECTION_MYCONNECTION_PASSWORD | `mypassword` | +| CONNECTION_MYCONNECTION_CONNECTIONSTRING | `Server=.mysql.database.azure.com;Port=;Database=;UID=;PWD=` | \ No newline at end of file diff --git a/docs/content/reference/resource-schema/link-schema/databases/mongodb/index.md b/docs/content/reference/resource-schema/link-schema/databases/mongodb/index.md index a8c00fb20..3deabf9f4 100644 --- a/docs/content/reference/resource-schema/link-schema/databases/mongodb/index.md +++ b/docs/content/reference/resource-schema/link-schema/databases/mongodb/index.md @@ -45,7 +45,7 @@ The `mongodb.com/MongoDatabase` link is a [portable link]({{< ref links-resource | [recipe](#recipe) | n | Configuration for the Recipe which will deploy the backing infrastructure. | [See below](#recipe) | [resources](#resources) | n | An array of resources which underlay this resource. For example, an Azure CosmosDB database ID if the MongoDB resource is leveraging CosmosDB. | [See below](#resources) | database | n | Database name of the target MongoDB | `mongodb-prod` -| host | n | The MongoDB host name. | `mongo.hello.com` +| host | n | The MongoDB host name. | `mongodb://mongodb0.example.com:4242` | port | n | The MongoDB port. | `4242` | username | n | The username for the MongoDB. | `'myusername'` | [secrets](#secrets) | n | Secrets used when building the link from values. | [See below](#secrets) @@ -67,8 +67,8 @@ The `mongodb.com/MongoDatabase` link is a [portable link]({{< ref links-resource | Property | Required | Description | Example(s) | |----------|:--------:|-------------|------------| -| connectionString | n | The connection string for the MongoDb. Write only. | `'https://mymongo.cluster.svc.local,password=*****,....'` -| password | n | The password for the MongoDB. Write only. | `'mypassword'` +| connectionString | n | The connection string for the MongoDb. Write only. | `mongodb://[username:password@]host1[:port1][,...hostN[:portN]][/[defaultauthdb][?options]]` +| password | n | The password for the MongoDB. Write only. | `mypassword` ### Methods @@ -95,11 +95,13 @@ If you want to manually manage your infrastructure provisioning outside of Recip ## Environment variables for connections -Other Radius resources, such as [containers]({{< ref "container" >}}), may connect to a MongoDB resource via [connections]({{< ref "application-graph#connections-and-injected-values" >}}). When a connection to MongoDB is declared, Radius injects values into environment variables that are then used to access the connected MongoDB resource: +Other Radius resources, such as [containers]({{< ref "container" >}}), may connect to a MongoDB resource via [connections]({{< ref "application-graph#connections-and-injected-values" >}}). When a connection to MongoDB named, for example, `myconnection` is declared, Radius injects values into environment variables that are then used to access the connected MongoDB resource: -| Environment variable | Description | Example(s) | -|----------------------|-------------|------------| -| CONNECTION_MYCONNECTION_DATABASE | Name of the target Mongo database | `mongodb-prod` | -| CONNECTION_MYCONNECTION_USERNAME | Username for the target Mongo database | `myusername` | -| CONNECTION_MYCONNECTION_PASSWORD | Password for the target Mongo database | `mypassword` | -| CONNECTION_MYCONNECTION_CONNECTIONSTRING | Connection string for the target Mongo database | `https://mymongo.cluster.svc.local,password=*****,....` | \ No newline at end of file +| Environment variable | Example(s) | +|----------------------|------------| +| CONNECTION_MYCONNECTION_HOST | `mongodb://mongodb0.example.com:4242` | +| CONNECTION_MYCONNECTION_PORT | `4242` | +| CONNECTION_MYCONNECTION_DATABASE | `mongodb-prod` | +| CONNECTION_MYCONNECTION_USERNAME | `myusername` | +| CONNECTION_MYCONNECTION_PASSWORD | `mypassword` | +| CONNECTION_MYCONNECTION_CONNECTIONSTRING | `mongodb://[username:password@]host1[:port1][,...hostN[:portN]][/[defaultauthdb][?options]]` | \ No newline at end of file diff --git a/docs/content/reference/resource-schema/link-schema/messaging/rabbitmq/index.md b/docs/content/reference/resource-schema/link-schema/messaging/rabbitmq/index.md index cc84a44e5..d598e21af 100644 --- a/docs/content/reference/resource-schema/link-schema/messaging/rabbitmq/index.md +++ b/docs/content/reference/resource-schema/link-schema/messaging/rabbitmq/index.md @@ -88,11 +88,15 @@ If you want to manually manage your infrastructure provisioning outside of Recip ## Environment variables for connections -Other Radius resources, such as [containers]({{< ref "container" >}}), may connect to a RabbitMQ resource via [connections]({{< ref "application-graph#connections-and-injected-values" >}}). When a connection to RabbitMQ is declared, Radius injects values into environment variables that are then used to access the connected RabbitMQ resource: - -| Environment variable | Description | Example(s) | -|----------------------|-------------|------------| -| CONNECTION_MYCONNECTION_QUEUE | The name of the target RabbitMQ queue. | `'orders'` | -| CONNECTION_MYCONNECTION_USERNAME | The username for the target RabbitMQ queue. | `'guest'` | -| CONNECTION_MYCONNECTION_CONNECTIONSTRING | The connection string to the target RabbitMQ queue. | `'amqp://guest:***@rabbitmq.svc.local.cluster:5672'` | -| CONNECTION_MYCONNECTION_PASSWORD | The password for the target RabbitMQ queue. | `'password'` | \ No newline at end of file +Other Radius resources, such as [containers]({{< ref "container" >}}), may connect to a RabbitMQ resource via [connections]({{< ref "application-graph#connections-and-injected-values" >}}). When a connection to RabbitMQ named, for example, `myconnection` is declared, Radius injects values into environment variables that are then used to access the connected RabbitMQ resource: + +| Environment variable | Example(s) | +|----------------------|------------| +| CONNECTION_MYCONNECTION_QUEUE | `'orders'` | +| CONNECTION_MYCONNECTION_HOST | `'rabbitmq.svc.local.cluster'` | +| CONNECTION_MYCONNECTION_PORT | `'5672'` | +| CONNECTION_MYCONNECTION_VHOST | `'qa1'` | +| CONNECTION_MYCONNECTION_USERNAME | `'guest'` | +| CONNECTION_MYCONNECTION_TLS | `'true'` | +| CONNECTION_MYCONNECTION_CONNECTIONSTRING | `'amqp://${username}:${password}@${rmqContainer.properties.hostname}:${rmqContainer.properties.port}'` | +| CONNECTION_MYCONNECTION_PASSWORD | `'password'` | \ No newline at end of file