Skip to content

Rename Azure scope factories - #18976

Merged
Sébastien Ros (sebastienros) merged 1 commit into
mainfrom
sebros/fix-azure-scope-naming
Aug 7, 2026
Merged

Rename Azure scope factories#18976
Sébastien Ros (sebastienros) merged 1 commit into
mainfrom
sebros/fix-azure-scope-naming

Conversation

@sebastienros

Copy link
Copy Markdown
Contributor

Description

Aligns the new Azure Bicep resource scope factories with .NET member naming guidelines before they ship. ForSubscription and ForTenant are renamed to the verb-phrase names requested in API review: CreateForSubscription and CreateForTenant.

The implementation and all C# call sites are updated. Existing TypeScript capability generation remains unchanged because these factories are not exported as generated-language capabilities.

User-facing usage

subscriptionResource.Scope = AzureBicepResourceScope.CreateForSubscription(subscriptionId);
tenantResource.Scope = AzureBicepResourceScope.CreateForTenant();

Validation:

  • 120 targeted Aspire.Hosting.Azure.Tests tests passed.
  • 2 targeted Azure scope TypeScript code-generation tests passed.

Fixes # (issue)

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 8c2c7da0-b7e0-477d-b7b2-3f3f3809d8c2
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 18976

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 18976"

@github-actions github-actions Bot added the area-integrations Issues pertaining to Aspire Integrations packages label Aug 3, 2026

Copilot AI 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.

Pull request overview

Renames Azure Bicep scope factories to follow .NET verb-phrase naming guidelines.

Changes:

  • Renames factories to CreateForSubscription and CreateForTenant.
  • Updates internal usage and all C# tests.

Reviewed changes

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

Show a summary per file
File Description
src/Aspire.Hosting.Azure/AzureBicepResourceScope.cs Renames scope factories and internal calls.
tests/Aspire.Hosting.Azure.Tests/ExistingAzureResourceTests.cs Updates existing-resource scope calls.
tests/Aspire.Hosting.Azure.Tests/BicepUtilitiesTests.cs Updates scope utility tests.
tests/Aspire.Hosting.Azure.Tests/AzureEnvironmentResourceTests.cs Updates environment scope calls.
tests/Aspire.Hosting.Azure.Tests/AzureBicepProvisionerTests.cs Updates provisioning scope calls.

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Tests selector (audit mode)

The full test matrix and all jobs still run in audit mode. The tests and jobs below are what selective CI would run under enforcement.

11 / 100 test projects · 3 jobs, from 5 changed files.

Selected test projects (11 / 100)

Aspire.Hosting.Azure.Kubernetes.Tests, Aspire.Hosting.Azure.Kusto.Tests, Aspire.Hosting.Azure.Tests, Aspire.Hosting.Blazor.Tests, Aspire.Hosting.CodeGeneration.TypeScript.Tests, Aspire.Hosting.Docker.Tests, Aspire.Hosting.Dotnet.Tests, Aspire.Hosting.Foundry.Tests, Aspire.Hosting.Radius.Tests, Aspire.Hosting.Tests, Aspire.Playground.Tests

Selected jobs (3)

deployment-e2e, extension-e2e, typescript-api-compat


How these were chosen — grouped by what changed

⚠️ 10 of the 11 selected test projects come from a single change — src/Aspire.Hosting.Azure/AzureBicepResourceScope.cs.

🔧 src/Aspire.Hosting.Azure/AzureBicepResourceScope.cs (changed source)
1 directly: Aspire.Hosting.Azure.Tests
9 via the project graph: Aspire.Hosting.Azure.Kusto.Tests (2 hops), Aspire.Hosting.Blazor.Tests (3 hops), Aspire.Hosting.CodeGeneration.TypeScript.Tests (2 hops), Aspire.Hosting.Docker.Tests (2 hops), Aspire.Hosting.Dotnet.Tests (3 hops), Aspire.Hosting.Foundry.Tests (2 hops), Aspire.Hosting.Radius.Tests (3 hops), Aspire.Hosting.Tests (2 hops), Aspire.Playground.Tests (2 hops)

🧪 tests/Aspire.Hosting.Azure.Tests/AzureBicepProvisionerTests.cs (changed test)
1 directly: Aspire.Hosting.Azure.Tests
1 via the project graph: Aspire.Hosting.Azure.Kubernetes.Tests

🧪 tests/Aspire.Hosting.Azure.Tests/AzureEnvironmentResourceTests.cs (changed test)
1 directly: Aspire.Hosting.Azure.Tests

🧪 tests/Aspire.Hosting.Azure.Tests/BicepUtilitiesTests.cs (changed test)
1 directly: Aspire.Hosting.Azure.Tests

🧪 tests/Aspire.Hosting.Azure.Tests/ExistingAzureResourceTests.cs (changed test)
1 directly: Aspire.Hosting.Azure.Tests

Job reasons

Job Triggered by
deployment-e2e affected project Aspire.Hosting.Azure
extension-e2e src/Aspire.Hosting.Azure/AzureBicepResourceScope.cs
• affected project Aspire.Hosting.Azure
typescript-api-compat affected project Aspire.Hosting.Azure

Selection computed for commit 6c15451.

@sebastienros
Sébastien Ros (sebastienros) merged commit 30200b6 into main Aug 7, 2026
344 checks passed
@sebastienros
Sébastien Ros (sebastienros) deleted the sebros/fix-azure-scope-naming branch August 7, 2026 17:08
@github-actions github-actions Bot added this to the 13.5 milestone Aug 7, 2026
@aspire-repo-bot

Copy link
Copy Markdown
Contributor

Pull request created: #1451

Generated by PR Documentation Check · auto · 98.6 AIC · ⌖ 6.25 AIC · ⊞ 19.4K

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

📝 Documentation has been drafted in microsoft/aspire.dev#1451 targeting release/13.5.

Added a new Set the deployment scope section to customize-resources.mdx documenting AzureBicepResourceScope.CreateForSubscription(...) and AzureBicepResourceScope.CreateForTenant() (the renamed factory methods) for setting a Bicep resource's Scope property, with a C# example and a note about matching targetScope.

  • Modified: src/frontend/src/content/docs/integrations/cloud/azure/customize-resources.mdx

Note

This draft PR needs human review before merging.

Adam Ratzman (adamint) pushed a commit to adamint/aspire that referenced this pull request Aug 7, 2026
PR microsoft#19084 added AzureBicepResourceScopeTests using the then-current
ForSubscription and ForTenant factories. PR microsoft#18976 merged 27 seconds later
and renamed the public factories to CreateForSubscription and
CreateForTenant after API review.

Neither PR conflicted textually on its own branch, but their combination left
the new test calling names that no longer exist on main. Update the test to
follow the shipping API shape from microsoft#18976 rather than reintroducing the old
factory names.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adam Ratzman (adamint) added a commit that referenced this pull request Aug 7, 2026
PR #19084 added AzureBicepResourceScopeTests using the then-current
ForSubscription and ForTenant factories. PR #18976 merged 27 seconds later
and renamed the public factories to CreateForSubscription and
CreateForTenant after API review.

Neither PR conflicted textually on its own branch, but their combination left
the new test calling names that no longer exist on main. Update the test to
follow the shipping API shape from #18976 rather than reintroducing the old
factory names.

Co-authored-by: adamint <adamratzman1@gmail.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-integrations Issues pertaining to Aspire Integrations packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants