Skip to content

Register Azure providers when creating subscription#1438

Merged
kin0992 merged 4 commits intomainfrom
feat/ces-1806-auto-register-azure-providers
Mar 20, 2026
Merged

Register Azure providers when creating subscription#1438
kin0992 merged 4 commits intomainfrom
feat/ces-1806-auto-register-azure-providers

Conversation

@kin0992
Copy link
Copy Markdown
Contributor

@kin0992 kin0992 commented Mar 16, 2026

Closes CES-1806

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 16, 2026

🦋 Changeset detected

Latest commit: b23922f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@pagopa/dx-cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@kin0992 kin0992 marked this pull request as ready for review March 16, 2026 15:14
@kin0992 kin0992 requested a review from a team as a code owner March 16, 2026 15:14
Comment thread apps/cli/src/domain/cloud-account.ts Outdated
Copilot AI review requested due to automatic review settings March 16, 2026 15:58
@kin0992 kin0992 requested a review from lucacavallaro March 16, 2026 16:01
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds automatic Azure Resource Provider registration to the CLI Azure adapter so new/uninitialized subscriptions have required namespaces registered before provisioning, reducing Terraform/bootstrap failures (CES-1806).

Changes:

  • Introduces a new Azure adapter module to register/check a fixed set of required Resource Providers.
  • Calls provider registration during Azure subscription/environment initialization and includes provider status in isInitialized.
  • Adds Vitest coverage for the new module and updates Azure cloud account service tests accordingly, plus a changeset for @pagopa/dx-cli.

Reviewed changes

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

Show a summary per file
File Description
apps/cli/src/adapters/azure/register-resource-providers.ts New helper to register/check required Azure Resource Providers for a subscription.
apps/cli/src/adapters/azure/cloud-account-service.ts Ensures providers are registered during initialize() and includes provider registration status in isInitialized().
apps/cli/src/adapters/azure/tests/register-resource-providers.test.ts Adds unit tests for provider registration/check logic.
apps/cli/src/adapters/azure/tests/cloud-account-service.test.ts Updates isInitialized tests to account for provider registration checks and mocks @azure/arm-resources.
.changeset/real-turkeys-scream.md Declares a patch release for the CLI package.

Comment thread apps/cli/src/adapters/azure/register-resource-providers.ts Outdated
Comment thread apps/cli/src/adapters/azure/__tests__/register-resource-providers.test.ts Outdated
Comment thread apps/cli/src/adapters/azure/__tests__/register-resource-providers.test.ts Outdated
Comment thread apps/cli/src/adapters/azure/register-resource-providers.ts Outdated
Comment thread apps/cli/src/adapters/azure/register-resource-providers.ts Outdated
Comment thread apps/cli/src/adapters/azure/cloud-account-service.ts Outdated
Comment thread apps/cli/src/adapters/azure/cloud-account-service.ts Outdated
@kin0992 kin0992 force-pushed the feat/ces-1806-auto-register-azure-providers branch from 0dd2c01 to deb0632 Compare March 17, 2026 13:57
@kin0992 kin0992 requested a review from lucacavallaro March 17, 2026 14:08
@kin0992 kin0992 enabled auto-merge (squash) March 17, 2026 14:49
@kin0992 kin0992 force-pushed the feat/ces-1806-auto-register-azure-providers branch from deb0632 to 8b0fead Compare March 18, 2026 09:06
@kin0992 kin0992 force-pushed the feat/ces-1806-auto-register-azure-providers branch from 8b0fead to 20fb377 Compare March 18, 2026 16:08
@kin0992 kin0992 force-pushed the feat/ces-1806-auto-register-azure-providers branch from 20fb377 to b23922f Compare March 20, 2026 08:47
@kin0992 kin0992 merged commit 4f8e104 into main Mar 20, 2026
7 checks passed
@kin0992 kin0992 deleted the feat/ces-1806-auto-register-azure-providers branch March 20, 2026 11:31
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.

4 participants