Skip to content

Mark WithAzdResourceNaming obsolete - #21230

Closed
Mitch Denny (mitchdenny) wants to merge 3 commits into
mainfrom
mitchdenny-obsolete-azd-resource-naming
Closed

Mitch Denny (mitchdenny) wants to merge 3 commits into
mainfrom
mitchdenny-obsolete-azd-resource-naming

Conversation

@mitchdenny

@mitchdenny Mitch Denny (mitchdenny) commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Description

Recommend that users who deploy Aspire AppHosts using Azure Developer CLI (azd) transition to aspire deploy. Mark WithAzdResourceNaming() obsolete with a compiler warning linking to https://aka.ms/aspire/azd-transition, and include the same recommendation in the API remarks.

Azure Developer CLI is not being retired. Neither are azd up, azd provision, or azd deploy. This recommendation is specifically for deploying Aspire AppHosts.

Existing naming behavior and the polyglot export are intentionally preserved: this change does not rename deployed resources, remove the generated SDK capability, or disable AZD deployment. Other AZD compatibility code is unchanged. Existing compatibility tests retain narrowly scoped obsolete-warning suppressions, and a new test verifies the warning metadata and transition guidance.

Dependency before merge: configure https://aka.ms/aspire/azd-transition to point to the transition guidance. At implementation time it redirects to Bing rather than a transition document.

User-facing usage

Existing C# calls continue to work but now produce warning CS0618:

builder.AddAzureContainerAppEnvironment("env")
    .WithAzdResourceNaming();

Warning message:

For Aspire AppHosts deployed using Azure Developer CLI (azd), we recommend transitioning to 'aspire deploy'. See https://aka.ms/aspire/azd-transition for more information.

Breaking changes

Callers using warnings-as-errors must address or explicitly suppress the new obsolete warning. Runtime behavior and generated resource names remain unchanged. Follow the linked transition guidance before changing naming settings on existing deployments.

Validation

  • ./restore.sh — passed, zero warnings and errors.
  • The following command — passed, 8 tests, zero failures or skips:
MSBUILDTERMINALLOGGER=false dotnet test --project tests/Aspire.Hosting.Azure.Tests/Aspire.Hosting.Azure.Tests.csproj --no-launch-profile -- --filter-method '*.WithAzdResourceNamingIsObsoleteWithTransitionGuidance' --filter-method '*.AddContainerAppEnvironmentAddsEnvironmentResource' --filter-method '*.AzdNamingCollisionSuggestsRemovingAzdNamingOrExplicitNames' --filter-method '*.MixedAzdAndUniqueNamingDetectsEquivalentPhysicalNames' --filter-method '*.DefaultContainerRegistryUsesAzdNamingWhenEnvironmentDoes' --filter-method '*.CrossResourceGroupRegistry_WithAzdNaming_PreservesIdentityName' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'

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

Preserve AZD resource naming behavior while directing callers to deployment retirement guidance.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: a4666b12-0d85-44e0-b8fa-7fce0c6de8e3
@mitchdenny Mitch Denny (mitchdenny) added the breaking-change Issue or PR that represents a breaking API or functional change over a prerelease. label Oct 21, 2026
@github-actions

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 -- 21230

Or

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

@aspire-repo-bot
aspire-repo-bot Bot requested a balanced review from Copilot October 21, 2026 01:49
@github-actions github-actions Bot added the area-integrations Issues pertaining to Aspire Integrations packages label Oct 21, 2026
@github-actions

This comment has been minimized.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: a4666b12-0d85-44e0-b8fa-7fce0c6de8e3
Co-authored-by: Copilot App <[email protected]>
Copilot-Session: a4666b12-0d85-44e0-b8fa-7fce0c6de8e3

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.

🔵 Needs a closer look

The stated pre-merge retirement-link dependency still needs direct confirmation.

1 open issue
What changed in this PR

Begins azd deployment retirement by deprecating WithAzdResourceNaming() while preserving naming behavior and its polyglot export.

Changes:

  • Adds an obsolete warning and retirement guidance to API remarks.
  • Tests warning metadata and narrowly suppresses warnings in compatibility tests.
File Description
tests/​Aspire.Hosting.Azure.Tests/​AzureContainerAppsTests.cs Tests deprecation metadata and preserves naming coverage.
tests/​Aspire.Hosting.Azure.Tests/​AzureContainerAppEnvironmentExtensionsTests.cs Suppresses the warning in an existing compatibility test.
src/​Aspire.Hosting.Azure.AppContainers/​AzureContainerAppExtensions.cs Adds the obsolete attribute and retirement guidance.

Review effort: Balanced

/// <see href="https://aka.ms/aspire/azd-deployment-retirement"/> for more information.
/// </para>
/// </remarks>
[Obsolete("Azure Developer CLI (azd) deployment support is being retired. See https://aka.ms/aspire/azd-deployment-retirement for more information.")]
@github-actions

Copy link
Copy Markdown
Contributor

Tests selector

8 / 99 PR test projects · 2 PR jobs, from 3 changed files.

Selected PR test projects (8 / 99)

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

Selected PR jobs (2)

polyglot, typescript-api-compat


How these were chosen — grouped by what changed

🔧 src/Aspire.Hosting.Azure.AppContainers/AzureContainerAppExtensions.cs (changed source)
→ 1 directly: Aspire.Hosting.Azure.Tests
→ 6 via the project graph: Aspire.Hosting.Blazor.Tests (2 hops), Aspire.Hosting.CodeGeneration.TypeScript.Tests, Aspire.Hosting.Dotnet.Tests (2 hops), Aspire.Hosting.Radius.Tests (2 hops), Aspire.Hosting.Tests, Aspire.Playground.Tests (2 hops)

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

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

Job reasons

Job Triggered by
polyglot • affected project Aspire.Hosting.Azure.AppContainers
• affected project Aspire.Hosting.Azure.Provisioning.AppContainers
typescript-api-compat affected project Aspire.Hosting.Azure.AppContainers

Selection computed for commit ac48310.

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.

🔵 Needs a closer look

The code changes are narrow, but the explicitly required transition-guidance redirect remains unconfirmed before merge.

1 open issue

Review effort: Balanced

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@eerhardt Eric Erhardt (eerhardt) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This method is meant for people who were originally using azd to deploy, but have been with us since the beginning. They might not want their resource names to change and have to redeploy. But I guess they can suppress the warning if they want to get unblocked.

}

[Fact]
public void WithAzdResourceNamingIsObsoleteWithTransitionGuidance()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not sure we need this test.

@mitchdenny

Copy link
Copy Markdown
Member Author

Closing because after consideration around what Eric said, even if folks don't deploy with AZD they may still want this.

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 breaking-change Issue or PR that represents a breaking API or functional change over a prerelease.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants