components-contrib icon indicating copy to clipboard operation
components-contrib copied to clipboard

Dapr unable to connect to Azure Service Bus Emulator

Open connorjose opened this issue 1 year ago • 7 comments

Expected Behavior

Dapr's Azure Service Bus binding should be able to connect to the ASB emulator.

Actual Behavior

Dapr reports that it is unable to subscribe to the ASB emulator topics. WARN[0031] failed to subscribe to topics: failed to subscribe to topic topic-one: could not get topic topic-one: Get "https://localhost:5672/topic-one?api-version=2021-05": EOF failed to subscribe to topic topic-two: could not get topic topic-two: Get "https://localhost:5672/topic-two?api-version=2021-05": EOF

Steps to Reproduce the Problem

  1. Setup ASB emulator using docker
  2. Configure Dapr to connect to the emulator
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
  name: example-pub-sub
spec:
  type: pubsub.azure.servicebus.topics
  version: v1
  metadata:
    - name: connectionString
      value: "Endpoint=sb://localhost:5672;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=SAS_KEY_VALUE;UseDevelopmentEmulator=true;"

Dapr runtime version: 1.14.4

connorjose avatar Feb 22 '25 23:02 connorjose

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged (pinned, good first issue, help wanted or triaged/resolved) or other activity occurs. Thank you for your contributions.

github-actions[bot] avatar Mar 24 '25 23:03 github-actions[bot]

I'm getting this issue as well, could it be due to the emulator using a self-signed certificate?

Tanzy avatar Mar 26 '25 12:03 Tanzy

It looks like there's special handling for the emulator in the Azure SDK for Go that was added last year. I'm going to assume that DAPR is using an SDK older than that.

https://github.com/Azure/azure-sdk-for-go/blame/674ac20511182bcf01023ec918d2c7aa88be44d5/sdk/messaging/azservicebus/internal/conn/conn.go#L102

/cc @yaron2

oising avatar Apr 02 '25 20:04 oising

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged (pinned, good first issue, help wanted or triaged/resolved) or other activity occurs. Thank you for your contributions.

github-actions[bot] avatar May 02 '25 20:05 github-actions[bot]

bump

oising avatar May 02 '25 20:05 oising

/assign

adam6878 avatar May 15 '25 19:05 adam6878

Hi all — I spent some time digging into this issue and wanted to share what I found:

The root cause of the EOF errors is that Dapr tries to perform entity management (like checking or creating topics/subscriptions) using the azservicebus/admin SDK, which makes HTTPS requests to the Service Bus namespace (e.g. https://localhost:5672/...). When using the Azure Service Bus emulator, this fails because the emulator only exposes AMQP (port 5672) and does not support the Azure Resource Manager (HTTPS) APIs.

adam6878 avatar May 17 '25 21:05 adam6878

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged (pinned, good first issue, help wanted or triaged/resolved) or other activity occurs. Thank you for your contributions.

github-actions[bot] avatar Jun 19 '25 20:06 github-actions[bot]

I'm guessing that this is never going to get sorted?

Tanzy avatar Jun 19 '25 20:06 Tanzy

I’m now going to start working on this since I was off my computer for quite a while.

adam6878 avatar Jul 01 '25 08:07 adam6878

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged (pinned, good first issue, help wanted or triaged/resolved) or other activity occurs. Thank you for your contributions.

github-actions[bot] avatar Jul 31 '25 08:07 github-actions[bot]