Skip to content

Commit 734d9d6

Browse files
authored
Merge pull request #198386 from cebundy/multiple-dapr-components
[Container Apps]: explain how to add multiple dapr components using CLI and YAML
2 parents 04c355d + 0866d62 commit 734d9d6

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

articles/container-apps/dapr-overview.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,12 @@ Based on your needs, you can "plug in" certain Dapr component types like state s
7171
7272
# [YAML](#tab/yaml)
7373

74-
When defining a Dapr component via YAML, you will pass your component manifest into the Azure CLI. For example, deploy a `pubsub.yaml` component using the following command:
74+
When defining a Dapr component via YAML, you will pass your component manifest into the Azure CLI. When configuring multiple components, you will need to create a separate YAML file and run the Azure CLI command for each component.
75+
76+
For example, deploy a `pubsub.yaml` component using the following command:
7577

7678
```azurecli
77-
az containerapp env dapr-component set --name ENVIRONMENT_NAME --resource-group RESOURCE_GROUP_NAME --dapr-component-name pubsub--yaml "./pubsub.yaml"
79+
az containerapp env dapr-component set --name ENVIRONMENT_NAME --resource-group RESOURCE_GROUP_NAME --dapr-component-name pubsub --yaml "./pubsub.yaml"
7880
```
7981

8082
The `pubsub.yaml` spec will be scoped to the dapr-enabled container apps with app ids `publisher-app` and `subscriber-app`.
@@ -98,7 +100,9 @@ The `pubsub.yaml` spec will be scoped to the dapr-enabled container apps with ap
98100
99101
# [Bicep](#tab/bicep)
100102
101-
This resource defines a Dapr component called `dapr-pubsub` via Bicep. The Dapr component is defined as a child resource of your Container Apps environment. The `dapr-pubsub` component is scoped to the Dapr-enabled container apps with app ids `publisher-app` and `subscriber-app`:
103+
This resource defines a Dapr component called `dapr-pubsub` via Bicep. The Dapr component is defined as a child resource of your Container Apps environment. To define multiple components, you can add a `daprComponent` resource for each Dapr component.
104+
105+
The `dapr-pubsub` component is scoped to the Dapr-enabled container apps with app ids `publisher-app` and `subscriber-app`:
102106

103107
```bicep
104108
resource daprComponent 'daprComponents@2022-01-01-preview' = {
@@ -129,7 +133,9 @@ resource daprComponent 'daprComponents@2022-01-01-preview' = {
129133

130134
# [ARM](#tab/arm)
131135

132-
This resource defines a Dapr component called `dapr-pubsub` via ARM. The Dapr component is defined as a child resource of your Container Apps environment. The `dapr-pubsub` component will be scoped to the Dapr-enabled container apps with app ids `publisher-app` and `subscriber-app`:
136+
A Dapr component is defined as a child resource of your Container Apps environment. To define multiple components, you can add a `daprComponent` resource for each Dapr component.
137+
138+
This resource defines a Dapr component called `dapr-pubsub` via ARM. The `dapr-pubsub` component will be scoped to the Dapr-enabled container apps with app ids `publisher-app` and `subscriber-app`:
133139

134140
```json
135141
{

articles/container-apps/microservices-dapr.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,8 @@ If you've changed the `STORAGE_ACCOUNT_CONTAINER` variable from its original val
182182

183183
Navigate to the directory in which you stored the *statestore.yaml* file and run the following command to configure the Dapr component in the Container Apps environment.
184184

185-
If you need to add multiple components, run the `az containerapp env dapr-component set` command multiple times to add each component.
185+
If you need to add multiple components, create a separate YAML file for each component and run the `az containerapp env dapr-component set` command multiple times to add each component. For more information about configuring Dapr components, see [Configure Dapr components](dapr-overview.md#configure-dapr-components).
186+
186187

187188
# [Bash](#tab/bash)
188189

0 commit comments

Comments
 (0)