Skip to content

feat: support DefaultAzureCredential authentication - #9468

Merged
fcanovai merged 3 commits into
mainfrom
dev/default-azure-cred
Jan 8, 2026
Merged

fcanovai merged 3 commits into
mainfrom
dev/default-azure-cred

Conversation

@armru

@armru armru commented Dec 16, 2025

Copy link
Copy Markdown
Member

Adds support for the DefaultAzureCredential authentication mechanism

@armru
armru requested a review from jsilvela as a code owner December 16, 2025 17:03
@armru
armru requested a review from a team December 16, 2025 17:03
@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Dec 16, 2025
@cnpg-bot cnpg-bot added backport-requested ◀️ This pull request should be backported to all supported releases release-1.25 release-1.28 labels Dec 16, 2025
@github-actions

Copy link
Copy Markdown
Contributor

❗ By default, the pull request is configured to backport to all release branches.

  • To stop backporting this pr, remove the label: backport-requested ◀️ or add the label 'do not backport'
  • To stop backporting this pr to a certain release branch, remove the specific branch label: release-x.y

@armru

armru commented Dec 16, 2025

Copy link
Copy Markdown
Member Author

/test

@dosubot dosubot Bot added documentation 📖 Improvements or additions to documentation enhancement 🪄 New feature or request labels Dec 16, 2025
@github-actions

Copy link
Copy Markdown
Contributor

Comment thread api/v1/backup_types.go Resolved
@armru
armru force-pushed the dev/default-azure-cred branch from 9a54ce3 to 726bddc Compare December 22, 2025 16:49
mnencia pushed a commit that referenced this pull request Dec 29, 2025
Make explicit in the docs that the inheritFromAzureAD option enables the
usage of the Azure Managed Identity authentication mechanism.

Signed-off-by: Gabriele Fedi <[email protected]>
mnencia pushed a commit that referenced this pull request Dec 29, 2025
Make explicit in the docs that the inheritFromAzureAD option enables the
usage of the Azure Managed Identity authentication mechanism.

Signed-off-by: Gabriele Fedi <[email protected]>
@mnencia
mnencia force-pushed the dev/default-azure-cred branch from 7eaba8e to 56c142e Compare December 29, 2025 18:05
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Dec 30, 2025
mnencia pushed a commit that referenced this pull request Dec 30, 2025
Make explicit in the docs that the inheritFromAzureAD option enables the
usage of the Azure Managed Identity authentication mechanism.

Signed-off-by: Gabriele Fedi <[email protected]>
@mnencia
mnencia force-pushed the dev/default-azure-cred branch 2 times, most recently from de89e00 to 44f65a1 Compare December 30, 2025 22:41
@mnencia

mnencia commented Dec 30, 2025

Copy link
Copy Markdown
Member

/test

@github-actions

Copy link
Copy Markdown
Contributor

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Dec 30, 2025
@cnpg-bot cnpg-bot added the ok to merge 👌 This PR can be merged label Dec 31, 2025
@fcanovai
fcanovai force-pushed the dev/default-azure-cred branch from 44f65a1 to 21e8f8c Compare January 8, 2026 11:30
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Jan 8, 2026
armru and others added 3 commits January 8, 2026 12:30
Add support for the DefaultAzureCredential authentication mechanism

Changes:
- Updated AzureCredentials API type documentation to reflect the new UseDefaultAzureCredentials option
- Enhanced Azure Blob Storage documentation with examples of using DefaultAzureCredential
- The validation of this new option is handled by the barman-cloud library's existing validation logic

Signed-off-by: Armando Ruocco <[email protected]>
Make explicit in the docs that the inheritFromAzureAD option enables the
usage of the Azure Managed Identity authentication mechanism.

Signed-off-by: Gabriele Fedi <[email protected]>
@fcanovai
fcanovai force-pushed the dev/default-azure-cred branch from 21e8f8c to f8cb0d1 Compare January 8, 2026 11:30
@fcanovai

fcanovai commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

/test

@github-actions

github-actions Bot commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

@fcanovai
fcanovai merged commit 4ee0528 into main Jan 8, 2026
34 checks passed
@fcanovai
fcanovai deleted the dev/default-azure-cred branch January 8, 2026 14:00
cnpg-bot pushed a commit that referenced this pull request Jan 8, 2026
Adds support for the DefaultAzureCredential authentication mechanism

