Skip to content

Helm chart: load the Azure service principal from a Secret - #6095

Merged
flyrain merged 2 commits into
apache:mainfrom
sririshindra:named-storage-azure-helm
Dec 2, 2026
Merged

flyrain merged 2 commits into
apache:mainfrom
sririshindra:named-storage-azure-helm

Conversation

@sririshindra

@sririshindra sririshindra commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

The chart can load the AWS and GCP server credentials from a Kubernetes Secret (storage.secret.awsAccessKeyId, awsSecretAccessKey, gcpToken), but has nothing for Azure. #5952 added polaris.storage.azure.tenant-id, client-id and client-secret, the Azure service principal used when no storageName selects a named one. This adds storage.secret.azureTenantId, azureClientId and azureClientSecret, which map those three properties from the Secret named by storage.secret.name, in the same way as the existing keys. Each key is optional. A key left empty sets nothing, so a deployment that doesn't use them is unchanged. As with the properties themselves, set all three keys or none: if only some are set, Azure storage access fails.

Named Azure storages (polaris.storage.azure.<name>.*) still go through advancedConfig and extraEnv, as the Azure page shows. The chart has no per-name keys for any cloud today.

Tested with helm unittest (the deployment test now checks the three env vars). values.schema.json and the chart reference were regenerated with make helm-schema-generate and make helm-doc-generate.

I used Claude Code while preparing this change.

Checklist

  • 🙋 I am the human author: I understand this change and can explain it
  • 🛡️ Don't disclose security issues! (contact [email protected])
  • 🔗 Clearly explained why the changes are needed, or linked related issues: Related to Support storage-scoped Azure credentials #5952
  • 🧪 Added/updated tests with good coverage, or manually tested (and explained how)
  • 💡 Added comments for complex logic
  • 🧾 Added a changelog entry in changelog.d/ (if needed, see changelog.d/README.md)
  • 📚 Updated documentation in site/content/in-dev/unreleased (if needed)
  • 🤖 Disclosed significant AI usage (recommended if AI was used, see CONTRIBUTING.md)

Comment thread helm/polaris/values.yaml
gcpTokenLifespan: ""
# -- The key in the secret to pull the Azure tenant ID from. Only required when using Azure with a service principal.
# @section -- Storage
azureTenantId: ""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It could be good to have support for named storages (for all providers).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agreed, that would be useful. I would like to keep this PR to the unnamed Azure keys, which match the existing AWS and GCP keys, and add named storage support for all three providers in a separate PR. It needs a new values structure with one entry per storage name, rather than a few more keys next to these.

@adutra

adutra commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Heads-up: #5967 has been merged, so CHANGELOG.md is no longer edited directly. Changelog entries now go in a fragment file under changelog.d/, which avoids merge conflicts on CHANGELOG.md. See changelog.d/README.md for the format.

Could you rebase onto main, revert your changes to CHANGELOG.md, and add a fragment file instead if your change needs a changelog entry? A fragment is only needed for things worth calling out in release notes, such as breaking changes, metastore schema changes, or changes that require manual steps during an upgrade. Thanks!

storage.secret.azureTenantId, azureClientId and azureClientSecret load
polaris.storage.azure.tenant-id, client-id and client-secret from the
Secret named by storage.secret.name, like the existing AWS and GCP keys.
@sririshindra
sririshindra force-pushed the named-storage-azure-helm branch from d2bb072 to 9db87e2 Compare November 30, 2026 23:25
@sririshindra
sririshindra requested a review from adutra December 1, 2026 02:39
@sririshindra
sririshindra marked this pull request as ready for review December 1, 2026 02:39
@github-project-automation github-project-automation Bot moved this from PRs In Progress to Ready to merge in Basic Kanban Board Dec 1, 2026

@orca-review-bot orca-review-bot 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.

Looks good. It's a small change that matches how AWS and GCP already work. I checked that the env names match the @WithName values in StorageConfiguration and that polaris.secretToEnv outputs nothing when a key is empty, so existing installs render the same. Tests, schema, reference.md, the Azure page and the changelog fragment are all in. One small doc nit inline about setting all three keys together.

🤖 AI-generated review comment — agents make mistakes, so please verify before acting on it.

Comment thread helm/polaris/values.yaml
# -- The key in the secret to pull the GCP token expiration time from. Only required when using GCP. Must be a valid ISO 8601 duration. The default is PT1H (1 hour).
# @section -- Storage
gcpTokenLifespan: ""
# -- The key in the secret to pull the Azure tenant ID from. Only required when using Azure with a service principal.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

These keys only work as a set. If someone sets just the client secret, Polaris starts fine, then the first Azure request fails with "Incomplete Azure credentials on the server". Can we add "set all three or none" to these three descriptions? Then it shows up in reference.md too, not just in the PR description.

🤖 AI-generated review comment — agents make mistakes, so please verify before acting on it.

@dimas-b dimas-b left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM 👍 Thanks, @sririshindra !

@flyrain flyrain left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

+1 Thanks @sririshindra !

| storage.secret.gcpTokenLifespan | string | `""` | The key in the secret to pull the GCP token expiration time from. Only required when using GCP. Must be a valid ISO 8601 duration. The default is PT1H (1 hour). |
| storage.secret.azureTenantId | string | `""` | The key in the secret to pull the Azure tenant ID from. Only required when using Azure with a service principal. |
| storage.secret.azureClientId | string | `""` | The key in the secret to pull the Azure client ID from. Only required when using Azure with a service principal. |
| storage.secret.azureClientSecret | string | `""` | The key in the secret to pull the Azure client secret from. Only required when using Azure with a service principal. |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Did we cover the named storage secret config as well? If not, it could be a followup. Something like this:

advancedConfig:
  polaris.features."RESOLVE_CREDENTIALS_BY_STORAGE_NAME": "true"
  polaris.storage.azure.team-a.tenant-id: <tenant>
  polaris.storage.azure.team-a.client-id: <appId>
extraEnv:
  - name: polaris.storage.azure.team-a.client-secret
    valueFrom:
      secretKeyRef:
        name: polaris-azure-team-a
        key: client-secret

@flyrain
flyrain merged commit bda14d8 into apache:main Dec 2, 2026
24 checks passed
@github-project-automation github-project-automation Bot moved this from Ready to merge to Done in Basic Kanban Board Dec 2, 2026
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.

5 participants