Open haoozhang opened 2 days ago
@moarychan @netyyyy @rujche @saragluna
Thank you for your feedback. Tagging and routing to the team member best able to assist.
Another problem is that for spring-cloud-starter-stream-kafka
, SPRING_CLOUD_AZURE_EVENTHUBS_CONNECTIONSTRING
not work, SPRING_CLOUD_AZURE_EVENTHUBS_CONNECTION_STRING
works.
But for spring-cloud-azure-stream-binder-eventhubs
, SPRING_CLOUD_AZURE_EVENTHUBS_CONNECTIONSTRING
works well. This behavior will make customer confused.
FYI: More information about environment variable used in Spring Boot can be found here: https://github.com/azure-javaee/azure-dev/wiki/Knowledge-Sharing#2-sometimes-the-environment-variable-not-take-effect-in-spring-boot-application
Describe the bug Even if the connection string property is set as empty, the application still tries to auth via connection string.
The application is a simple spring cloud stream + kafka, refering to the sample project https://github.com/Azure-Samples/azure-spring-boot-samples/tree/main/eventhubs/spring-cloud-azure-starter/spring-cloud-azure-sample-eventhubs-kafka.
In the application.yaml, when we specify the auth as follows, we want to use managed identity auth, instead of connection string (we leave it empty), but the application still try to use connection string for auth, causing it cannot startup.
Exception or Stack Trace
In the following file, when the property is set as empty, it should not enter the method. but now it will execute this method even if empty.
To Reproduce Steps to reproduce the behavior:
Code Snippet Add the code snippet that causes the issue.
Expected behavior
When setting connection string as empty, it should auto-use MI configuration for auth.
Screenshots If applicable, add screenshots to help explain your problem.
Setup (please complete the following information):
If you suspect a dependency version mismatch (e.g. you see
NoClassDefFoundError
,NoSuchMethodError
or similar), please check out Troubleshoot dependency version conflict article first. If it doesn't provide solution for the problem, please provide:mvn dependency:tree -Dverbose
)Additional context Add any other context about the problem here.
Information Checklist Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report