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

Support detecting Kafka by analyzing pom.xml and application.yml #18

Merged
merged 5 commits into from
Nov 12, 2024

Conversation

haoozhang
Copy link

@haoozhang haoozhang commented Nov 11, 2024

Feature:

Fix:

  • Removed connection string configuration when using MI auth, vice versa.
    Because when using MI, it still firstly try to get connection string (empty string), and failed to parse.
  • Small fix for connection string configuration: SPRING_CLOUD_AZURE_EVENTHUBS_CONNECTIONSTRING -> SPRING_CLOUD_AZURE_EVENTHUBS_CONNECTION_STRING.
  • Lowercase Env Var to avoid parsing confusion.

Open issue:

TODO:

  • Better to detect the existing EventHub resource configuration in application.yaml, instead of always creating a new one.

@rujche
Copy link

rujche commented Nov 11, 2024

@haoozhang

Removed connection string configuration when using MI auth, vice versa.

I kept the empty value to override the value in application.yml

Because when using MI, it still firstly try to get connection string (empty string), and failed to parse.

Are you sure the empty string will make the app start failed? I remember it work well when I test event hubs with mi set and connect string set to empty string.

@rujche
Copy link

rujche commented Nov 11, 2024

@haoozhang

Small fix for connection string configuration: SPRING_CLOUD_AZURE_EVENTHUBS_CONNECTIONSTRING -> SPRING_CLOUD_AZURE_EVENTHUBS_CONNECTION_STRING.

Please read this: https://github.com/azure-javaee/azure-dev/wiki/Knowledge-Sharing#2-sometimes-the-environment-variable-not-take-effect-in-spring-boot-application

@rujche
Copy link

rujche commented Nov 11, 2024

@haoozhang

When user has already specified auth (connection string / MI), but selected the different one when azd init (we will inject the configuration for application), maybe this inconsistent configuration does NOT make app running.
For example, user specified connection string auth in application.yaml, but select to use MI during azd init, then we will inject the MI config in bicep file. During the application starts up, it first get the connection string and use it to auth, but it's for the existing resource for now (not the new created one), then in this case, it fails to run.

Override these properties by environment variable can solve this problem.

haozhang added 2 commits November 12, 2024 11:02
# Conflicts:
#	cli/azd/internal/repository/infra_confirm.go
#	cli/azd/internal/scaffold/spec.go
@haoozhang haoozhang merged commit 5ee0aa0 into feature/sjad Nov 12, 2024
@rujche rujche deleted the haozhan/kafka branch November 12, 2024 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants