microsoft / microsoft/aspire

Not able to bind RabbitMQ Configuration for Ssl property (Client integration)

Open
#6,573 4 comments 0 reactions 0 assignees View on GitHub
area-integrations rabbitmq
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 15h
Merged PRs (30d)
196

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Describe the bug

Aspire not able to bind the Ssl configuration from appsettings. The following are the few scenarios that i had tried

AppHost
```
builder.AddProject("workerservice1")
.WithReference(rabbitmq);
```

**Case 1: using builder.AddRabbitMQClient("rabbitmq") in project**

Project Configuration
![Image](https://github.com/user-attachments/assets/8bb34ba1-e316-4b7b-8782-8f40bd71b01c)

Project Code (The CertPath and ServerName cannot be bind)
![Image](https://github.com/user-attachments/assets/5f464f16-a37d-45dc-a84e-b10a20a80992)

**Case 2: using builder.AddKeyedRabbitMQClient("rabbitmq") in project**

Project Configuration
![Image](https://github.com/user-attachments/assets/7173d042-830a-490a-a402-016878ac238d)

Project Code (The CertPath and ServerName cannot be bind)
![Image](https://github.com/user-attachments/assets/09f4d6e5-456d-4401-9251-c45aff20ceee)

**Case 3: Similar to Case 2, but using different key name. eg: builder.AddKeyedRabbitMQClient("rabbitmq2")**

Project Configuration
![Image](https://github.com/user-attachments/assets/786c7d7d-197b-4013-b642-7386fad9555f)

Project Code
![Image](https://github.com/user-attachments/assets/5527bce4-fd00-4635-a79b-6b7aeb1ca165)

To conclude based on the above 3 scenarios, case 1 and case 2 not able to bind the Ssl configuration. Only case 3 able to bind the Ssl configuration, but due to it is not matching the connectionstring's suffix name, the project not able to access the connectionstring's value.

Would like to know what causes the aspire not able to bind the Ssl configuration section. It is quite strange as the aspire can bind "ClientProvidedName" but not Ssl section.

### Expected Behavior

Able to bind the Ssl configuration.

### Steps To Reproduce

_No response_

### Exceptions (if any)

_No response_

### .NET Version info

.NET SDK:
Version: 8.0.403
Commit: c64aa40a71
Workload version: 8.0.400-manifests.58db758f
MSBuild version: 17.11.9+a69bbaaf5

Runtime Environment:
OS Name: Windows
OS Version: 10.0.22631
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\8.0.403\

.NET workloads installed:
Configured to use loose manifests when installing new manifests.
[android]
Installation Source: SDK 8.0.400, VS 17.11.35327.3
Manifest Version: 34.0.143/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.android\34.0.143\WorkloadManifest.json
Install Type: FileBased

[aspire]
Installation Source: SDK 8.0.400, VS 17.11.35327.3
Manifest Version: 8.2.1/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.aspire\8.2.1\WorkloadManifest.json
Install Type: FileBased

[ios]
Installation Source: SDK 8.0.400, VS 17.11.35327.3
Manifest Version: 18.0.8303/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.ios\18.0.8303\WorkloadManifest.json
Install Type: FileBased

[maccatalyst]
Installation Source: SDK 8.0.400, VS 17.11.35327.3
Manifest Version: 18.0.8303/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.maccatalyst\18.0.8303\WorkloadManifest.json
Install Type: FileBased

[maui-windows]
Installation Source: SDK 8.0.400, VS 17.11.35327.3
Manifest Version: 8.0.82/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.maui\8.0.82\WorkloadManifest.json
Install Type: FileBased

Host:
Version: 8.0.10
Architecture: x64
Commit: 81cabf2857

.NET SDKs installed:
6.0.302 [C:\Program Files\dotnet\sdk]
6.0.321 [C:\Program Files\dotnet\sdk]
8.0.403 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.26 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.33 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.35 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.26 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.33 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.35 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.7 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.26 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.35 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
Not set

global.json file:
Not found

Learn more:
https://aka.ms/dotnet/info

Download .NET:
https://aka.ms/dotnet/download

### Anything else?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.