Signed-off-by: Armando Ruocco <[email protected]>
Signed-off-by: Gabriele Fedi <[email protected]>
Signed-off-by: Marco Nenciarini <[email protected]>
Co-authored-by: Gabriele Fedi <[email protected]>
Co-authored-by: Marco Nenciarini <[email protected]>
(cherry picked from commit 4ee0528)
cnpg-bot pushed a commit that referenced this pull request Jan 8, 2026
Adds support for the DefaultAzureCredential authentication mechanism

Signed-off-by: Armando Ruocco <[email protected]>
Signed-off-by: Gabriele Fedi <[email protected]>
Signed-off-by: Marco Nenciarini <[email protected]>
Co-authored-by: Gabriele Fedi <[email protected]>
Co-authored-by: Marco Nenciarini <[email protected]>
(cherry picked from commit 4ee0528)
cnpg-bot pushed a commit that referenced this pull request Jan 8, 2026
Adds support for the DefaultAzureCredential authentication mechanism

Signed-off-by: Armando Ruocco <[email protected]>
Signed-off-by: Gabriele Fedi <[email protected]>
Signed-off-by: Marco Nenciarini <[email protected]>
Co-authored-by: Gabriele Fedi <[email protected]>
Co-authored-by: Marco Nenciarini <[email protected]>
(cherry picked from commit 4ee0528)
mnencia added a commit that referenced this pull request Jan 9, 2026
…ting

This disclaimer clarifies that CloudNativePG doesn't independently test all
possible barman-cloud authentication methods. CloudNativePG's responsibility is
limited to passing provided credentials to barman-cloud, which then handles
authentication according to its own implementation.

Related to #9468

