Skip to content

fix(azure): default endpoint_suffix to blob.core.windows.net#7687

Open
pujitha24 wants to merge 1 commit into
cortexproject:masterfrom
pujitha24:auto/issue-5449
Open

fix(azure): default endpoint_suffix to blob.core.windows.net#7687
pujitha24 wants to merge 1 commit into
cortexproject:masterfrom
pujitha24:auto/issue-5449

Conversation

@pujitha24

Copy link
Copy Markdown

Motivation:
After commit da2ad99 switched Cortex's Azure bucket client to Thanos'
objstore, block-storage-dependent components (alertmanager, ruler,
store-gateway, compactor, etc.) hang on startup when endpoint_suffix
is left empty, failing with DNS errors and no clear message, e.g.:

Get "https://<account>./<container>?restype=container": dial tcp:
lookup <account>. on 192.168.5.3:53: no such host

Root cause: Cortex builds the Thanos azure.Config struct directly in
pkg/storage/bucket/azure/bucket_client.go and calls
NewBucketWithConfig, which bypasses Thanos' parseConfig/DefaultConfig
that would otherwise seed Endpoint with "blob.core.windows.net". Because
Cortex's own azure.endpoint-suffix flag defaulted to "", the resulting
FQDN was <account>., which is invalid.

Approach:
Default the azure.endpoint-suffix flag to "blob.core.windows.net",
matching Thanos' DefaultConfig. This restores the pre-da2ad99
out-of-the-box behavior for Azure public cloud while still allowing the
value to be overridden for sovereign/government clouds. The
connection-string / Azurite path is unaffected because Thanos never reads
Endpoint when a connection string is set.

Test config default and generated config docs are updated to match.

Validation:
go build ./...
go test -tags "netgo slicelabels" ./pkg/storage/bucket/...
make doc BUILD_IN_CONTAINER=false # regenerated config docs
All passed.

Fixes #5449

Signed-off-by: Pujitha Paladugu 10557236+pujitha24@users.noreply.github.com

Motivation:
After commit da2ad99 switched Cortex's Azure bucket client to Thanos'
objstore, block-storage-dependent components (alertmanager, ruler,
store-gateway, compactor, etc.) hang on startup when `endpoint_suffix`
is left empty, failing with DNS errors and no clear message, e.g.:

    Get "https://<account>./<container>?restype=container": dial tcp:
    lookup <account>. on 192.168.5.3:53: no such host

Root cause: Cortex builds the Thanos `azure.Config` struct directly in
pkg/storage/bucket/azure/bucket_client.go and calls
`NewBucketWithConfig`, which bypasses Thanos' `parseConfig`/`DefaultConfig`
that would otherwise seed `Endpoint` with "blob.core.windows.net". Because
Cortex's own `azure.endpoint-suffix` flag defaulted to "", the resulting
FQDN was `<account>.`, which is invalid.

Approach:
Default the `azure.endpoint-suffix` flag to "blob.core.windows.net",
matching Thanos' `DefaultConfig`. This restores the pre-da2ad99
out-of-the-box behavior for Azure public cloud while still allowing the
value to be overridden for sovereign/government clouds. The
connection-string / Azurite path is unaffected because Thanos never reads
`Endpoint` when a connection string is set.

Test config default and generated config docs are updated to match.

Validation:
    go build ./...
    go test -tags "netgo slicelabels" ./pkg/storage/bucket/...
    make doc BUILD_IN_CONTAINER=false   # regenerated config docs
All passed.

Fixes cortexproject#5449

Signed-off-by: Pujitha Paladugu <10557236+pujitha24@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 14, 2026 02:54
@dosubot dosubot Bot added azure component/alertmanager component/compactor component/rules Bits & bobs todo with rules and alerts: the ruler, config service etc. component/store-gateway type/bug labels Jul 14, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a regression in Cortex’s Azure object storage configuration by defaulting endpoint_suffix to the Azure public cloud value (blob.core.windows.net). This prevents Cortex from constructing an invalid FQDN (<account>.) when Cortex directly instantiates Thanos’ azure.Config and bypasses Thanos’ internal defaulting logic.

Changes:

  • Default azure.endpoint-suffix flag to blob.core.windows.net.
  • Update the Azure config default test to match the new flag default.
  • Update generated configuration docs and add a changelog entry documenting the behavior change.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pkg/storage/bucket/azure/config.go Changes the CLI flag default for Azure endpoint-suffix to a valid public cloud suffix.
pkg/storage/bucket/azure/config_test.go Updates the default-config assertion to include the new Endpoint default.
docs/configuration/config-file-reference.md Updates the documented default for endpoint_suffix across relevant Azure config blocks.
docs/blocks-storage/store-gateway.md Updates the documented default for endpoint_suffix in store-gateway config docs.
docs/blocks-storage/querier.md Updates the documented default for endpoint_suffix in querier config docs.
CHANGELOG.md Documents the Azure defaulting bugfix and its impact.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 34 to +36
f.Var(&cfg.StorageConnectionString, prefix+"azure.connection-string", "The values of `account-name` and `endpoint-suffix` values will not be ignored if `connection-string` is set. Use this method over `account-key` if you need to authenticate via a SAS token or if you use the Azurite emulator.")
f.StringVar(&cfg.ContainerName, prefix+"azure.container-name", "", "Azure storage container name")
f.StringVar(&cfg.Endpoint, prefix+"azure.endpoint-suffix", "", "Azure storage endpoint suffix without schema. The account name will be prefixed to this value to create the FQDN")
f.StringVar(&cfg.Endpoint, prefix+"azure.endpoint-suffix", "blob.core.windows.net", "Azure storage endpoint suffix without schema. The account name will be prefixed to this value to create the FQDN")
Comment on lines 858 to +861
# Azure storage endpoint suffix without schema. The account name will be
# prefixed to this value to create the FQDN
# CLI flag: -alertmanager-storage.azure.endpoint-suffix
[endpoint_suffix: <string> | default = ""]
[endpoint_suffix: <string> | default = "blob.core.windows.net"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Azure storage needs the endpoint suffix after v1.15.0

2 participants