Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QUERY] How to produce events to Azure eventhub using Springboot #658

Open
santafek opened this issue Feb 13, 2023 · 3 comments
Open

[QUERY] How to produce events to Azure eventhub using Springboot #658

santafek opened this issue Feb 13, 2023 · 3 comments
Assignees
Labels
azure-spring All azure-spring related issues

Comments

@santafek
Copy link

santafek commented Feb 13, 2023

Query/Question

I am trying to produce events to Azure eventhub using Springboot, i have followed the below mentioned doc for creating Springboot application

https://learn.microsoft.com/en-us/azure/developer/java/spring-framework/configure-spring-cloud-stream-binder-java-app-azure-event-hub
But i am getting below mentioned error

o.s.cloud.stream.binding.BindingService: Failed to create producer binding;retrying in 30 seconds

org.springframework.cloud.stream.binder.BinderException: Exception thrown while building outbound endpoint
caused by java.lang.IllegalArgumentException: Parameter resourceGroupName is required and cannot be null.

Why is this not a Bug or a feature Request?

Setup (please complete the following information if applicable):

  • OS: mac
  • IDE: IntelliJ community edition
  • Sample Path:
  • Library/Libraries:

Information Checklist

  • [ X] Query Added
  • [ X] Setup information Added
@santafek santafek added the azure-spring All azure-spring related issues label Feb 13, 2023
@hui1110 hui1110 changed the title [QUERY] [QUERY] How to produce events to Azure eventhub using Springboot Feb 14, 2023
@yiliuTo
Copy link
Contributor

yiliuTo commented Feb 14, 2023

Hi @santafek , thanks for reaching us. Could you try the sample which is similar with the doc https://learn.microsoft.com/en-us/azure/developer/java/spring-framework/configure-spring-cloud-stream-binder-java-app-azure-event-hub to see if you can run it successfully?

And if this still cannot help, would you like to share your pom.xml and configuration?

@santafek
Copy link
Author

Hi @yiliuTo, Thanks for your update. I have tried the samples (spring-cloud-azure-starter-eventhubs/eventhubs-client/), i have followed the exact steps in read me doc. but i am getting the error
error.docx
Could you please help me in reolving the issues. Thank you.

@yiliuTo
Copy link
Contributor

yiliuTo commented Feb 15, 2023

Hi @santafek , could you check whether you have run these two commands before your run the sample? which is az login and az account set --subscription <your-subscription-id>.

The error logs say

com.azure.spring.sample.eventhubs.client.EventHubClientApplication.main(EventHubClientApplication.java:38) ~[classes/:na]
Caused by: com.azure.identity.CredentialUnavailableException: EnvironmentCredential authentication unavailable. Environment variables are not fully configured.To mitigate this issue, please refer to the troubleshooting guidelines here at https://aka.ms/azsdk/java/identity/environmentcredential/troubleshoot
Managed Identity authentication is not available.
SharedTokenCacheCredential authentication unavailable. No accounts were found in the cache.
IntelliJ Authentication not available. Please log in with Azure Tools for IntelliJ plugin in the IDE.
AzureCliCredential authentication unavailable. Please run 'az login' to set up account. To further mitigate this issue, please refer to the troubleshooting guidelines here at https://aka.ms/azsdk/java/identity/azclicredential/troubleshoot
Unable to execute PowerShell. Please make sure that it is installed in your systemTo mitigate this issue, please refer to the troubleshooting guidelines here at https://aka.ms/azure-identity-java-default-azure-credential-troubleshoot

Our sample as well as the doc you mentioned by default leverage the credential from the application envionment to establish the connection. So when it cannot find any available credential from all the environments, the authentication fails. That's what the exception tells.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
azure-spring All azure-spring related issues
Projects
None yet
Development

No branches or pull requests

2 participants