Skip to content

Commit e218c48

Browse files
authored
Merge pull request #290953 from hhunter-ms/hh-192446
[Dapr/ACA] Rework tutorials
2 parents 187ab9c + ea65f32 commit e218c48

10 files changed

+375
-370
lines changed

articles/container-apps/TOC.yml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -258,15 +258,25 @@
258258
displayName: Developing with Dapr overview
259259
- name: Get started
260260
items:
261-
- name: Connect to Azure services via Dapr components
262-
href: dapr-component-connection.md
263-
- name: Enable Dapr
261+
- name: Deploy using Azure CLI
262+
href: microservices-dapr.md
263+
- name: Deploy using ARM or Bicep
264+
href: microservices-dapr-azure-resource-manager.md
265+
- name: Enable Dapr on an existing container app
264266
href: enable-dapr.md
265-
- name: Configure
267+
- name: Deploy using the Dapr extension for Azure Functions
268+
href: dapr-functions-extension.md
269+
- name: Components
266270
items:
267-
- name: Dapr components
271+
- name: Components overview
268272
href: dapr-components.md
269-
- name: Dapr component resiliency (preview)
273+
- name: Connect to Azure or third-party services
274+
href: dapr-component-connect-services.md
275+
- name: Connect to Azure services via Azure portal
276+
href: dapr-component-connection.md
277+
- name: Configure
278+
items:
279+
- name: Set up Dapr resiliency policies (preview)
270280
href: dapr-component-resiliency.md
271281
- name: Scale Dapr apps with KEDA using Bicep
272282
href: dapr-keda-scaling.md
@@ -280,12 +290,6 @@
280290
href: microservices-dapr-bindings.md
281291
- name: Microservices communication using Dapr Service Invocation
282292
href: microservices-dapr-service-invoke.md
283-
- name: Deploy using the Dapr extension for Azure Functions
284-
href: dapr-functions-extension.md
285-
- name: Deploy using Azure CLI
286-
href: microservices-dapr.md
287-
- name: Deploy using ARM or Bicep
288-
href: microservices-dapr-azure-resource-manager.md
289293
- name: Networking, ingress, and network security
290294
items:
291295
- name: Architecture overview
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
---
2+
title: Connect to other Azure or third-party services via Dapr components
3+
description: Learn more about connecting Dapr components with Azure and external services.
4+
ms.author: hannahhunter
5+
author: hhunter-ms
6+
ms.service: azure-container-apps
7+
ms.custom: build-2023
8+
ms.topic: conceptual
9+
ms.date: 12/10/2024
10+
---
11+
12+
# Connect to other Azure or third-party services via Dapr components
13+
14+
Securely establish connections to Azure and third-party services for Dapr components using managed identity or Azure Key Vault secret stores.
15+
16+
Before getting started, [learn more about the offered support for Dapr components.][supported-dapr-components]
17+
18+
## Recommendations
19+
20+
Whenever possible, it's recommended that you use Azure components that provide managed identity support for the most secure connection. Use Azure Key Vault secret stores *only* when managed identity authentication isn't supported.
21+
22+
| Service type | Recommendation |
23+
| ------------ | -------------- |
24+
| Azure component with managed identity support | [Use the managed identity flow (recommended)](#using-managed-identity-recommended) |
25+
| Azure component without managed identity support | [Use an Azure Key Vault secret store](#azure-key-vault-secret-stores) |
26+
| Non-Azure components | [Use an Azure Key Vault secret store](#azure-key-vault-secret-stores) |
27+
28+
29+
## Using managed identity (recommended)
30+
31+
For Azure-hosted services, Dapr can use [the managed identity of the scoped container apps][aca-managed-id] to authenticate to the backend service provider. When using managed identity, you don't need to include secret information in a component manifest. **Using managed identity is recommended** as it eliminates storage of sensitive input in components and doesn't require managing a secret store.
32+
33+
> [!NOTE]
34+
> The `azureClientId` metadata field (the client ID of the managed identity) is **required** for any component authenticating with user-assigned managed identity.
35+
36+
## Using a Dapr secret store component reference
37+
38+
When you create Dapr components for non-Entra ID enabled services or components that don't support managed identity authentication, certain metadata fields require sensitive input values. For this approach, retrieve these secrets by referencing an existing Dapr secret store component that securely accesses secret information.
39+
40+
To set up a reference:
41+
42+
1. [Create a Dapr secret store component using the Azure Container Apps schema.](#creating-a-dapr-secret-store-component) The component type for all supported Dapr secret stores begins with `secretstores.`.
43+
1. [Create extra components (as needed) which reference the Dapr secret store component](#referencing-dapr-secret-store-components) you created to retrieve the sensitive metadata input.
44+
45+
### Creating a Dapr secret store component
46+
47+
When creating a secret store component in Azure Container Apps, you can provide sensitive information in the metadata section in either of the following ways:
48+
49+
- [For an **Azure Key Vault secret store**,](#using-managed-identity-recommended) use managed identity to establish the connection.
50+
- [For **non-Azure secret stores**,](#platform-managed-kubernetes-secrets) use platform-managed Kubernetes secrets that are defined directly as part of the component manifest.
51+
52+
#### Azure Key Vault secret stores
53+
54+
The following component schema showcases the simplest possible secret store configuration using an Azure Key Vault secret store. `publisher-app` and `subscriber-app` are configured to both have a system or user-assigned managed identity with appropriate permissions on the Azure Key Vault instance.
55+
56+
```yaml
57+
componentType: secretstores.azure.keyvault
58+
version: v1
59+
metadata:
60+
- name: vaultName
61+
value: [your_keyvault_name]
62+
- name: azureEnvironment
63+
value: "AZUREPUBLICCLOUD"
64+
- name: azureClientId # Only required for authenticating user-assigned managed identity
65+
value: [your_managed_identity_client_id]
66+
scopes:
67+
- publisher-app
68+
- subscriber-app
69+
```
70+
71+
#### Platform-managed Kubernetes secrets
72+
73+
As an alternative to Kubernetes secrets, Local environment variables, and Local file Dapr secret stores, Azure Container Apps provides a platform-managed approach for creating and leveraging Kubernetes secrets. This approach can be used to connect to non-Azure services or in dev/test scenarios for quickly deploying components via the CLI without setting up a secret store or managed identity.
74+
75+
This component configuration defines the sensitive value as a secret parameter that can be referenced from the metadata section.
76+
77+
```yaml
78+
componentType: secretstores.azure.keyvault
79+
version: v1
80+
metadata:
81+
- name: vaultName
82+
value: [your_keyvault_name]
83+
- name: azureEnvironment
84+
value: "AZUREPUBLICCLOUD"
85+
- name: azureTenantId
86+
value: "[your_tenant_id]"
87+
- name: azureClientId
88+
value: "[your_client_id]"
89+
- name: azureClientSecret
90+
secretRef: azClientSecret
91+
secrets:
92+
- name: azClientSecret
93+
value: "[your_client_secret]"
94+
scopes:
95+
- publisher-app
96+
- subscriber-app
97+
```
98+
99+
### Referencing Dapr secret store components
100+
101+
Once you [create a Dapr secret store using one of the previous approaches](#creating-a-dapr-secret-store-component), you can reference that secret store from other Dapr components in the same environment. The following example demonstrates using Entra ID authentication.
102+
103+
```yaml
104+
componentType: pubsub.azure.servicebus.queue
105+
version: v1
106+
secretStoreComponent: "[your_secret_store_name]"
107+
metadata:
108+
- name: namespaceName
109+
# Required when using Azure Authentication.
110+
# Must be a fully-qualified domain name
111+
value: "[your_servicebus_namespace.servicebus.windows.net]"
112+
- name: azureTenantId
113+
value: "[your_tenant_id]"
114+
- name: azureClientId
115+
value: "[your_client_id]"
116+
- name: azureClientSecret
117+
secretRef: azClientSecret
118+
scopes:
119+
- publisher-app
120+
- subscriber-app
121+
```
122+
123+
## Next steps
124+
125+
[Learn how to set Dapr component resiliency.][dapr-resiliency]
126+
127+
<!-- Links Internal -->
128+
129+
[dapr-component-connection]: ./dapr-component-connection.md
130+
[dapr-keda]: ./dapr-keda-scaling.md
131+
[aca-managed-id]: ./managed-identity.md
132+
[dapr-resiliency]: ./dapr-component-resiliency.md
133+
[dapr-components-connect-services]: ./dapr-component-connect-services.md
134+
[supported-dapr-components]: ./dapr-overview.md#dapr-components
135+
[dapr-component]: ./dapr-components.md
136+
137+
<!-- Links External -->
138+
139+
[dapr-component-spec]: https://docs.dapr.io/reference/resource-specs/

articles/container-apps/dapr-component-connection.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ ms.author: hannahhunter
66
ms.reviewer: nickgreenf
77
ms.service: azure-container-apps
88
ms.topic: how-to
9-
ms.date: 08/02/2024
9+
ms.date: 12/11/2024
1010
ms.custom: template-tutorial, service-connector, build-2023, engagement
1111
---
1212

1313
# Connect to Azure services via Dapr components in the Azure portal
1414

15-
You can easily connect Dapr APIs to backing Azure services using a combination of [Service Connector](../service-connector/overview.md) and [Dapr](https://docs.dapr.io/). This feature creates Dapr components on your behalf with valid metadata and authenticated identity to access the Azure service.
15+
You can easily connect Dapr APIs to [backing Azure services](./dapr-overview.md#dapr-components) using a combination of [Service Connector](../service-connector/overview.md) and [Dapr](https://docs.dapr.io/). This feature creates Dapr components on your behalf with valid metadata and authenticated identity to access the Azure service.
1616

17-
In this guide, you'll connect Dapr Pub/Sub API to an Azure Service Bus by:
17+
In this guide, you connect Dapr Pub/Sub API to an Azure Service Bus by:
1818
> [!div class="checklist"]
1919
> - Select pub/sub as the API
2020
> - Specify Azure Service Bus as the service and required properties like namespace, queue name, and identity
@@ -45,7 +45,7 @@ For example, for a pub/sub Azure Service Bus component, you'll start with the fo
4545

4646
| Field | Example | Description |
4747
| ----- | ------- | ----------- |
48-
| Component name | mycomponent | Enter a name for your Dapr component. The name must match the component referenced in your application code. |
48+
| Component name | `mycomponent` | Enter a name for your Dapr component. The name must match the component referenced in your application code. |
4949
| Building block | Pub/sub | Select the [building block/API](https://docs.dapr.io/developing-applications/building-blocks/) for your component from the drop-down. |
5050
| Component type | Service Bus | Select a component type from the drop-down. |
5151

@@ -54,9 +54,9 @@ The component creation pane populates with different fields depending on the bui
5454
| Field | Example | Description |
5555
| ----- | ------- | ----------- |
5656
| Subscription | My subscription | Select your Azure subscription |
57-
| Namespace | mynamespace | Select the Service Bus namespace |
57+
| Namespace | `mynamespace` | Select the Service Bus namespace |
5858
| Authentication | User assigned managed identity | Select the subscription that contains the component you're looking for. Recommended: User assigned managed identity. |
59-
| User assigned managed identity | testidentity | Select an existing identity from the drop-down. If you don’t already have one, you can create a new managed identity client ID. |
59+
| User assigned managed identity | `testidentity` | Select an existing identity from the drop-down. If you don’t already have one, you can create a new managed identity client ID. |
6060

6161
:::image type="content" source="media/dapr-component-connection/add-pubsub-component.png" alt-text="Screenshot of the Azure platform showing the Basics tab of adding a Dapr Pub/sub component.":::
6262

@@ -101,10 +101,10 @@ You can then check the YAML/Bicep artifact into a repo and recreate it outside o
101101

102102
## Next steps
103103

104-
[Enable Dapr on your container apps.](./enable-dapr.md)
104+
[Learn how to set Dapr component resiliency.](./dapr-component-resiliency.md)
105105

106106
## Related links
107107

108108
Learn more about:
109109
- [Using Dapr with Azure Container Apps](./dapr-overview.md)
110-
- [Connecting to cloud services using Service Connector](./service-connector.md)
110+
- [Connecting to cloud services using Service Connector](./service-connector.md)

articles/container-apps/dapr-components.md

Lines changed: 6 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: hhunter-ms
66
ms.service: azure-container-apps
77
ms.custom: build-2023
88
ms.topic: conceptual
9-
ms.date: 09/23/2024
9+
ms.date: 12/03/2024
1010
---
1111

1212
# Dapr components in Azure Container Apps
@@ -17,7 +17,7 @@ Dapr components in container apps are environment-level resources that:
1717

1818
- Can provide a pluggable abstraction model for connecting to supporting external services.
1919
- Can be shared across container apps or scoped to specific container apps.
20-
- Can use Dapr secrets to securely retrieve configuration metadata.
20+
- Can use [Dapr secrets][dapr-components-connect-services] to securely retrieve configuration metadata.
2121

2222
In this guide, you learn how to configure Dapr components for your Azure Container Apps services.
2323

@@ -71,110 +71,7 @@ scopes:
7171
```
7272

7373
> [!NOTE]
74-
> Dapr component scopes correspond to the Dapr application ID of a container app, not the container app name.
75-
76-
## Connecting to external services via Dapr
77-
78-
There are a few approaches supported in container apps to securely establish connections to external services for Dapr components.
79-
80-
1. [Using managed identity](#using-managed-identity)
81-
1. Using a Dapr secret store component reference by creating either:
82-
- [An Azure Key Vault secret store](#azure-key-vault-secret-stores), which uses managed identity, or
83-
- [Platform-Managed Kubernetes secrets](#platform-managed-kubernetes-secrets)
84-
85-
### Using managed identity
86-
87-
For Azure-hosted services, Dapr can use [the managed identity of the scoped container apps][aca-managed-id] to authenticate to the backend service provider. When using managed identity, you don't need to include secret information in a component manifest. Using managed identity is preferred as it eliminates storage of sensitive input in components and doesn't require managing a secret store.
88-
89-
> [!NOTE]
90-
> The `azureClientId` metadata field (the client ID of the managed identity) is **required** for any component authenticating with user-assigned managed identity.
91-
92-
### Using a Dapr secret store component reference
93-
94-
When you create Dapr components for non-Entra ID enabled services, certain metadata fields require sensitive input values. The recommended approach for retrieving these secrets is to reference an existing Dapr secret store component that securely accesses secret information.
95-
96-
To set up a reference:
97-
98-
1. [Create a Dapr secret store component using the Azure Container Apps schema.](#creating-a-dapr-secret-store-component) The component type for all supported Dapr secret stores begins with `secretstores.`.
99-
1. [Create extra components (as needed) which reference the Dapr secret store component](#referencing-dapr-secret-store-components) you created to retrieve the sensitive metadata input.
100-
101-
#### Creating a Dapr secret store component
102-
103-
When creating a secret store component in Azure Container Apps, you can provide sensitive information in the metadata section in either of the following ways:
104-
105-
- [For an **Azure Key Vault secret store**,](#using-managed-identity) use managed identity to establish the connection.
106-
- [For **non-Azure secret stores**,](#platform-managed-kubernetes-secrets) use platform-managed Kubernetes secrets that are defined directly as part of the component manifest.
107-
108-
##### Azure Key Vault secret stores
109-
110-
The following component showcases the simplest possible secret store configuration using an Azure Key Vault secret store. In this example, publisher and subscriber applications are configured to both have a system or user-assigned managed identity with appropriate permissions on the Azure Key Vault instance.
111-
112-
```yaml
113-
componentType: secretstores.azure.keyvault
114-
version: v1
115-
metadata:
116-
- name: vaultName
117-
value: [your_keyvault_name]
118-
- name: azureEnvironment
119-
value: "AZUREPUBLICCLOUD"
120-
- name: azureClientId # Only required for authenticating user-assigned managed identity
121-
value: [your_managed_identity_client_id]
122-
scopes:
123-
- publisher-app
124-
- subscriber-app
125-
```
126-
127-
##### Platform-managed Kubernetes secrets
128-
129-
Kubernetes secrets, Local environment variables, and Local file Dapr secret stores aren't supported in Azure Container Apps. As an alternative for the upstream Dapr default Kubernetes secret store, Azure Container Apps provides a platform-managed approach for creating and leveraging Kubernetes secrets.
130-
131-
This component configuration defines the sensitive value as a secret parameter that can be referenced from the metadata section. This approach can be used to connect to non-Azure services or in dev/test scenarios for quickly deploying components via the CLI without setting up a secret store or managed identity.
132-
133-
```yaml
134-
componentType: secretstores.azure.keyvault
135-
version: v1
136-
metadata:
137-
- name: vaultName
138-
value: [your_keyvault_name]
139-
- name: azureEnvironment
140-
value: "AZUREPUBLICCLOUD"
141-
- name: azureTenantId
142-
value: "[your_tenant_id]"
143-
- name: azureClientId
144-
value: "[your_client_id]"
145-
- name: azureClientSecret
146-
secretRef: azClientSecret
147-
secrets:
148-
- name: azClientSecret
149-
value: "[your_client_secret]"
150-
scopes:
151-
- publisher-app
152-
- subscriber-app
153-
```
154-
155-
#### Referencing Dapr secret store components
156-
157-
Once you [create a Dapr secret store using one of the previous approaches](#creating-a-dapr-secret-store-component), you can reference that secret store from other Dapr components in the same environment. The following example demonstrates using Entra ID authentication.
158-
159-
```yaml
160-
componentType: pubsub.azure.servicebus.queue
161-
version: v1
162-
secretStoreComponent: "[your_secret_store_name]"
163-
metadata:
164-
- name: namespaceName
165-
# Required when using Azure Authentication.
166-
# Must be a fully-qualified domain name
167-
value: "[your_servicebus_namespace.servicebus.windows.net]"
168-
- name: azureTenantId
169-
value: "[your_tenant_id]"
170-
- name: azureClientId
171-
value: "[your_client_id]"
172-
- name: azureClientSecret
173-
secretRef: azClientSecret
174-
scopes:
175-
- publisher-app
176-
- subscriber-app
177-
```
74+
> Dapr component scopes provide better security measures and correspond to the Dapr application ID of a container app, not the container app name.
17875

17976
## Component examples
18077

@@ -277,16 +174,17 @@ This resource defines a Dapr component called `dapr-pubsub` via ARM.
277174

278175
## Next steps
279176

280-
[Learn how to set Dapr component resiliency.][dapr-resiliency]
177+
[Learn how to connect to Azure and external services via Dapr components.][dapr-components-connect-services]
281178

282179
<!-- Links Internal -->
283180

284181
[dapr-component-connection]: ./dapr-component-connection.md
285182
[dapr-keda]: ./dapr-keda-scaling.md
286183
[aca-managed-id]: ./managed-identity.md
287184
[dapr-resiliency]: ./dapr-component-resiliency.md
185+
[dapr-components-connect-services]: ./dapr-component-connect-services.md
186+
[dapr-component]: ./dapr-overview.md#dapr-components
288187

289188
<!-- Links External -->
290189

291-
[dapr-component]: https://docs.dapr.io/concepts/components-concept/
292190
[dapr-component-spec]: https://docs.dapr.io/reference/resource-specs/

0 commit comments

Comments
 (0)