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

[FEATURE REQ] Add @ServiceConnection support for CosmosDB, EventHub and Azurite #40329

Open
2 tasks done
eddumelendez opened this issue May 23, 2024 · 5 comments
Open
2 tasks done
Assignees
Labels
azure-spring All azure-spring related issues Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@eddumelendez
Copy link

eddumelendez commented May 23, 2024

Is your feature request related to a problem? Please describe.
Spring Boot 3.1.0 introduced ConnectionDetails. You can read more about it this blog post. There's integration for both Testcontainers and Docker Compose where Spring Boot is able to source the details of the connection.

I can contribute with this feature.

Describe the solution you'd like
Add support for ConnectionDetails, then @ServiceConnection would work for CosmosDB, EventHub and Azurite emulators.

@Container
@ServiceConnection
private static final GenericContainer<?> azurite = new GenericContainer<>(
			"mcr.microsoft.com/azure-storage/azurite:latest")
		.withExposedPorts(10000);

Describe alternatives you've considered
Keep using DynamicPropertySource to register the connection details manually.

@DynamicPropertySource
static void properties(DynamicPropertyRegistry registry) {
	var azuriteHost = azurite.getHost();
	var azuriteBlobMappedPort = azurite.getMappedPort(AZURE_STORAGE_BLOB_PORT);
	var connectionString = "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://%s:%d/devstoreaccount1;"
		.formatted(azuriteHost, azuriteBlobMappedPort);
	registry.add("spring.cloud.azure.storage.blob.connection-string", () -> connectionString);
}

Additional context
Add any other context or screenshots about the feature request 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

  • Description Added
  • Expected solution specified
@github-actions github-actions bot added azure-spring All azure-spring related issues Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels May 23, 2024
Copy link

Copy link

Thank you for your feedback. Tagging and routing to the team member best able to assist.

@saragluna
Copy link
Member

@eddumelendez, thanks for bringing this up, it would be great if you could contribute with this feature.

@eddumelendez
Copy link
Author

eddumelendez commented May 29, 2024

@saragluna thanks for the quick response. I've submitted #40388 supporting Cosmos, Storage Blob and Storage Queue. Looks like eventhubs emulator is not supported by the SDK yet but will keep an eye and update it once it is supported.

@saragluna
Copy link
Member

@eddumelendez, looks great, thanks!

saragluna added a commit to eddumelendez/azure-sdk-for-java that referenced this issue May 30, 2024
rujche added a commit to eddumelendez/azure-sdk-for-java that referenced this issue Jun 12, 2024
@rujche rujche assigned rujche and unassigned moarychan Jun 12, 2024
rujche added a commit to eddumelendez/azure-sdk-for-java that referenced this issue Jun 14, 2024
rujche added a commit to eddumelendez/azure-sdk-for-java that referenced this issue Jun 14, 2024
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 Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
Status: Todo
Development

No branches or pull requests

4 participants