diff --git a/.github/config/en-custom.txt b/.github/config/en-custom.txt index e85497697..fd8001358 100644 --- a/.github/config/en-custom.txt +++ b/.github/config/en-custom.txt @@ -22,6 +22,10 @@ CLI CLIs CMD CNCF +configurationStore +configurationStores +ConfigurationStore +ConfigurationStores CQRS CRDs CRUDL @@ -166,6 +170,7 @@ cosmosAccount cosmosdb customizations dapr +daprConfigurationStores daprPubSubBrokers daprSecretStores daprStateStores diff --git a/docs/content/reference/api/applications.dapr/api-configurationStores.md b/docs/content/reference/api/applications.dapr/api-configurationStores.md new file mode 100644 index 000000000..dc7ba7314 --- /dev/null +++ b/docs/content/reference/api/applications.dapr/api-configurationStores.md @@ -0,0 +1,9 @@ +--- +type: api +title: "Applications.Dapr/configurationStores API reference" +linkTitle: "configurationStores" +description: "Detailed reference documentation on the Applications.Dapr/configurationStores API" +slug: "configurationStores" +--- + +{{< redoc "swagger/specification/applications/resource-manager/Applications.Dapr/preview/2023-10-01-preview/openapi.json" >}} \ No newline at end of file diff --git a/docs/content/reference/api/applications.dapr/api-pubsubbrokers.md b/docs/content/reference/api/applications.dapr/api-pubsubbrokers.md index 83c01cccd..5a72e7d25 100644 --- a/docs/content/reference/api/applications.dapr/api-pubsubbrokers.md +++ b/docs/content/reference/api/applications.dapr/api-pubsubbrokers.md @@ -2,7 +2,7 @@ type: api title: "Applications.Dapr/pubSubBrokers API reference" linkTitle: "pubSubBrokers" -description: "Detailed reference documentation on the Applications.Dapr/mongoDatabases API" +description: "Detailed reference documentation on the Applications.Dapr/pubSubBrokers API" slug: "pubSubBrokers" --- diff --git a/docs/content/reference/resource-schema/dapr-schema/dapr-configurationStore/index.md b/docs/content/reference/resource-schema/dapr-schema/dapr-configurationStore/index.md new file mode 100644 index 000000000..0a42681a5 --- /dev/null +++ b/docs/content/reference/resource-schema/dapr-schema/dapr-configurationStore/index.md @@ -0,0 +1,87 @@ +--- +type: docs +title: "Dapr Configuration Store resource" +linkTitle: "Configuration Store" +description: "Learn how to use Dapr Configuration Store in Radius" +weight: 300 +slug: "configurationStore" +--- + +## Overview + +An `Applications.Dapr/configurationStores` resource represents a [Dapr configuration](https://docs.dapr.io/operations/configuration/configuration-overview/) store. + +## Resource format + +{{< tabs Recipe Manual >}} + +{{< codetab >}} + +{{< rad file="snippets/dapr-configuration-recipe.bicep" embed=true marker="//SAMPLE" >}} + +{{< /codetab >}} + +{{< codetab >}} + +{{< rad file="snippets/dapr-configuration-manual.bicep" embed=true marker="//SAMPLE" >}} + +{{< /codetab >}} + +{{< /tabs >}} + +### Top-level + +| Key | Required | Description | Example | +|------|:--------:|-------------|---------| +| name | y | The name of the configuration store. Names must contain at most 63 characters, contain only lowercase alphanumeric characters, '-', or '.', start with an alphanumeric character, and end with an alphanumeric character. | `my-config` | +| location | y | The location of your resource. See [common values]({{< ref "resource-schema.md#common-values" >}}) for more information. | `global` +| [properties](#properties) | y | Properties of the resource. | [See below](#properties) + +### Properties + +| Key | Required | Description | Example | +|------|:--------:|-------------|---------| +| application | n | The ID of the application resource this resource belongs to. | `app.id` +| environment | y | The ID of the environment resource this resource belongs to. | `env.id` +| [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 resources which underlay this resource. For example, an Azure Redis Cache ID if the Dapr Configuration Store resource is leveraging Azure Redis Cache. | [See below](#resources) +| type | n | The Dapr component type. Set only when resourceProvisioning is 'manual'. | `configuration.redis` | +| metadata | n | Metadata object for the Dapr component. Schema must match [Dapr component](https://docs.dapr.io/reference/components-reference/supported-configuration-stores/). Set only when resourceProvisioning is 'manual'. | `{ redisHost: 'localhost:6379' }` | +| version | n | The version of the Dapr component. See [Dapr components](https://docs.dapr.io/reference/components-reference/supported-configuration-stores/) for available versions. Set only when resourceProvisioning is 'manual'. | `v1` | +| componentName | n | _(read-only)_ The name of the Dapr component that is generated and applied to the underlying system. Used by the Dapr SDKs or APIs to access the Dapr component. | `myconfig` | + +#### Recipe + +| Property | Required | Description | Example(s) | +|------|:--------:|-------------|---------| +| name | n | Specifies the name of the Recipe that should be deployed. If not set, the name defaults to `default`. | `name: 'azure-prod'` +| parameters | n | An object that contains a list of parameters to set on the Recipe. | `{ size: 'large' }` + +#### Resources + +| Property | Required | Description | Example(s) | +|----------|:--------:|-------------|------------| +| id | n | Resource ID of the supporting resource. | `account.id` + +## Resource provisioning + +### Provision with a Recipe + +[Recipes]({{< ref "guides/recipes/overview" >}}) automate infrastructure provisioning using approved templates. + +You can specify a Recipe name that is registered in the environment or omit the name and use the "default" Recipe. + +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-configuration-stores/). + +## Environment variables for connections + +Other Radius resources, such as [containers]({{< ref "guides/author-apps/containers" >}}), may connect to a Dapr configuration store resource via [connections]({{< ref "application-graph#connections-and-injected-values" >}}). When a connection to Dapr configuration store named, for example, `myconnection` is declared, Radius injects values into environment variables that are then used to access the connected Dapr configuration store resource: + +| Environment variable | Example(s) | +|----------------------|------------| +| CONNECTION_MYCONNECTION_COMPONENTNAME | `myconfig` | \ No newline at end of file diff --git a/docs/content/reference/resource-schema/dapr-schema/dapr-configurationStore/snippets/dapr-configuration-manual.bicep b/docs/content/reference/resource-schema/dapr-schema/dapr-configurationStore/snippets/dapr-configuration-manual.bicep new file mode 100644 index 000000000..293dafcb2 --- /dev/null +++ b/docs/content/reference/resource-schema/dapr-schema/dapr-configurationStore/snippets/dapr-configuration-manual.bicep @@ -0,0 +1,47 @@ +extension radius + +@description('The ID of your Radius Environment. Automatically injected by the rad CLI.') +param environment string + +resource app 'Applications.Core/applications@2023-10-01-preview' = { + name: 'dapr-config' + properties: { + environment: environment + } +} + +resource myapp 'Applications.Core/containers@2023-10-01-preview' = { + name: 'myapp' + properties: { + application: app.id + connections: { + daprconfig: { + source: config.id + } + } + container: { + image: 'ghcr.io/radius-project/magpiego:latest' + } + } +} + +//SAMPLE +resource config 'Applications.Dapr/configurationStores@2023-10-01-preview' = { + name: 'configstore' + properties: { + environment: environment + application: app.id + resourceProvisioning: 'manual' + type: 'configuration.redis' + metadata: { + redisHost: { + value: '' + } + redisPassword: { + value: '' + } + } + version: 'v1' + } +} +//SAMPLE diff --git a/docs/content/reference/resource-schema/dapr-schema/dapr-configurationStore/snippets/dapr-configuration-recipe.bicep b/docs/content/reference/resource-schema/dapr-schema/dapr-configurationStore/snippets/dapr-configuration-recipe.bicep new file mode 100644 index 000000000..6d2cc06d2 --- /dev/null +++ b/docs/content/reference/resource-schema/dapr-schema/dapr-configurationStore/snippets/dapr-configuration-recipe.bicep @@ -0,0 +1,29 @@ +extension radius + +@description('The ID of your Radius Environment. Automatically injected by the rad CLI.') +param environment string + +resource app 'Applications.Core/applications@2023-10-01-preview' = { + name: 'dapr-configstore' + properties: { + environment: environment + } +} + +//SAMPLE +resource configStore 'Applications.Dapr/configurationStores@2023-10-01-preview' = { + name: 'configstore' + properties: { + environment: environment + application: app.id + recipe: { + // Name a specific recipe to use + name: 'azure-redis-with-config' + // Set optional/required parameters (specific to the Recipe) + parameters: { + size: 'large' + } + } + } +} +//SAMPLE diff --git a/docs/content/tutorials/tutorial-recipe/index.md b/docs/content/tutorials/tutorial-recipe/index.md index d25dd0cae..963e92eb8 100644 --- a/docs/content/tutorials/tutorial-recipe/index.md +++ b/docs/content/tutorials/tutorial-recipe/index.md @@ -61,14 +61,15 @@ Developers don't need to specify what cloud resources they're using in their app You should see a table of available Recipes: ``` - NAME TYPE TEMPLATE KIND TEMPLATE VERSION TEMPLATE - default Applications.Datastores/sqlDatabases bicep ghcr.io/radius-project/recipes/local-dev/sqldatabases:latest - default Applications.Messaging/rabbitMQQueues bicep ghcr.io/radius-project/recipes/local-dev/rabbitmqqueues:latest - default Applications.Dapr/pubSubBrokers bicep ghcr.io/radius-project/recipes/local-dev/pubsubbrokers:latest - default Applications.Dapr/secretStores bicep ghcr.io/radius-project/recipes/local-dev/secretstores:latest - default Applications.Dapr/stateStores bicep ghcr.io/radius-project/recipes/local-dev/statestores:latest - default Applications.Datastores/mongoDatabases bicep ghcr.io/radius-project/recipes/local-dev/mongodatabases:latest - default Applications.Datastores/redisCaches bicep ghcr.io/radius-project/recipes/local-dev/rediscaches:latest + NAME TYPE TEMPLATE KIND TEMPLATE VERSION TEMPLATE + default Applications.Datastores/sqlDatabases bicep ghcr.io/radius-project/recipes/local-dev/sqldatabases:latest + default Applications.Messaging/rabbitMQQueues bicep ghcr.io/radius-project/recipes/local-dev/rabbitmqqueues:latest + default Applications.Dapr/pubSubBrokers bicep ghcr.io/radius-project/recipes/local-dev/pubsubbrokers:latest + default Applications.Dapr/secretStores bicep ghcr.io/radius-project/recipes/local-dev/secretstores:latest + default Applications.Dapr/stateStores bicep ghcr.io/radius-project/recipes/local-dev/statestores:latest + default Applications.Datastores/mongoDatabases bicep ghcr.io/radius-project/recipes/local-dev/mongodatabases:latest + default Applications.Datastores/redisCaches bicep ghcr.io/radius-project/recipes/local-dev/rediscaches:latest + default Applications.Datastores/configurationStores bicep ghcr.io/radius-project/recipes/local-dev/configurationStores:latest ``` {{< alert title="💡 local-dev Recipes" color="info" >}}