Signed-off-by: Marco Nenciarini <[email protected]>
mnencia added a commit that referenced this pull request Jan 9, 2026
…ting (#9644)

This PR adds a disclaimer to the object stores documentation clarifying
that CloudNativePG does not independently test all authentication
methods supported by barman-cloud. CloudNativePG's responsibility is
limited to passing the provided credentials to barman-cloud, which then
handles authentication according to its own implementation.

This documentation change was decided by the maintainers as part of the
discussion around Azure Default Credentials support (#9468).

Signed-off-by: Marco Nenciarini <[email protected]>
cnpg-bot pushed a commit that referenced this pull request Jan 9, 2026
…ting (#9644)

This PR adds a disclaimer to the object stores documentation clarifying
that CloudNativePG does not independently test all authentication
methods supported by barman-cloud. CloudNativePG's responsibility is
limited to passing the provided credentials to barman-cloud, which then
handles authentication according to its own implementation.

This documentation change was decided by the maintainers as part of the
discussion around Azure Default Credentials support (#9468).

Signed-off-by: Marco Nenciarini <[email protected]>
(cherry picked from commit 564dc9c)
cnpg-bot pushed a commit that referenced this pull request Jan 9, 2026
…ting (#9644)

This PR adds a disclaimer to the object stores documentation clarifying
that CloudNativePG does not independently test all authentication
methods supported by barman-cloud. CloudNativePG's responsibility is
limited to passing the provided credentials to barman-cloud, which then
handles authentication according to its own implementation.

This documentation change was decided by the maintainers as part of the
discussion around Azure Default Credentials support (#9468).

Signed-off-by: Marco Nenciarini <[email protected]>
(cherry picked from commit 564dc9c)
cnpg-bot pushed a commit that referenced this pull request Jan 9, 2026
…ting (#9644)

This PR adds a disclaimer to the object stores documentation clarifying
that CloudNativePG does not independently test all authentication
methods supported by barman-cloud. CloudNativePG's responsibility is
limited to passing the provided credentials to barman-cloud, which then
handles authentication according to its own implementation.

This documentation change was decided by the maintainers as part of the
discussion around Azure Default Credentials support (#9468).

Signed-off-by: Marco Nenciarini <[email protected]>
(cherry picked from commit 564dc9c)
mnencia added a commit that referenced this pull request Jan 20, 2026
…ting (#9644)

This PR adds a disclaimer to the object stores documentation clarifying
that CloudNativePG does not independently test all authentication
methods supported by barman-cloud. CloudNativePG's responsibility is
limited to passing the provided credentials to barman-cloud, which then
handles authentication according to its own implementation.

This documentation change was decided by the maintainers as part of the
discussion around Azure Default Credentials support (#9468).

Signed-off-by: Marco Nenciarini <[email protected]>
(cherry picked from commit 564dc9c)
renovate Bot added a commit to sdwilsh/ansible-playbooks that referenced this pull request Mar 26, 2026
##### [\`v1.28.1\`](https://github.com/cloudnative-pg/cloudnative-pg/releases/tag/v1.28.1)

**Release date:** Feb 5, 2026

##### Enhancements

- Added support for Azure's `DefaultAzureCredential` authentication mechanism for backup and recovery operations. This can be enabled by setting `azureCredentials.useDefaultAzureCredentials: true` in the backup configuration, simplifying authentication in Azure environments without requiring explicit storage account keys or SAS tokens. ([#9468](cloudnative-pg/cloudnative-pg#9468)) <!-- 1.27 1.25 -->

##### Fixes

- Fixed validation of PostgreSQL extension names containing underscores (e.g., `pg_partman`, `pg_ivm`). Extension names with underscores are automatically sanitized to use hyphens for Kubernetes volume names while preserving the original name in mount paths. Webhook validation prevents naming conflicts after sanitization. Contributed by [@shusaan](https://github.com/shusaan). ([#9386](cloudnative-pg/cloudnative-pg#9386)) <!-- 1.27 -->

- Fixed a critical issue where the `TimelineID` in the cluster status was not reset to 1 after a major version upgrade. Because `pg_upgrade` initializes a new timeline, keeping the old ID (e.g., timeline 2) caused replicas to attempt to restore incompatible history files from object storage, leading to fatal "requested timeline is not a child of this server's history" errors. ([#9830](cloudnative-pg/cloudnative-pg#9830)) <!-- 1.27 -->

- Fixed an issue where stale TLS status fields in the `Pooler` were not cleared after being removed from the specification. This was particularly critical when upgrading to v1.28.0, where the `ServerTLS` field was repurposed, causing PgBouncer to use incorrect certificates and resulting in "unsupported certificate" errors that blocked all application connectivity. The operator now explicitly clears `ServerCA`, `ClientCA`, `ClientTLS`, and `ServerTLS` status fields when they are no longer configured. ([#9397](cloudnative-pg/cloudnative-pg#9397))

- Fixed a bug where replicas could enter a crash-loop by attempting to download timeline history files from future timelines. This occurred when stale files remained in the WAL archive from a previous cluster life, and replicas would incorrectly try to fetch them during recovery. ([#9650](cloudnative-pg/cloudnative-pg#9650)) <!-- 1.27 1.25 -->

- Fixed a race condition in `replica_cluster` setups during designated primary transitions, preventing transient "no primary" states in the replica cluster. ([#9601](cloudnative-pg/cloudnative-pg#9601)) <!-- 1.27 1.25 -->

- The backup controller now uses the unique instance session ID to detect instance manager restarts. This prevents the operator from incorrectly assuming a backup is still progressing if the underlying container has crashed and restarted, which previously led to orphaned backup objects. ([#9370](cloudnative-pg/cloudnative-pg#9370)) <!-- 1.27 -->

- Fixed a validation gap in Azure object store configurations where the `storageAccount` was not required when using explicit credentials (such as a storage key or SAS token). The operator now enforces that a storage account name is provided in these cases and that `connectionString` is mutually exclusive with other authentication parameters. ([#9604](cloudnative-pg/cloudnative-pg#9604)) <!-- 1.27 1.25 -->

- Optimized the deletion path so the operator begins cleaning up resources immediately when a cluster is marked for deletion. This significantly reduces the time a cluster remains in `Terminating` status while waiting for internal reconciliation loops. ([#9555](cloudnative-pg/cloudnative-pg#9555)) <!-- 1.27 1.25 -->

- Fixed an issue where replication slots were not properly dropped from replicas when the feature was disabled or the cluster was reconfigured. This ensures that unused slots do not cause WAL build-up on the primary. ([#9381](cloudnative-pg/cloudnative-pg#9381)) <!-- 1.27 1.25 -->

- Fixed an issue where `imagePullSecrets` were not added to the `ServiceAccount` created for the `Pooler`. Previously, these secrets were applied to the Deployment but not the SA, which caused image pull failures in restricted environments using certain security policies. ([#9427](cloudnative-pg/cloudnative-pg#9427)) <!-- 1.27 1.25 -->

- Added a check to verify ownership before the operator deletes a `PodMonitor`. This prevents the operator from accidentally deleting manually managed monitoring resources that happen to share a name with expected CNPG resources. Contributed by [@juliamertz](https://github.com/juliamertz). ([#9340](cloudnative-pg/cloudnative-pg#9340)) <!-- 1.27 1.25 -->

- Fixed a bug where `pg_stat_archiver` metrics would continue to report stale data on standby instances after a switchover. The exporter now skips these metrics on standbys, as PostgreSQL only provides valid archiver stats on the primary. ([#9411](cloudnative-pg/cloudnative-pg#9411)) <!-- 1.27 1.25 -->

- Clarified the interpretation of timestamp formats for recovery `targetTime`. Timestamps provided without an explicit timezone are now consistently interpreted as UTC. Contributed by [@pchovelon](https://github.com/pchovelon). ([#8937](cloudnative-pg/cloudnative-pg#8937)) <!-- 1.27 1.25 -->

- Fixed backup status updates to prevent "resource has been modified" errors during concurrent updates. ([#9551](cloudnative-pg/cloudnative-pg#9551)) <!-- 1.27 1.25 -->

- Fixed event reporting to use the correct pod name when a backup pod is not found. ([#9552](cloudnative-pg/cloudnative-pg#9552)) <!-- 1.27 1.25 -->

- Improved performance of scheduled backup operations for clusters with a very high number of historical backups. ([#9489](cloudnative-pg/cloudnative-pg#9489)) <!-- 1.27 1.25 -->

- Fixed error handling when removing finalizers on `Database` objects. ([#9431](cloudnative-pg/cloudnative-pg#9431)) <!-- 1.27 1.25 -->

- `cnpg` plugin:

  - Updated the `status` command to display "Disabled" when the `skipWalArchiving` annotation is present on a cluster. This replaces confusing "starting up" or "unknown" states when WAL archiving is intentionally bypassed. ([#9709](cloudnative-pg/cloudnative-pg#9709)) <!-- 1.27 1.25 -->

  - Fixed the `logs --follow` command to continue polling for new pods instead of exiting prematurely when all current log streams complete. ([#9599](cloudnative-pg/cloudnative-pg#9599)) <!-- 1.27 1.25 -->
sdwilsh pushed a commit to sdwilsh/ansible-playbooks that referenced this pull request Mar 26, 2026
##### [\`v1.28.1\`](https://github.com/cloudnative-pg/cloudnative-pg/releases/tag/v1.28.1)

**Release date:** Feb 5, 2026

##### Enhancements

- Added support for Azure's `DefaultAzureCredential` authentication mechanism for backup and recovery operations. This can be enabled by setting `azureCredentials.useDefaultAzureCredentials: true` in the backup configuration, simplifying authentication in Azure environments without requiring explicit storage account keys or SAS tokens. ([#9468](cloudnative-pg/cloudnative-pg#9468)) <!-- 1.27 1.25 -->

##### Fixes

- Fixed validation of PostgreSQL extension names containing underscores (e.g., `pg_partman`, `pg_ivm`). Extension names with underscores are automatically sanitized to use hyphens for Kubernetes volume names while preserving the original name in mount paths. Webhook validation prevents naming conflicts after sanitization. Contributed by [@shusaan](https://github.com/shusaan). ([#9386](cloudnative-pg/cloudnative-pg#9386)) <!-- 1.27 -->

- Fixed a critical issue where the `TimelineID` in the cluster status was not reset to 1 after a major version upgrade. Because `pg_upgrade` initializes a new timeline, keeping the old ID (e.g., timeline 2) caused replicas to attempt to restore incompatible history files from object storage, leading to fatal "requested timeline is not a child of this server's history" errors. ([#9830](cloudnative-pg/cloudnative-pg#9830)) <!-- 1.27 -->

- Fixed an issue where stale TLS status fields in the `Pooler` were not cleared after being removed from the specification. This was particularly critical when upgrading to v1.28.0, where the `ServerTLS` field was repurposed, causing PgBouncer to use incorrect certificates and resulting in "unsupported certificate" errors that blocked all application connectivity. The operator now explicitly clears `ServerCA`, `ClientCA`, `ClientTLS`, and `ServerTLS` status fields when they are no longer configured. ([#9397](cloudnative-pg/cloudnative-pg#9397))

- Fixed a bug where replicas could enter a crash-loop by attempting to download timeline history files from future timelines. This occurred when stale files remained in the WAL archive from a previous cluster life, and replicas would incorrectly try to fetch them during recovery. ([#9650](cloudnative-pg/cloudnative-pg#9650)) <!-- 1.27 1.25 -->

- Fixed a race condition in `replica_cluster` setups during designated primary transitions, preventing transient "no primary" states in the replica cluster. ([#9601](cloudnative-pg/cloudnative-pg#9601)) <!-- 1.27 1.25 -->

- The backup controller now uses the unique instance session ID to detect instance manager restarts. This prevents the operator from incorrectly assuming a backup is still progressing if the underlying container has crashed and restarted, which previously led to orphaned backup objects. ([#9370](cloudnative-pg/cloudnative-pg#9370)) <!-- 1.27 -->

- Fixed a validation gap in Azure object store configurations where the `storageAccount` was not required when using explicit credentials (such as a storage key or SAS token). The operator now enforces that a storage account name is provided in these cases and that `connectionString` is mutually exclusive with other authentication parameters. ([#9604](cloudnative-pg/cloudnative-pg#9604)) <!-- 1.27 1.25 -->

- Optimized the deletion path so the operator begins cleaning up resources immediately when a cluster is marked for deletion. This significantly reduces the time a cluster remains in `Terminating` status while waiting for internal reconciliation loops. ([#9555](cloudnative-pg/cloudnative-pg#9555)) <!-- 1.27 1.25 -->

- Fixed an issue where replication slots were not properly dropped from replicas when the feature was disabled or the cluster was reconfigured. This ensures that unused slots do not cause WAL build-up on the primary. ([#9381](cloudnative-pg/cloudnative-pg#9381)) <!-- 1.27 1.25 -->

- Fixed an issue where `imagePullSecrets` were not added to the `ServiceAccount` created for the `Pooler`. Previously, these secrets were applied to the Deployment but not the SA, which caused image pull failures in restricted environments using certain security policies. ([#9427](cloudnative-pg/cloudnative-pg#9427)) <!-- 1.27 1.25 -->

- Added a check to verify ownership before the operator deletes a `PodMonitor`. This prevents the operator from accidentally deleting manually managed monitoring resources that happen to share a name with expected CNPG resources. Contributed by [@juliamertz](https://github.com/juliamertz). ([#9340](cloudnative-pg/cloudnative-pg#9340)) <!-- 1.27 1.25 -->

- Fixed a bug where `pg_stat_archiver` metrics would continue to report stale data on standby instances after a switchover. The exporter now skips these metrics on standbys, as PostgreSQL only provides valid archiver stats on the primary. ([#9411](cloudnative-pg/cloudnative-pg#9411)) <!-- 1.27 1.25 -->

- Clarified the interpretation of timestamp formats for recovery `targetTime`. Timestamps provided without an explicit timezone are now consistently interpreted as UTC. Contributed by [@pchovelon](https://github.com/pchovelon). ([#8937](cloudnative-pg/cloudnative-pg#8937)) <!-- 1.27 1.25 -->

- Fixed backup status updates to prevent "resource has been modified" errors during concurrent updates. ([#9551](cloudnative-pg/cloudnative-pg#9551)) <!-- 1.27 1.25 -->

- Fixed event reporting to use the correct pod name when a backup pod is not found. ([#9552](cloudnative-pg/cloudnative-pg#9552)) <!-- 1.27 1.25 -->

- Improved performance of scheduled backup operations for clusters with a very high number of historical backups. ([#9489](cloudnative-pg/cloudnative-pg#9489)) <!-- 1.27 1.25 -->

- Fixed error handling when removing finalizers on `Database` objects. ([#9431](cloudnative-pg/cloudnative-pg#9431)) <!-- 1.27 1.25 -->

- `cnpg` plugin:

  - Updated the `status` command to display "Disabled" when the `skipWalArchiving` annotation is present on a cluster. This replaces confusing "starting up" or "unknown" states when WAL archiving is intentionally bypassed. ([#9709](cloudnative-pg/cloudnative-pg#9709)) <!-- 1.27 1.25 -->

  - Fixed the `logs --follow` command to continue polling for new pods instead of exiting prematurely when all current log streams complete. ([#9599](cloudnative-pg/cloudnative-pg#9599)) <!-- 1.27 1.25 -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-requested ◀️ This pull request should be backported to all supported releases documentation 📖 Improvements or additions to documentation enhancement 🪄 New feature or request lgtm This PR has been approved by a maintainer no-issue ok to merge 👌 This PR can be merged release-1.28 size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants