From 2ac4e27094713f8345e6e624b4af5587a95df8f4 Mon Sep 17 00:00:00 2001 From: Fernando Rocha Date: Tue, 14 Jan 2025 09:12:28 -0800 Subject: [PATCH 01/16] Including EKS Pod Identity information Signed-off-by: Fernando Rocha --- .../integrations/AWS/authenticating-aws.md | 136 +++++++++++++++++- 1 file changed, 132 insertions(+), 4 deletions(-) diff --git a/daprdocs/content/en/developing-applications/integrations/AWS/authenticating-aws.md b/daprdocs/content/en/developing-applications/integrations/AWS/authenticating-aws.md index f11565ceb59..9984805ac7e 100644 --- a/daprdocs/content/en/developing-applications/integrations/AWS/authenticating-aws.md +++ b/daprdocs/content/en/developing-applications/integrations/AWS/authenticating-aws.md @@ -34,10 +34,136 @@ In production scenarios, it is recommended to use a solution such as: If running on AWS EKS, you can [link an IAM role to a Kubernetes service account](https://docs.aws.amazon.com/eks/latest/userguide/create-service-account-iam-policy-and-role.html), which your pod can use. -All of these solutions solve the same problem: They allow the Dapr runtime process (or sidecar) to retrive credentials dynamically, so that explicit credentials aren't needed. This provides several benefits, such as automated key rotation, and avoiding having to manage secrets. +All of these solutions solve the same problem: They allow the Dapr runtime process (or sidecar) to retrieve credentials dynamically, so that explicit credentials aren't needed. This provides several benefits, such as automated key rotation, and avoiding having to manage secrets. Both Kiam and Kube2IAM work by intercepting calls to the [instance metadata service](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html). +## Setting Up Dapr with AWS EKS Pod Identity + +This section provides a detailed walkthrough for setting up Dapr with AWS EKS Pod Identity for accessing AWS services. + +### Prerequisites + +- AWS CLI configured with appropriate permissions +- kubectl installed +- eksctl installed +- Docker installed and configured +- A Docker Hub account or another container registry + +### Create EKS Cluster and install Dapr + +Follow the official Dapr documentation for setting up an EKS cluster and installing Dapr: +[Set up an Elastic Kubernetes Service (EKS) cluster](https://docs.dapr.io/operations/hosting/kubernetes/cluster/setup-eks/) + +### Create IAM Role and Enable Pod Identity + +1. Create IAM policy for AWS service access (example shown for a generic AWS service): + +```bash +aws iam create-policy \ + --policy-name dapr-service-policy \ + --policy-document '{ + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "SERVICE_NAME:ACTION1", + "SERVICE_NAME:ACTION2" + ], + "Resource": "arn:aws:SERVICE_NAME:YOUR_AWS_REGION:YOUR_ACCOUNT_ID:resource/*" + } + ] + }' +``` + +2. Create IAM role with Pod Identity trust relationship: + +```bash +aws iam create-role \ + --role-name dapr-pod-identity-role \ + --assume-role-policy-document '{ + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "Service": "pods.eks.amazonaws.com" + }, + "Action": [ + "sts:AssumeRole", + "sts:TagSession" + ] + } + ] + }' +``` + +3. Attach the policy to the role: + +```bash +aws iam attach-role-policy \ + --role-name dapr-pod-identity-role \ + --policy-arn arn:aws:iam::YOUR_ACCOUNT_ID:policy/dapr-service-policy +``` + +### Create Test Resources + +1. Create namespace: + +```bash +kubectl create namespace dapr-test +``` + +2. Create service account: + +```bash +kubectl apply -f k8s-config/service-account.yaml +``` + +3. Create Pod Identity association: + +```bash +eksctl create podidentityassociation \ + --cluster [your-cluster-name] \ + --namespace dapr-test \ + --region [your-aws-region] \ + --service-account-name dapr-test-sa \ + --role-arn arn:aws:iam::YOUR_ACCOUNT_ID:role/dapr-pod-identity-role +``` + +4. Create Dapr component for your AWS service: + +```bash +kubectl apply -f components/aws-component.yaml +``` + +### Troubleshooting + +#### Authentication Issues + +If you see "You must be logged in to the server (Unauthorized)", update your kubeconfig: + +```bash +aws eks update-kubeconfig --region [your-aws-region] --name [your-cluster-name] +``` + +#### Pod Identity Issues + +Verify Pod Identity association: + +```bash +eksctl get podidentityassociation --cluster [your-cluster-name] --region [your-aws-region] +``` + +#### Dapr Component Issues + +Check Dapr sidecar logs: + +```bash +kubectl logs -n dapr-test -l app=test-app -c daprd +``` + ### Use an instance profile when running in stand-alone mode on AWS EC2 If running Dapr directly on an AWS EC2 instance in stand-alone mode, you can use instance profiles. @@ -84,7 +210,6 @@ On Windows, the environment variable needs to be set before starting the `dapr` {{< /tabs >}} - ### Authenticate to AWS if using AWS SSO based profiles If you authenticate to AWS using [AWS SSO](https://aws.amazon.com/single-sign-on/), some AWS SDKs (including the Go SDK) don't yet support this natively. There are several utilities you can use to "bridge the gap" between AWS SSO-based credentials and "legacy" credentials, such as: @@ -111,7 +236,7 @@ AWS_PROFILE=myprofile awshelper daprd... {{% codetab %}} -On Windows, the environment variable needs to be set before starting the `awshelper` command, doing it inline (like in Linxu/MacOS) is not supported. +On Windows, the environment variable needs to be set before starting the `awshelper` command, doing it inline (like in Linux/MacOS) is not supported. {{% /codetab %}} @@ -123,4 +248,7 @@ On Windows, the environment variable needs to be set before starting the `awshel ## Related links -For more information, see [how the AWS SDK (which Dapr uses) handles credentials](https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials). +- For more information, see [how the AWS SDK (which Dapr uses) handles credentials](https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials). +- [EKS Pod Identity Documentation](https://docs.aws.amazon.com/eks/latest/userguide/pod-identities.html) +- [AWS SDK Credentials Configuration](https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials) +- [Set up an Elastic Kubernetes Service (EKS) cluster](https://docs.dapr.io/operations/hosting/kubernetes/cluster/setup-eks/) From 4508e63a5416a3c78a043745751ab63480b7aa21 Mon Sep 17 00:00:00 2001 From: Fernando Rocha Date: Mon, 20 Jan 2025 20:23:55 -0800 Subject: [PATCH 02/16] Including EKS Pod Identity Changes and fixing typo in EKS sample Signed-off-by: Fernando Rocha --- .../integrations/AWS/authenticating-aws.md | 126 +----------------- .../hosting/kubernetes/cluster/setup-eks.md | 2 +- 2 files changed, 4 insertions(+), 124 deletions(-) diff --git a/daprdocs/content/en/developing-applications/integrations/AWS/authenticating-aws.md b/daprdocs/content/en/developing-applications/integrations/AWS/authenticating-aws.md index 9984805ac7e..a0ca55d42a0 100644 --- a/daprdocs/content/en/developing-applications/integrations/AWS/authenticating-aws.md +++ b/daprdocs/content/en/developing-applications/integrations/AWS/authenticating-aws.md @@ -38,131 +38,11 @@ All of these solutions solve the same problem: They allow the Dapr runtime proce Both Kiam and Kube2IAM work by intercepting calls to the [instance metadata service](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html). -## Setting Up Dapr with AWS EKS Pod Identity +### Setting Up Dapr with AWS EKS Pod Identity -This section provides a detailed walkthrough for setting up Dapr with AWS EKS Pod Identity for accessing AWS services. +EKS Pod Identities provide the ability to manage credentials for your applications, similar to the way that Amazon EC2 instance profiles provide credentials to Amazon EC2 instances. Instead of creating and distributing your AWS credentials to the containers or using the Amazon EC2 instance’s role, you associate an IAM role with a Kubernetes service account and configure your Pods to use the service account. -### Prerequisites - -- AWS CLI configured with appropriate permissions -- kubectl installed -- eksctl installed -- Docker installed and configured -- A Docker Hub account or another container registry - -### Create EKS Cluster and install Dapr - -Follow the official Dapr documentation for setting up an EKS cluster and installing Dapr: -[Set up an Elastic Kubernetes Service (EKS) cluster](https://docs.dapr.io/operations/hosting/kubernetes/cluster/setup-eks/) - -### Create IAM Role and Enable Pod Identity - -1. Create IAM policy for AWS service access (example shown for a generic AWS service): - -```bash -aws iam create-policy \ - --policy-name dapr-service-policy \ - --policy-document '{ - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Allow", - "Action": [ - "SERVICE_NAME:ACTION1", - "SERVICE_NAME:ACTION2" - ], - "Resource": "arn:aws:SERVICE_NAME:YOUR_AWS_REGION:YOUR_ACCOUNT_ID:resource/*" - } - ] - }' -``` - -2. Create IAM role with Pod Identity trust relationship: - -```bash -aws iam create-role \ - --role-name dapr-pod-identity-role \ - --assume-role-policy-document '{ - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Allow", - "Principal": { - "Service": "pods.eks.amazonaws.com" - }, - "Action": [ - "sts:AssumeRole", - "sts:TagSession" - ] - } - ] - }' -``` - -3. Attach the policy to the role: - -```bash -aws iam attach-role-policy \ - --role-name dapr-pod-identity-role \ - --policy-arn arn:aws:iam::YOUR_ACCOUNT_ID:policy/dapr-service-policy -``` - -### Create Test Resources - -1. Create namespace: - -```bash -kubectl create namespace dapr-test -``` - -2. Create service account: - -```bash -kubectl apply -f k8s-config/service-account.yaml -``` - -3. Create Pod Identity association: - -```bash -eksctl create podidentityassociation \ - --cluster [your-cluster-name] \ - --namespace dapr-test \ - --region [your-aws-region] \ - --service-account-name dapr-test-sa \ - --role-arn arn:aws:iam::YOUR_ACCOUNT_ID:role/dapr-pod-identity-role -``` - -4. Create Dapr component for your AWS service: - -```bash -kubectl apply -f components/aws-component.yaml -``` - -### Troubleshooting - -#### Authentication Issues - -If you see "You must be logged in to the server (Unauthorized)", update your kubeconfig: - -```bash -aws eks update-kubeconfig --region [your-aws-region] --name [your-cluster-name] -``` - -#### Pod Identity Issues - -Verify Pod Identity association: - -```bash -eksctl get podidentityassociation --cluster [your-cluster-name] --region [your-aws-region] -``` - -#### Dapr Component Issues - -Check Dapr sidecar logs: - -```bash -kubectl logs -n dapr-test -l app=test-app -c daprd -``` +To see a comprehensive example on how to authorize pod access to AWS Secrets Manager from EKS using AWS EKS Pod Identity, [follow the sample in this repository](https://github.com/dapr/samples/tree/master/dapr-eks-podidentity). ### Use an instance profile when running in stand-alone mode on AWS EC2 diff --git a/daprdocs/content/en/operations/hosting/kubernetes/cluster/setup-eks.md b/daprdocs/content/en/operations/hosting/kubernetes/cluster/setup-eks.md index 6a87484cc36..b7e8a0f8153 100644 --- a/daprdocs/content/en/operations/hosting/kubernetes/cluster/setup-eks.md +++ b/daprdocs/content/en/operations/hosting/kubernetes/cluster/setup-eks.md @@ -66,7 +66,7 @@ This guide walks you through installing an Elastic Kubernetes Service (EKS) clus 1. Create the cluster by running the following command: ```bash - eksctl create cluster -f cluster.yaml + eksctl create cluster -f cluster-config.yaml ``` 1. Verify the kubectl context: From c7fab1595965a329716d80e0c6dfab79afeb85df Mon Sep 17 00:00:00 2001 From: Fernando Rocha Date: Tue, 21 Jan 2025 10:17:42 -0800 Subject: [PATCH 03/16] Update daprdocs/content/en/developing-applications/integrations/AWS/authenticating-aws.md Co-authored-by: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com> Signed-off-by: Fernando Rocha --- .../integrations/AWS/authenticating-aws.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daprdocs/content/en/developing-applications/integrations/AWS/authenticating-aws.md b/daprdocs/content/en/developing-applications/integrations/AWS/authenticating-aws.md index a0ca55d42a0..3439526f3e3 100644 --- a/daprdocs/content/en/developing-applications/integrations/AWS/authenticating-aws.md +++ b/daprdocs/content/en/developing-applications/integrations/AWS/authenticating-aws.md @@ -116,7 +116,7 @@ AWS_PROFILE=myprofile awshelper daprd... {{% codetab %}} -On Windows, the environment variable needs to be set before starting the `awshelper` command, doing it inline (like in Linux/MacOS) is not supported. +On Windows, the environment variable needs to be set before starting the `awshelper` command; doing it inline (like in Linux/MacOS) is not supported. {{% /codetab %}} From 257c47d11358c6b627d8c1de7a51f0cc13854510 Mon Sep 17 00:00:00 2001 From: Elias Keis <13063245+elKei24@users.noreply.github.com> Date: Mon, 20 Jan 2025 15:26:37 +0100 Subject: [PATCH 04/16] Add section about custom properties Signed-off-by: Elias Keis <13063245+elKei24@users.noreply.github.com> --- .../supported-pubsub/setup-azure-eventhubs.md | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-azure-eventhubs.md b/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-azure-eventhubs.md index 713bdb1cbb7..bd4a881edee 100644 --- a/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-azure-eventhubs.md +++ b/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-azure-eventhubs.md @@ -195,6 +195,44 @@ Entity management is only possible when using [Microsoft Entra ID Authentication > Dapr passes the name of the consumer group to the Event Hub, so this is not supplied in the metadata. +## Receiving custom properties + +By default, Dapr does not forward [custom properties](https://learn.microsoft.com/en-us/azure/event-hubs/add-custom-data-event). However, by setting the subscription metadata `requireAllProperties` to `"true"`, you can receive custom properties as HTTP headers. + +```yaml +apiVersion: dapr.io/v2alpha1 +kind: Subscription +metadata: + name: order-pub-sub +spec: + topic: orders + routes: + default: /checkout + pubsubname: order-pub-sub + metadata: + requireAllProperties: "true" +``` + +The same can be achieved using the Dapr SDK: + +{{< tabs ".NET" >}} + +{{% codetab %}} + +```csharp +[Topic("order-pub-sub", "orders")] +[TopicMetadata("requireAllProperties", "true")] +[HttpPost("checkout")] +public ActionResult Checkout(Order order, [FromHeader] int priority) +{ + return Ok(); +} +``` + +{{% /codetab %}} + +{{< /tabs >}} + ## Subscribing to Azure IoT Hub Events Azure IoT Hub provides an [endpoint that is compatible with Event Hubs](https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messages-read-builtin#read-from-the-built-in-endpoint), so the Azure Event Hubs pubsub component can also be used to subscribe to Azure IoT Hub events. From ab94590ea9a0d80ff4154f43e6d148f41d9f3359 Mon Sep 17 00:00:00 2001 From: Elias Keis <13063245+elKei24@users.noreply.github.com> Date: Tue, 21 Jan 2025 14:58:59 +0100 Subject: [PATCH 05/16] remove url localization (suggestion from code review) Co-authored-by: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com> Signed-off-by: Elias Keis <13063245+elKei24@users.noreply.github.com> --- .../supported-pubsub/setup-azure-eventhubs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-azure-eventhubs.md b/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-azure-eventhubs.md index bd4a881edee..f778c3824b6 100644 --- a/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-azure-eventhubs.md +++ b/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-azure-eventhubs.md @@ -197,7 +197,7 @@ Entity management is only possible when using [Microsoft Entra ID Authentication ## Receiving custom properties -By default, Dapr does not forward [custom properties](https://learn.microsoft.com/en-us/azure/event-hubs/add-custom-data-event). However, by setting the subscription metadata `requireAllProperties` to `"true"`, you can receive custom properties as HTTP headers. +By default, Dapr does not forward [custom properties](https://learn.microsoft.com/azure/event-hubs/add-custom-data-event). However, by setting the subscription metadata `requireAllProperties` to `"true"`, you can receive custom properties as HTTP headers. ```yaml apiVersion: dapr.io/v2alpha1 From 828c96b1274db069d4d6cdebfde0beb012bb5146 Mon Sep 17 00:00:00 2001 From: Fernando Rocha Date: Mon, 27 Jan 2025 10:32:51 -0800 Subject: [PATCH 06/16] Including .NET sample for subscriber, fixing parameter name on declarative subscription Signed-off-by: Fernando Rocha --- .../building-blocks/pubsub/pubsub-raw.md | 54 +++++++++++++++++-- 1 file changed, 50 insertions(+), 4 deletions(-) diff --git a/daprdocs/content/en/developing-applications/building-blocks/pubsub/pubsub-raw.md b/daprdocs/content/en/developing-applications/building-blocks/pubsub/pubsub-raw.md index 6e518fa963a..84475065068 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/pubsub/pubsub-raw.md +++ b/daprdocs/content/en/developing-applications/building-blocks/pubsub/pubsub-raw.md @@ -74,9 +74,54 @@ Dapr apps are also able to subscribe to raw events coming from existing pub/sub ### Programmatically subscribe to raw events -When subscribing programmatically, add the additional metadata entry for `rawPayload` so the Dapr sidecar automatically wraps the payloads into a CloudEvent that is compatible with current Dapr SDKs. +When subscribing programmatically, add the additional metadata entry for `rawPayload` - `isRawPayload` on .NET - so the Dapr sidecar automatically wraps the payloads into a CloudEvent that is compatible with current Dapr SDKs. -{{< tabs "Python" "PHP SDK" >}} +{{< tabs ".NET" "Python" "PHP SDK" >}} + +{{% codetab %}} + +```csharp +using System.Text.Json; +using System.Text.Json.Serialization; + + +var builder = WebApplication.CreateBuilder(args); +var app = builder.Build(); + +app.MapGet("/", () => "Subscriber API"); + +app.MapGet("/dapr/subscribe", () => +{ + var subscriptions = new[] + { + new + { + pubsubname = "pubsub", + topic = "messages", + route = "/messages", + metadata = new Dictionary + { + { "isRawPayload", "true" } + } + } + }; + return Results.Ok(subscriptions); +}); + +app.MapPost("/messages", async (HttpContext context) => +{ + using var reader = new StreamReader(context.Request.Body); + var json = await reader.ReadToEndAsync(); + + Console.WriteLine($"Raw message received: {json}"); + + return Results.Ok(); +}); + +app.Run(); +``` + +{{% /codetab %}} {{% codetab %}} @@ -151,7 +196,7 @@ spec: default: /dsstatus pubsubname: pubsub metadata: - rawPayload: "true" + isRawPayload: "true" scopes: - app1 - app2 @@ -161,4 +206,5 @@ scopes: - Learn more about [publishing and subscribing messages]({{< ref pubsub-overview.md >}}) - List of [pub/sub components]({{< ref supported-pubsub >}}) -- Read the [API reference]({{< ref pubsub_api.md >}}) \ No newline at end of file +- Read the [API reference]({{< ref pubsub_api.md >}}) +- Read the .NET sample on how to [consume Kafka messages without CloudEvents](https://github.com/dapr/samples/pubsub-raw-payload) \ No newline at end of file From bd9eb23110f43db5fa7f4304b0e4e945dd67f1dd Mon Sep 17 00:00:00 2001 From: Fernando Rocha Date: Thu, 30 Jan 2025 18:13:44 -0800 Subject: [PATCH 07/16] including .NET publisher example Signed-off-by: Fernando Rocha --- .../building-blocks/pubsub/pubsub-raw.md | 42 ++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/daprdocs/content/en/developing-applications/building-blocks/pubsub/pubsub-raw.md b/daprdocs/content/en/developing-applications/building-blocks/pubsub/pubsub-raw.md index 84475065068..6431b97cc5d 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/pubsub/pubsub-raw.md +++ b/daprdocs/content/en/developing-applications/building-blocks/pubsub/pubsub-raw.md @@ -20,7 +20,7 @@ Not using CloudEvents disables support for tracing, event deduplication per mess To disable CloudEvent wrapping, set the `rawPayload` metadata to `true` as part of the publishing request. This allows subscribers to receive these messages without having to parse the CloudEvent schema. -{{< tabs curl "Python SDK" "PHP SDK">}} +{{< tabs curl ".NET" "Python SDK" "PHP SDK">}} {{% codetab %}} ```bash @@ -28,6 +28,46 @@ curl -X "POST" http://localhost:3500/v1.0/publish/pubsub/TOPIC_A?metadata.rawPay ``` {{% /codetab %}} +{{% codetab %}} + +```csharp +using Dapr.Client; +using Shared; + +var builder = WebApplication.CreateBuilder(args); +builder.Services.AddControllers().AddDapr(); + +var app = builder.Build(); + +app.MapGet("/", () => "Publisher API"); + +app.MapPost("/publish", async (DaprClient daprClient) => +{ + var message = new Message( + Guid.NewGuid().ToString(), + $"Hello at {DateTime.UtcNow}", + DateTime.UtcNow + ); + + await daprClient.PublishEventAsync( + "pubsub", // pubsub name + "messages", // topic name + message, // message data + new Dictionary + { + { "rawPayload", "true" }, + { "content-type", "application/json" } + } + ); + + return Results.Ok(message); +}); + +app.Run(); +``` + +{{% /codetab %}} + {{% codetab %}} ```python from dapr.clients import DaprClient From 957d070225efa45f1ba21306b102194edc92ded0 Mon Sep 17 00:00:00 2001 From: salaboy Date: Mon, 3 Feb 2025 17:21:09 +0000 Subject: [PATCH 08/16] removing out-dated testcontainers integration Signed-off-by: salaboy --- .../integrations/Diagrid/_index.md | 7 ----- .../integrations/Diagrid/diagrid-conductor.md | 29 ------------------- .../integrations/Diagrid/test-containers.md | 21 -------------- 3 files changed, 57 deletions(-) delete mode 100644 daprdocs/content/en/developing-applications/integrations/Diagrid/_index.md delete mode 100644 daprdocs/content/en/developing-applications/integrations/Diagrid/diagrid-conductor.md delete mode 100644 daprdocs/content/en/developing-applications/integrations/Diagrid/test-containers.md diff --git a/daprdocs/content/en/developing-applications/integrations/Diagrid/_index.md b/daprdocs/content/en/developing-applications/integrations/Diagrid/_index.md deleted file mode 100644 index 0f0f87fac8f..00000000000 --- a/daprdocs/content/en/developing-applications/integrations/Diagrid/_index.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -type: docs -title: "Integrations with Diagrid" -linkTitle: "Diagrid" -weight: 1000 -description: "Dapr integrations with Diagrid" ---- \ No newline at end of file diff --git a/daprdocs/content/en/developing-applications/integrations/Diagrid/diagrid-conductor.md b/daprdocs/content/en/developing-applications/integrations/Diagrid/diagrid-conductor.md deleted file mode 100644 index c7504b56cc2..00000000000 --- a/daprdocs/content/en/developing-applications/integrations/Diagrid/diagrid-conductor.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -type: docs -title: "Conductor: Enterprise Dapr for Kubernetes" -linkTitle: "Diagrid Conductor" -description: "Automate operations, enforce security best practices, improve uptime, and elevate insights across your Dapr clusters" -weight: 2000 ---- - -
Diagrid Conductor diagram - -[Diagrid Conductor](https://www.diagrid.io/conductor) quickly and securely connects to all your Kubernetes clusters running Dapr and Daprized applications, delivering operational excellence, security & reliability and insights & collaboration. - -**Automated Dapr management** - -One-click installation, upgrade and patching of Dapr with selective application update and automated rollback means you’re always up to date. - -**Advisor: Discover and automate best practices** - -Be informed and apply production best practices, with continuous checking to prevent misconfigurations, increasing security, reliability and performance. - -**Resource usage reporting and tracking** - -By studying past resource behavior, recommend application resource optimization usage leading to significant cost savings on CPU and memory. - -**Application visualizer** - -The application graph facilitates collaboration between dev and ops by providing a dynamic overview of your services and infrastructure components. - -{{< button text="Learn more about Diagrid Conductor" link="https://www.diagrid.io/conductor" >}} diff --git a/daprdocs/content/en/developing-applications/integrations/Diagrid/test-containers.md b/daprdocs/content/en/developing-applications/integrations/Diagrid/test-containers.md deleted file mode 100644 index 1eabef6bf61..00000000000 --- a/daprdocs/content/en/developing-applications/integrations/Diagrid/test-containers.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -type: docs -title: "How to: Integrate using Testcontainers Dapr Module" -linkTitle: "Dapr Testcontainers" -weight: 3000 -description: "Use the Dapr Testcontainer module from your Java application" ---- - -You can use the Testcontainers Dapr Module provided by Diagrid to set up Dapr locally for your Java applications. Simply add the following dependency to your Maven project: - -```xml - - io.diagrid.dapr - testcontainers-dapr - 0.10.x - -``` - -[If you're using Spring Boot, you can also use the Spring Boot Starter.](https://github.com/diagridio/spring-boot-starter-dapr) - -{{< button text="Use the Testcontainers Dapr Module" link="https://github.com/diagridio/testcontainers-dapr" >}} \ No newline at end of file From b963ec0471b065b5001a13ee3faa0d866a6ad967 Mon Sep 17 00:00:00 2001 From: salaboy Date: Mon, 3 Feb 2025 17:28:41 +0000 Subject: [PATCH 09/16] Revert "removing out-dated testcontainers integration" This reverts commit e33d6cc75e26218ec71a199c2a869ec3ff3aa2c2. Signed-off-by: salaboy --- .../integrations/Diagrid/_index.md | 7 +++++ .../integrations/Diagrid/diagrid-conductor.md | 29 +++++++++++++++++++ .../integrations/Diagrid/test-containers.md | 21 ++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 daprdocs/content/en/developing-applications/integrations/Diagrid/_index.md create mode 100644 daprdocs/content/en/developing-applications/integrations/Diagrid/diagrid-conductor.md create mode 100644 daprdocs/content/en/developing-applications/integrations/Diagrid/test-containers.md diff --git a/daprdocs/content/en/developing-applications/integrations/Diagrid/_index.md b/daprdocs/content/en/developing-applications/integrations/Diagrid/_index.md new file mode 100644 index 00000000000..0f0f87fac8f --- /dev/null +++ b/daprdocs/content/en/developing-applications/integrations/Diagrid/_index.md @@ -0,0 +1,7 @@ +--- +type: docs +title: "Integrations with Diagrid" +linkTitle: "Diagrid" +weight: 1000 +description: "Dapr integrations with Diagrid" +--- \ No newline at end of file diff --git a/daprdocs/content/en/developing-applications/integrations/Diagrid/diagrid-conductor.md b/daprdocs/content/en/developing-applications/integrations/Diagrid/diagrid-conductor.md new file mode 100644 index 00000000000..c7504b56cc2 --- /dev/null +++ b/daprdocs/content/en/developing-applications/integrations/Diagrid/diagrid-conductor.md @@ -0,0 +1,29 @@ +--- +type: docs +title: "Conductor: Enterprise Dapr for Kubernetes" +linkTitle: "Diagrid Conductor" +description: "Automate operations, enforce security best practices, improve uptime, and elevate insights across your Dapr clusters" +weight: 2000 +--- + +
Diagrid Conductor diagram + +[Diagrid Conductor](https://www.diagrid.io/conductor) quickly and securely connects to all your Kubernetes clusters running Dapr and Daprized applications, delivering operational excellence, security & reliability and insights & collaboration. + +**Automated Dapr management** + +One-click installation, upgrade and patching of Dapr with selective application update and automated rollback means you’re always up to date. + +**Advisor: Discover and automate best practices** + +Be informed and apply production best practices, with continuous checking to prevent misconfigurations, increasing security, reliability and performance. + +**Resource usage reporting and tracking** + +By studying past resource behavior, recommend application resource optimization usage leading to significant cost savings on CPU and memory. + +**Application visualizer** + +The application graph facilitates collaboration between dev and ops by providing a dynamic overview of your services and infrastructure components. + +{{< button text="Learn more about Diagrid Conductor" link="https://www.diagrid.io/conductor" >}} diff --git a/daprdocs/content/en/developing-applications/integrations/Diagrid/test-containers.md b/daprdocs/content/en/developing-applications/integrations/Diagrid/test-containers.md new file mode 100644 index 00000000000..1eabef6bf61 --- /dev/null +++ b/daprdocs/content/en/developing-applications/integrations/Diagrid/test-containers.md @@ -0,0 +1,21 @@ +--- +type: docs +title: "How to: Integrate using Testcontainers Dapr Module" +linkTitle: "Dapr Testcontainers" +weight: 3000 +description: "Use the Dapr Testcontainer module from your Java application" +--- + +You can use the Testcontainers Dapr Module provided by Diagrid to set up Dapr locally for your Java applications. Simply add the following dependency to your Maven project: + +```xml + + io.diagrid.dapr + testcontainers-dapr + 0.10.x + +``` + +[If you're using Spring Boot, you can also use the Spring Boot Starter.](https://github.com/diagridio/spring-boot-starter-dapr) + +{{< button text="Use the Testcontainers Dapr Module" link="https://github.com/diagridio/testcontainers-dapr" >}} \ No newline at end of file From 1bdeedca49458eff45f6a98321c90b6084ce8cbc Mon Sep 17 00:00:00 2001 From: salaboy Date: Mon, 3 Feb 2025 17:29:20 +0000 Subject: [PATCH 10/16] removing only testcontainers Signed-off-by: salaboy --- .../integrations/Diagrid/test-containers.md | 21 ------------------- 1 file changed, 21 deletions(-) delete mode 100644 daprdocs/content/en/developing-applications/integrations/Diagrid/test-containers.md diff --git a/daprdocs/content/en/developing-applications/integrations/Diagrid/test-containers.md b/daprdocs/content/en/developing-applications/integrations/Diagrid/test-containers.md deleted file mode 100644 index 1eabef6bf61..00000000000 --- a/daprdocs/content/en/developing-applications/integrations/Diagrid/test-containers.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -type: docs -title: "How to: Integrate using Testcontainers Dapr Module" -linkTitle: "Dapr Testcontainers" -weight: 3000 -description: "Use the Dapr Testcontainer module from your Java application" ---- - -You can use the Testcontainers Dapr Module provided by Diagrid to set up Dapr locally for your Java applications. Simply add the following dependency to your Maven project: - -```xml - - io.diagrid.dapr - testcontainers-dapr - 0.10.x - -``` - -[If you're using Spring Boot, you can also use the Spring Boot Starter.](https://github.com/diagridio/spring-boot-starter-dapr) - -{{< button text="Use the Testcontainers Dapr Module" link="https://github.com/diagridio/testcontainers-dapr" >}} \ No newline at end of file From ab30b78037d14ccd45d9714d0d79d63cf157ae7f Mon Sep 17 00:00:00 2001 From: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com> Date: Mon, 3 Feb 2025 19:19:50 -0500 Subject: [PATCH 11/16] update website root (#4513) Signed-off-by: Hannah Hunter --- .github/workflows/website-root.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/website-root.yml b/.github/workflows/website-root.yml index 6bd00c5e6db..af72363b475 100644 --- a/.github/workflows/website-root.yml +++ b/.github/workflows/website-root.yml @@ -63,7 +63,7 @@ jobs: skip_app_build: true skip_deploy_on_missing_secrets: true - name: Upload Hugo artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: hugo_build path: ./daprdocs/public/ From 345a491977ec6020adacc528158a9e9cc17e92c1 Mon Sep 17 00:00:00 2001 From: Jorge Castillo Date: Tue, 4 Feb 2025 16:37:37 +0100 Subject: [PATCH 12/16] Update serviceinvocation-quickstart.md Updated csharp checkout code and the path for the apps, quickstart was missing Signed-off-by: Jorge Castillo --- .../serviceinvocation-quickstart.md | 50 +++++++++---------- 1 file changed, 23 insertions(+), 27 deletions(-) diff --git a/daprdocs/content/en/getting-started/quickstarts/serviceinvocation-quickstart.md b/daprdocs/content/en/getting-started/quickstarts/serviceinvocation-quickstart.md index 4bd2b237b71..ae5f9aa66e7 100644 --- a/daprdocs/content/en/getting-started/quickstarts/serviceinvocation-quickstart.md +++ b/daprdocs/content/en/getting-started/quickstarts/serviceinvocation-quickstart.md @@ -45,7 +45,7 @@ git clone https://github.com/dapr/quickstarts.git From the root of the Quickstart clone directory, navigate to the quickstart directory. ```bash -cd service_invocation/python/http +cd quickstarts/service_invocation/python/http ``` Install the dependencies for the `order-processor` and `checkout` apps: @@ -191,7 +191,7 @@ git clone https://github.com/dapr/quickstarts.git From the root of the Quickstart clone directory, navigate to the quickstart directory. ```bash -cd service_invocation/javascript/http +cd quickstarts/service_invocation/javascript/http ``` Install the dependencies for the `order-processor` and `checkout` apps: @@ -331,7 +331,7 @@ git clone https://github.com/dapr/quickstarts.git From the root of the Quickstart clone directory, navigate to the quickstart directory. ```bash -cd service_invocation/csharp/http +cd quickstarts/service_invocation/csharp/http ``` Install the dependencies for the `order-processor` and `checkout` apps: @@ -439,13 +439,11 @@ app.MapPost("/orders", (Order order) => In the Program.cs file for the `checkout` service, you'll notice there's no need to rewrite your app code to use Dapr's service invocation. You can enable service invocation by simply adding the `dapr-app-id` header, which specifies the ID of the target service. ```csharp -var client = new HttpClient(); -client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); +var client = DaprClient.CreateInvokeHttpClient(appId: "order-processor"); +var cts = new CancellationTokenSource(); -client.DefaultRequestHeaders.Add("dapr-app-id", "order-processor"); - -var response = await client.PostAsync($"{baseURL}/orders", content); - Console.WriteLine("Order passed: " + order); +var response = await client.PostAsJsonAsync("/orders", order, cts.Token); +Console.WriteLine("Order passed: " + order); ``` {{% /codetab %}} @@ -477,7 +475,7 @@ git clone https://github.com/dapr/quickstarts.git From the root of the Quickstart clone directory, navigate to the quickstart directory. ```bash -cd service_invocation/java/http +cd quickstarts/service_invocation/java/http ``` Install the dependencies for the `order-processor` and `checkout` apps: @@ -616,7 +614,7 @@ git clone https://github.com/dapr/quickstarts.git From the root of the Quickstart clone directory, navigate to the quickstart directory. ```bash -cd service_invocation/go/http +cd quickstarts/service_invocation/go/http ``` Install the dependencies for the `order-processor` and `checkout` apps: @@ -765,7 +763,7 @@ In a terminal window, from the root of the Quickstart clone directory navigate to `order-processor` directory. ```bash -cd service_invocation/python/http/order-processor +cd quickstarts/service_invocation/python/http/order-processor ``` Install the dependencies and build the application: @@ -800,7 +798,7 @@ In a new terminal window, from the root of the Quickstart clone directory navigate to the `checkout` directory. ```bash -cd service_invocation/python/http/checkout +cd quickstarts/service_invocation/python/http/checkout ``` Install the dependencies and build the application: @@ -906,7 +904,7 @@ In a terminal window, from the root of the Quickstart clone directory navigate to `order-processor` directory. ```bash -cd service_invocation/javascript/http/order-processor +cd quickstarts/service_invocation/javascript/http/order-processor ``` Install the dependencies: @@ -934,7 +932,7 @@ In a new terminal window, from the root of the Quickstart clone directory navigate to the `checkout` directory. ```bash -cd service_invocation/javascript/http/checkout +cd quickstarts/service_invocation/javascript/http/checkout ``` Install the dependencies: @@ -1038,7 +1036,7 @@ In a terminal window, from the root of the Quickstart clone directory navigate to `order-processor` directory. ```bash -cd service_invocation/csharp/http/order-processor +cd quickstarts/service_invocation/csharp/http/order-processor ``` Install the dependencies: @@ -1070,7 +1068,7 @@ In a new terminal window, from the root of the Quickstart clone directory navigate to the `checkout` directory. ```bash -cd service_invocation/csharp/http/checkout +cd quickstarts/service_invocation/csharp/http/checkout ``` Install the dependencies: @@ -1089,13 +1087,11 @@ dapr run --app-id checkout --app-protocol http --dapr-http-port 3500 -- dotnet r In the Program.cs file for the `checkout` service, you'll notice there's no need to rewrite your app code to use Dapr's service invocation. You can enable service invocation by simply adding the `dapr-app-id` header, which specifies the ID of the target service. ```csharp -var client = new HttpClient(); -client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); - -client.DefaultRequestHeaders.Add("dapr-app-id", "order-processor"); +var client = DaprClient.CreateInvokeHttpClient(appId: "order-processor"); +var cts = new CancellationTokenSource(); -var response = await client.PostAsync($"{baseURL}/orders", content); - Console.WriteLine("Order passed: " + order); +var response = await client.PostAsJsonAsync("/orders", order, cts.Token); +Console.WriteLine("Order passed: " + order); ``` ### Step 5: Use with Multi-App Run @@ -1178,7 +1174,7 @@ In a terminal window, from the root of the Quickstart clone directory navigate to `order-processor` directory. ```bash -cd service_invocation/java/http/order-processor +cd quickstarts/service_invocation/java/http/order-processor ``` Install the dependencies: @@ -1206,7 +1202,7 @@ In a new terminal window, from the root of the Quickstart clone directory navigate to the `checkout` directory. ```bash -cd service_invocation/java/http/checkout +cd quickstarts/service_invocation/java/http/checkout ``` Install the dependencies: @@ -1309,7 +1305,7 @@ In a terminal window, from the root of the Quickstart clone directory navigate to `order-processor` directory. ```bash -cd service_invocation/go/http/order-processor +cd quickstarts/service_invocation/go/http/order-processor ``` Install the dependencies: @@ -1343,7 +1339,7 @@ In a new terminal window, from the root of the Quickstart clone directory navigate to the `checkout` directory. ```bash -cd service_invocation/go/http/checkout +cd quickstarts/service_invocation/go/http/checkout ``` Install the dependencies: From f6bd09836513208e7752065b8c835e68088c64c2 Mon Sep 17 00:00:00 2001 From: Mark Fussell Date: Tue, 4 Feb 2025 11:54:13 -0800 Subject: [PATCH 13/16] Update daprdocs/content/en/developing-applications/building-blocks/pubsub/pubsub-raw.md Co-authored-by: Marc Duiker Signed-off-by: Mark Fussell --- .../building-blocks/pubsub/pubsub-raw.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daprdocs/content/en/developing-applications/building-blocks/pubsub/pubsub-raw.md b/daprdocs/content/en/developing-applications/building-blocks/pubsub/pubsub-raw.md index 6431b97cc5d..806ae2cee0f 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/pubsub/pubsub-raw.md +++ b/daprdocs/content/en/developing-applications/building-blocks/pubsub/pubsub-raw.md @@ -20,7 +20,7 @@ Not using CloudEvents disables support for tracing, event deduplication per mess To disable CloudEvent wrapping, set the `rawPayload` metadata to `true` as part of the publishing request. This allows subscribers to receive these messages without having to parse the CloudEvent schema. -{{< tabs curl ".NET" "Python SDK" "PHP SDK">}} +{{< tabs curl ".NET" "Python" "PHP">}} {{% codetab %}} ```bash From e98d40fd23807b71169d9588f662b17856308fd4 Mon Sep 17 00:00:00 2001 From: Mark Fussell Date: Tue, 4 Feb 2025 11:57:17 -0800 Subject: [PATCH 14/16] Update daprdocs/content/en/developing-applications/building-blocks/pubsub/pubsub-raw.md Co-authored-by: Marc Duiker Signed-off-by: Mark Fussell --- .../building-blocks/pubsub/pubsub-raw.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daprdocs/content/en/developing-applications/building-blocks/pubsub/pubsub-raw.md b/daprdocs/content/en/developing-applications/building-blocks/pubsub/pubsub-raw.md index 806ae2cee0f..9c9b3da4ae3 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/pubsub/pubsub-raw.md +++ b/daprdocs/content/en/developing-applications/building-blocks/pubsub/pubsub-raw.md @@ -116,7 +116,7 @@ Dapr apps are also able to subscribe to raw events coming from existing pub/sub When subscribing programmatically, add the additional metadata entry for `rawPayload` - `isRawPayload` on .NET - so the Dapr sidecar automatically wraps the payloads into a CloudEvent that is compatible with current Dapr SDKs. -{{< tabs ".NET" "Python" "PHP SDK" >}} +{{< tabs ".NET" "Python" "PHP" >}} {{% codetab %}} From 3175f1735f1ebdca5fcb1783b33131f38889c935 Mon Sep 17 00:00:00 2001 From: Jorge Castillo Date: Wed, 5 Feb 2025 11:47:22 +0100 Subject: [PATCH 15/16] Removed `quickstarts` Signed-off-by: Jorge Castillo --- .../serviceinvocation-quickstart.md | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/daprdocs/content/en/getting-started/quickstarts/serviceinvocation-quickstart.md b/daprdocs/content/en/getting-started/quickstarts/serviceinvocation-quickstart.md index ae5f9aa66e7..10c2012e9cd 100644 --- a/daprdocs/content/en/getting-started/quickstarts/serviceinvocation-quickstart.md +++ b/daprdocs/content/en/getting-started/quickstarts/serviceinvocation-quickstart.md @@ -45,7 +45,7 @@ git clone https://github.com/dapr/quickstarts.git From the root of the Quickstart clone directory, navigate to the quickstart directory. ```bash -cd quickstarts/service_invocation/python/http +cd service_invocation/python/http ``` Install the dependencies for the `order-processor` and `checkout` apps: @@ -191,7 +191,7 @@ git clone https://github.com/dapr/quickstarts.git From the root of the Quickstart clone directory, navigate to the quickstart directory. ```bash -cd quickstarts/service_invocation/javascript/http +cd service_invocation/javascript/http ``` Install the dependencies for the `order-processor` and `checkout` apps: @@ -331,7 +331,7 @@ git clone https://github.com/dapr/quickstarts.git From the root of the Quickstart clone directory, navigate to the quickstart directory. ```bash -cd quickstarts/service_invocation/csharp/http +cd service_invocation/csharp/http ``` Install the dependencies for the `order-processor` and `checkout` apps: @@ -475,7 +475,7 @@ git clone https://github.com/dapr/quickstarts.git From the root of the Quickstart clone directory, navigate to the quickstart directory. ```bash -cd quickstarts/service_invocation/java/http +cd service_invocation/java/http ``` Install the dependencies for the `order-processor` and `checkout` apps: @@ -614,7 +614,7 @@ git clone https://github.com/dapr/quickstarts.git From the root of the Quickstart clone directory, navigate to the quickstart directory. ```bash -cd quickstarts/service_invocation/go/http +cd service_invocation/go/http ``` Install the dependencies for the `order-processor` and `checkout` apps: @@ -763,7 +763,7 @@ In a terminal window, from the root of the Quickstart clone directory navigate to `order-processor` directory. ```bash -cd quickstarts/service_invocation/python/http/order-processor +cd service_invocation/python/http/order-processor ``` Install the dependencies and build the application: @@ -798,7 +798,7 @@ In a new terminal window, from the root of the Quickstart clone directory navigate to the `checkout` directory. ```bash -cd quickstarts/service_invocation/python/http/checkout +cd service_invocation/python/http/checkout ``` Install the dependencies and build the application: @@ -904,7 +904,7 @@ In a terminal window, from the root of the Quickstart clone directory navigate to `order-processor` directory. ```bash -cd quickstarts/service_invocation/javascript/http/order-processor +cd service_invocation/javascript/http/order-processor ``` Install the dependencies: @@ -932,7 +932,7 @@ In a new terminal window, from the root of the Quickstart clone directory navigate to the `checkout` directory. ```bash -cd quickstarts/service_invocation/javascript/http/checkout +cd service_invocation/javascript/http/checkout ``` Install the dependencies: @@ -1036,7 +1036,7 @@ In a terminal window, from the root of the Quickstart clone directory navigate to `order-processor` directory. ```bash -cd quickstarts/service_invocation/csharp/http/order-processor +cd service_invocation/csharp/http/order-processor ``` Install the dependencies: @@ -1068,7 +1068,7 @@ In a new terminal window, from the root of the Quickstart clone directory navigate to the `checkout` directory. ```bash -cd quickstarts/service_invocation/csharp/http/checkout +cd service_invocation/csharp/http/checkout ``` Install the dependencies: @@ -1174,7 +1174,7 @@ In a terminal window, from the root of the Quickstart clone directory navigate to `order-processor` directory. ```bash -cd quickstarts/service_invocation/java/http/order-processor +cd service_invocation/java/http/order-processor ``` Install the dependencies: @@ -1202,7 +1202,7 @@ In a new terminal window, from the root of the Quickstart clone directory navigate to the `checkout` directory. ```bash -cd quickstarts/service_invocation/java/http/checkout +cd service_invocation/java/http/checkout ``` Install the dependencies: @@ -1305,7 +1305,7 @@ In a terminal window, from the root of the Quickstart clone directory navigate to `order-processor` directory. ```bash -cd quickstarts/service_invocation/go/http/order-processor +cd service_invocation/go/http/order-processor ``` Install the dependencies: @@ -1339,7 +1339,7 @@ In a new terminal window, from the root of the Quickstart clone directory navigate to the `checkout` directory. ```bash -cd quickstarts/service_invocation/go/http/checkout +cd service_invocation/go/http/checkout ``` Install the dependencies: From 9ad76c3c058f58725e0936546823305f8caaf8b6 Mon Sep 17 00:00:00 2001 From: Fernando Rocha Date: Wed, 5 Feb 2025 12:31:19 -0800 Subject: [PATCH 16/16] removing unecessary lines of code and moddifying verbiage around raw message subscriptions Signed-off-by: Fernando Rocha --- .../building-blocks/pubsub/pubsub-raw.md | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/daprdocs/content/en/developing-applications/building-blocks/pubsub/pubsub-raw.md b/daprdocs/content/en/developing-applications/building-blocks/pubsub/pubsub-raw.md index 9c9b3da4ae3..5b4fe2c1b2b 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/pubsub/pubsub-raw.md +++ b/daprdocs/content/en/developing-applications/building-blocks/pubsub/pubsub-raw.md @@ -32,15 +32,12 @@ curl -X "POST" http://localhost:3500/v1.0/publish/pubsub/TOPIC_A?metadata.rawPay ```csharp using Dapr.Client; -using Shared; var builder = WebApplication.CreateBuilder(args); builder.Services.AddControllers().AddDapr(); var app = builder.Build(); -app.MapGet("/", () => "Publisher API"); - app.MapPost("/publish", async (DaprClient daprClient) => { var message = new Message( @@ -114,7 +111,7 @@ Dapr apps are also able to subscribe to raw events coming from existing pub/sub ### Programmatically subscribe to raw events -When subscribing programmatically, add the additional metadata entry for `rawPayload` - `isRawPayload` on .NET - so the Dapr sidecar automatically wraps the payloads into a CloudEvent that is compatible with current Dapr SDKs. +When subscribing programmatically, add the additional metadata entry for `rawPayload` to allow the subscriber to receive a message that is not wrapped by a CloudEvent. For .NET, this metadata entry is called `isRawPayload`. {{< tabs ".NET" "Python" "PHP" >}} @@ -124,12 +121,9 @@ When subscribing programmatically, add the additional metadata entry for `rawPay using System.Text.Json; using System.Text.Json.Serialization; - var builder = WebApplication.CreateBuilder(args); var app = builder.Build(); -app.MapGet("/", () => "Subscriber API"); - app.MapGet("/dapr/subscribe", () => { var subscriptions = new[] @@ -141,7 +135,8 @@ app.MapGet("/dapr/subscribe", () => route = "/messages", metadata = new Dictionary { - { "isRawPayload", "true" } + { "isRawPayload", "true" }, + { "content-type", "application/json" } } } };