testcontainers / testcontainers-dotnet

A library to support tests with throwaway instances of Docker containers for all compatible .NET Standard versions.
https://dotnet.testcontainers.org
MIT License
3.74k stars 266 forks source link

[Enhancement]: In AzuriteContainer, is there a reason AccountName and AccountKey are not public? #1238

Closed mcolebiltd closed 3 days ago

mcolebiltd commented 2 weeks ago

Problem

The visiblity of AccountName and AccountKey are private in AzuriteContainer. This makes it difficult to construct a custom connection string if your AzuriteContainer is on a network. MsSqlBuilder makes all relevant info public so we can easily build connection strings.

Solution

I would like to move AccountName and AccountKey to AzuriteBuilder to make it consistent with the MsSqlBuilder, and change the visibility to public.

Furthermore, would there be value in letting the consumer customize these values?

Benefit

Better consistency across modules.

Alternatives

Right now if I was to build a custom connection string, I'd have to hard code the AccountName and AccountKey. This isn't terrible, but it also shouldn't be necessary.

Would you like to help contributing this enhancement?

Yes

HofmeisterAn commented 2 weeks ago

I do not think there is a specific reason why those values are not publicly available. My guess is that they are tied to the image and cannot be changed anyway (no container builder input). But if it helps developers, we could move those properties to the builder and make them public. Would you be interested in contributing and creating a pull request for it?

mcolebiltd commented 2 weeks ago

@HofmeisterAn I expect you may be correct about those values being tied directly to the image. I don't see any way to change them in the documentation: https://mcr.microsoft.com/en-us/product/azure-storage/azurite/about

Either way, I still think it would be a good idea to make those public to help us construct the connection strings. I am interested in helping.