-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Application.Dapr/ConfigurationStores related docs (#1235)
* Add Application.Dapr/ConfigurationStores related docs Signed-off-by: SoTrx <[email protected]> Signed-off-by: SoTrxII <[email protected]> * Add "daprConfigurationStores", "configurationStore" and "configurationStores" to custom english dict Signed-off-by: SoTrx <[email protected]> Signed-off-by: SoTrxII <[email protected]> * Adding "configurationStore" and "configurationStores" to the custom english dictionnary Signed-off-by: SoTrx <[email protected]> Signed-off-by: SoTrxII <[email protected]> * Name change in dapr configuration store recipe Signed-off-by: SoTrxII <[email protected]> * chore(dapr-configuration) : Changing sample recipe names for a more explicit name Signed-off-by: SoTrxII <[email protected]> --------- Signed-off-by: SoTrx <[email protected]> Signed-off-by: SoTrxII <[email protected]>
- Loading branch information
Showing
7 changed files
with
187 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
docs/content/reference/api/applications.dapr/api-configurationStores.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" >}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 87 additions & 0 deletions
87
.../content/reference/resource-schema/dapr-schema/dapr-configurationStore/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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` | |
47 changes: 47 additions & 0 deletions
47
...ource-schema/dapr-schema/dapr-configurationStore/snippets/dapr-configuration-manual.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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: '<REDIS-URL>' | ||
} | ||
redisPassword: { | ||
value: '' | ||
} | ||
} | ||
version: 'v1' | ||
} | ||
} | ||
//SAMPLE |
29 changes: 29 additions & 0 deletions
29
...ource-schema/dapr-schema/dapr-configurationStore/snippets/dapr-configuration-recipe.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters