google / go-cloud

The Go Cloud Development Kit (Go CDK): A library and tools for open cloud development in Go.
https://gocloud.dev/
Apache License 2.0
9.57k stars 812 forks source link

blob/azblob: Azure Service Connector uses a different environment variable for connection strings #3482

Closed bdon closed 2 months ago

bdon commented 2 months ago

Is your feature request related to a problem? Please describe.

For Azure Service Connector, the default connection string environment variable is named AZURE_STORAGEBLOB_CONNECTIONSTRING (see docs)

However, the azblob module reads the AZURE_STORAGE_CONNECTION_STRING environment variable:

https://github.com/google/go-cloud/blob/49a4d98c75ad4a4efafda913d91bbda7ff829931/blob/azureblob/azureblob.go#L322

Describe the solution you'd like

In order for gocloud to work "out of the box" using Service Connector it needs to read from this additional environment variable. Check AZURE_STORAGE_CONNECTION_STRING first, and then check AZURE_STORAGEBLOB_CONNECTIONSTRING.

Describe alternatives you've considered

Additional Context

previous relevant PR: https://github.com/google/go-cloud/pull/3072