diff --git a/.github/workflows/website-root.yml b/.github/workflows/website-root.yml deleted file mode 100644 index 17989accb7d..00000000000 --- a/.github/workflows/website-root.yml +++ /dev/null @@ -1,109 +0,0 @@ -name: Azure Static Web App Root - -on: - workflow_dispatch: - push: - branches: - - v1.12 - pull_request: - types: [opened, synchronize, reopened, closed] - branches: - - v1.12 - -concurrency: - # Cancel the previously triggered build for only PR build. - group: website-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: true - -jobs: - build_and_deploy_job: - name: Build Hugo Website - if: github.event.action != 'closed' - runs-on: ubuntu-latest - env: - SWA_BASE: 'proud-bay-0e9e0e81e' - HUGO_ENV: production - steps: - - name: Checkout docs repo - uses: actions/checkout@v3 - with: - submodules: true - - name: Setup Node - uses: actions/setup-node@v2 - with: - node-version: '14' - - name: Setup Hugo - uses: peaceiris/actions-hugo@v2.5.0 - with: - hugo-version: 0.102.3 - extended: true - - name: Setup Docsy - run: | - cd daprdocs - git submodule update --init --recursive - sudo npm install -D --save autoprefixer - sudo npm install -D --save postcss-cli - - name: Build Hugo Website - run: | - cd daprdocs - git config --global --add safe.directory /github/workspace - if [ $GITHUB_EVENT_NAME == 'pull_request' ]; then - STAGING_URL="https://${SWA_BASE}-${{github.event.number}}.westus2.azurestaticapps.net/" - fi - hugo ${STAGING_URL+-b "$STAGING_URL"} - - name: Deploy docs site - uses: Azure/static-web-apps-deploy@v1 - with: - azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_PROUD_BAY_0E9E0E81E }} - repo_token: ${{ secrets.GITHUB_TOKEN }} - action: "upload" - app_location: "daprdocs/public/" - api_location: "daprdocs/public/" - output_location: "" - skip_app_build: true - skip_deploy_on_missing_secrets: true - - name: Upload Hugo artifacts - uses: actions/upload-artifact@v3 - with: - name: hugo_build - path: ./daprdocs/public/ - if-no-files-found: error - - close_staging_site: - if: github.event_name == 'pull_request' && github.event.action == 'closed' - runs-on: ubuntu-latest - name: Close Pull Request Job - steps: - - name: Close Pull Request - id: closepullrequest - uses: Azure/static-web-apps-deploy@v1 - with: - azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_PROUD_BAY_0E9E0E81E }} - action: "close" - skip_deploy_on_missing_secrets: true - - algolia_index: - name: Index site for Algolia - if: github.event_name == 'push' - needs: ['build_and_deploy_job'] - runs-on: ubuntu-latest - env: - ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }} - ALGOLIA_API_WRITE_KEY: ${{ secrets.ALGOLIA_API_WRITE_KEY }} - ALGOLIA_INDEX_NAME: daprdocs - steps: - - name: Checkout docs repo - uses: actions/checkout@v2 - with: - submodules: false - - name: Download Hugo artifacts - uses: actions/download-artifact@v3 - with: - name: hugo_build - path: site/ - - name: Install Python packages - run: | - pip install --upgrade bs4 - pip install --upgrade 'algoliasearch>=2.0,<3.0' - - name: Index site - run: python ./.github/scripts/algolia.py ./site diff --git a/.github/workflows/website-v1-12.yml b/.github/workflows/website-v1-13.yml similarity index 95% rename from .github/workflows/website-v1-12.yml rename to .github/workflows/website-v1-13.yml index a16d54978ef..a4c55111669 100644 --- a/.github/workflows/website-v1-12.yml +++ b/.github/workflows/website-v1-13.yml @@ -1,13 +1,13 @@ -name: Azure Static Web App v1.12 +name: Azure Static Web App v1.13 on: push: branches: - - v1.12 + - v1.13 pull_request: types: [opened, synchronize, reopened, closed] branches: - - v1.12 + - v1.13 jobs: build_and_deploy_job: @@ -28,7 +28,7 @@ jobs: HUGO_ENV: production HUGO_VERSION: "0.100.2" with: - azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_V1_12 }} + azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_V1_13 }} repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments) skip_deploy_on_missing_secrets: true action: "upload" @@ -49,6 +49,6 @@ jobs: id: closepullrequest uses: Azure/static-web-apps-deploy@v1 with: - azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_V1_12 }} + azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_V1_13 }} skip_deploy_on_missing_secrets: true action: "close" diff --git a/daprdocs/config.toml b/daprdocs/config.toml index 2d2d5f0a8ec..415e86f5f19 100644 --- a/daprdocs/config.toml +++ b/daprdocs/config.toml @@ -1,5 +1,5 @@ # Site Configuration -baseURL = "https://docs.dapr.io" +baseURL = "https://v1-13.docs.dapr.io" title = "Dapr Docs" theme = "docsy" disableFastRender = true @@ -183,17 +183,17 @@ github_subdir = "daprdocs" github_branch = "v1.12" # Versioning -version_menu = "v1.12 (latest)" -version = "v1.12" +version_menu = "v1.13 (preview)" +version = "v1.13" archived_version = false url_latest_version = "https://docs.dapr.io" [[params.versions]] version = "v1.13 (preview)" - url = "https://v1-13.docs.dapr.io" + url = "#" [[params.versions]] version = "v1.12 (latest)" - url = "#" + url = "https://docs.dapr.io" [[params.versions]] version = "v1.11" url = "https://v1-11.docs.dapr.io" diff --git a/daprdocs/content/en/developing-applications/building-blocks/cryptography/howto-cryptography.md b/daprdocs/content/en/developing-applications/building-blocks/cryptography/howto-cryptography.md index 92f3a671072..c7a781b072d 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/cryptography/howto-cryptography.md +++ b/daprdocs/content/en/developing-applications/building-blocks/cryptography/howto-cryptography.md @@ -15,7 +15,7 @@ Now that you've read about [Cryptography as a Dapr building block]({{< ref crypt ## Encrypt -{{< tabs "JavaScript" "Go" >}} +{{< tabs "JavaScript" "Go", "C#" >}} {{% codetab %}} @@ -136,6 +136,29 @@ if err != nil { {{% /codetab %}} +{{% codetab %}} + + + +To decrypt a file, use the `DecryptAsync` method and pass it either a byte array or a stream. + +```csharp +const string componentName = "azurekeyvault"; +const string keyName = "myKey"; + +var decryptedBytes = await client.DecryptAsync(componentName, encryptedBytes, keyName, cancellationToken); + +// `DecryptAsync` can also accept a stream like a `FileStream` or `MemoryStream` +await using var memoryStream = new MemoryStream(encryptedBytes); +var decryptedBytesFromStream = await client.DecryptAsync(componentName, memoryStream, keyName, cancellationToken); +``` + +{{% /codetab %}} + {{< /tabs >}} ## Next steps diff --git a/daprdocs/content/en/developing-applications/building-blocks/state-management/howto-get-save-state.md b/daprdocs/content/en/developing-applications/building-blocks/state-management/howto-get-save-state.md index 9d8f08e9300..621e71b7b26 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/state-management/howto-get-save-state.md +++ b/daprdocs/content/en/developing-applications/building-blocks/state-management/howto-get-save-state.md @@ -566,6 +566,33 @@ To launch a Dapr sidecar for the above example application, run a command simila dapr run --app-id orderprocessing --app-port 6001 --dapr-http-port 3601 --dapr-grpc-port 60001 dotnet run ``` +The above example will return a `BulkStateItem` with the serialized format of the value you saved to state. If you would prefer that the value be deserialized by the SDK across each of your bulk response items, you can instead use the following: + +```csharp +//dependencies +using Dapr.Client; +//code +namespace EventService +{ + class Program + { + static async Task Main(string[] args) + { + string DAPR_STORE_NAME = "statestore"; + //Using Dapr SDK to retrieve multiple states + using var client = new DaprClientBuilder().Build(); + IReadOnlyList> mulitpleStateResult = await client.GetBulkStateAsync(DAPR_STORE_NAME, new List { "widget_1", "widget_2" }, parallelism: 1); + } + } + + class Widget + { + string Size { get; set; } + string Color { get; set; } + } +} +``` + {{% /codetab %}} {{% codetab %}} diff --git a/daprdocs/content/en/reference/arguments-annotations-overview.md b/daprdocs/content/en/reference/arguments-annotations-overview.md index 68eab9812c3..f69190fcfd4 100644 --- a/daprdocs/content/en/reference/arguments-annotations-overview.md +++ b/daprdocs/content/en/reference/arguments-annotations-overview.md @@ -46,6 +46,7 @@ This table is meant to help users understand the equivalent options for running | `--sentry-address` | `--sentry-address` | | not supported | Address for the [Sentry CA service]({{< ref sentry >}}) | | `--version` | `--version` | `-v` | not supported | Prints the runtime version | | `--dapr-graceful-shutdown-seconds` | not supported | | `dapr.io/graceful-shutdown-seconds` | Graceful shutdown duration in seconds for Dapr, the maximum duration before forced shutdown when waiting for all in-progress requests to complete. Defaults to `5`. If you are running in Kubernetes mode, this value should not be larger than the Kubernetes termination grace period, who's default value is `30`.| +| `--dapr-block-shutdown-duration` | not supported | | `dapr.io/block-shutdown-duration` | Block shutdown duration, if set, blocks the graceful shutdown procedure (as described above) from starting until the given duration has elapsed or the application becomes unhealthy as configured through application health options. This is useful for applications that need to execute Dapr APIs during their own termination procedure. Any new invocations of any Dapr APIs are not available to the application once the block has expired. Accepts [Go duration](https://pkg.go.dev/time#ParseDuration) string. | | not supported | not supported | | `dapr.io/enabled` | Setting this paramater to true injects the Dapr sidecar into the pod | | not supported | not supported | | `dapr.io/api-token-secret` | Tells Dapr which Kubernetes secret to use for [token-based API authentication]({{< ref api-token >}}). By default this is not set | | not supported | not supported | | `dapr.io/app-token-secret` | Tells Dapr which Kubernetes secret to use for [token-based application authentication]({{< ref app-api-token >}}). By default, this is not set | diff --git a/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-aws-snssqs.md b/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-aws-snssqs.md index d4f8618fce3..aa9e65e3723 100644 --- a/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-aws-snssqs.md +++ b/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-aws-snssqs.md @@ -9,15 +9,16 @@ aliases: ## Component format -To set up AWS SNS/SQS pub/sub, create a component of type `pubsub.aws.snssqs`. +To set up AWS SNS/SQS pub/sub, create a component of type `pubsub.aws.snssqs`. By default, the AWS SNS/SQS component: + - Generates the SNS topics - Provisions the SQS queues - Configures a subscription of the queues to the topics {{% alert title="Note" color="primary" %}} -If you only have a publisher and no subscriber, only the SNS topics are created. +If you only have a publisher and no subscriber, only the SNS topics are created. However, if you have a subscriber, SNS, SQS, and the dynamic or static subscription thereof are generated. {{% /alert %}} @@ -133,6 +134,22 @@ When configuring the PubSub component with SQS dead-letter queues, the metadata When running the Dapr sidecar (`daprd`) with your application on EKS (AWS Kubernetes) node/pod already attached to an IAM policy defining access to AWS resources, you **must not** provide AWS access-key, secret-key, and tokens in the definition of the component spec. {{% /alert %}} +#### SNS/SQS Contention with Dapr + +Fundamentally, SNS aggregates messages from multiple publisher topics into a single SQS queue by creating SQS subscriptions to those topics. As a subscriber, the SNS/SQS pub/sub component consumes messages from that sole SQS queue. + +However, like any SQS consumer, the component cannot selectively retrieve the messages published to the SNS topics to which it is specifically subscribed. This can result in the component receiving messages originating from topics without associated handlers. Typically, this occurs during: + +- **Component initialization:** If infrastructure subscriptions are ready before component subscription handlers, or +- **Shutdown:** If component handlers are removed before infrastructure subscriptions. + +Since this issue affects any SQS consumer of multiple SNS topics, the component cannot prevent consuming messages from topics lacking handlers. When this happens, the component logs an error indicating such messages were erroneously retrieved. + +In these situations, the unhandled messages would reappear in SQS with their [receive count](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html#sqs-receive-count) decremented after each pull. Thus, there is a risk that an unhandled message could exceed its `messageReceiveLimit` and be lost. + +{{% alert title="Important" color="warning" %}} +Consider potential contention scenarios when using SNS/SQS with Dapr, and configure `messageReceiveLimit` appropriately. It is highly recommended to use SQS dead-letter queues by setting `sqsDeadLettersQueueName` to prevent losing messages. +{{% /alert %}} ## Create an SNS/SQS instance