Skip to content

Export WithAdminDeploymentScriptSubnet for polyglot app hosts#15564

Open
mitchdenny wants to merge 1 commit intomainfrom
fix/15373-export-subnet-method
Open

Export WithAdminDeploymentScriptSubnet for polyglot app hosts#15564
mitchdenny wants to merge 1 commit intomainfrom
fix/15373-export-subnet-method

Conversation

@mitchdenny
Copy link
Member

Description

Removes the [AspireExportIgnore] attribute from WithAdminDeploymentScriptSubnet and replaces it with [AspireExport], making this method available to polyglot (TypeScript, Python, etc.) app hosts.

Background: The method was originally blocked because AzureSubnetResource from Aspire.Hosting.Azure.Network was not yet shipped. Now that the Network package is included in the Aspire release, the restriction should be lifted (as identified in #13639 review).

Changes:

  • Replace [AspireExportIgnore] with [AspireExport("withAdminDeploymentScriptSubnet", ...)] on AzureSqlExtensions.WithAdminDeploymentScriptSubnet
  • Update TypeScript Azure SQL polyglot validation app to exercise VNet + subnet + withAdminDeploymentScriptSubnet (proves codegen works and compiles)
  • Add TypeScriptVnetSqlServerInfraDeploymentTests deployment E2E test for TypeScript app host with VNet + SQL + PE + explicit deployment script subnet

Fixes #15373

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
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
    • No
  • Does the change require an update in our Aspire docs?
    • Yes
    • No

Now that Aspire.Hosting.Azure.Network is shipped, AzureSubnetResource is
available to polyglot app hosts. Replace [AspireExportIgnore] with
[AspireExport] on WithAdminDeploymentScriptSubnet so TypeScript (and
other polyglot) app hosts can configure explicit subnets for SQL Server
admin deployment scripts.

- Add [AspireExport] attribute with camelCase name and description
- Update TypeScript Azure SQL validation app to exercise VNet + subnet +
  withAdminDeploymentScriptSubnet (validated by polyglot CI workflow)
- Add TypeScript VNet SQL Server deployment E2E test

Fixes #15373

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 25, 2026 02:03
@github-actions
Copy link
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 -- 15564

Or

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

Copy link
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

This PR makes the AzureSqlExtensions.WithAdminDeploymentScriptSubnet capability available to polyglot app hosts (TypeScript/Python/etc.) by exporting it for code generation, and adds validation coverage proving the exported surface compiles and can be exercised in a TypeScript AppHost deployment scenario.

Changes:

  • Export WithAdminDeploymentScriptSubnet via [AspireExport] so it’s available to polyglot SDKs.
  • Update the TypeScript Azure SQL polyglot validation AppHost to compile usage of VNet + subnet + withAdminDeploymentScriptSubnet.
  • Add a new deployment E2E test that provisions a TypeScript AppHost with VNet + SQL + Private Endpoint and explicitly sets the deployment script subnet.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
tests/Aspire.Deployment.EndToEnd.Tests/TypeScriptVnetSqlServerInfraDeploymentTests.cs Adds an Azure deployment E2E test covering a TypeScript AppHost scenario that uses withAdminDeploymentScriptSubnet.
src/Aspire.Hosting.Azure.Sql/AzureSqlExtensions.cs Exports WithAdminDeploymentScriptSubnet for polyglot codegen.
playground/polyglot/TypeScript/Aspire.Hosting.Azure.Sql/aspire.config.json Adds the Azure Network package dependency needed for VNet/subnet APIs in the TS validation host.
playground/polyglot/TypeScript/Aspire.Hosting.Azure.Sql/ValidationAppHost/apphost.ts Exercises withAdminDeploymentScriptSubnet in the TS validation AppHost to ensure codegen compiles.

Comment on lines +392 to 394
[AspireExport("withAdminDeploymentScriptSubnet", Description = "Configures the Azure SQL server to use a specific subnet for deployment scripts")]
[Experimental("ASPIREAZURE003", UrlFormat = "https://aka.ms/dotnet/aspire/diagnostics#{0}")]
public static IResourceBuilder<AzureSqlServerResource> WithAdminDeploymentScriptSubnet(
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

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

The XML docs for WithAdminDeploymentScriptSubnet still state "This method is not available in polyglot app hosts." but the method is now exported via [AspireExport]. Please remove or update that remark so the documentation matches the new behavior.

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Contributor

🎬 CLI E2E Test Recordings — 49 recordings uploaded (commit cd3e65e)

View recordings
Test Recording
AddPackageInteractiveWhileAppHostRunningDetached ▶️ View Recording
AddPackageWhileAppHostRunningDetached ▶️ View Recording
AgentCommands_AllHelpOutputs_AreCorrect ▶️ View Recording
AgentInitCommand_DefaultSelection_InstallsSkillOnly ▶️ View Recording
AgentInitCommand_MigratesDeprecatedConfig ▶️ View Recording
AspireAddPackageVersionToDirectoryPackagesProps ▶️ View Recording
AspireUpdateRemovesAppHostPackageVersionFromDirectoryPackagesProps ▶️ View Recording
Banner_DisplayedOnFirstRun ▶️ View Recording
Banner_DisplayedWithExplicitFlag ▶️ View Recording
CertificatesClean_RemovesCertificates ▶️ View Recording
CertificatesTrust_WithNoCert_CreatesAndTrustsCertificate ▶️ View Recording
CertificatesTrust_WithUntrustedCert_TrustsCertificate ▶️ View Recording
ConfigSetGet_CreatesNestedJsonFormat ▶️ View Recording
CreateAndRunAspireStarterProject ▶️ View Recording
CreateAndRunAspireStarterProjectWithBundle ▶️ View Recording
CreateAndRunEmptyAppHostProject ▶️ View Recording
CreateAndRunJsReactProject ▶️ View Recording
CreateAndRunPythonReactProject ▶️ View Recording
CreateAndRunTypeScriptEmptyAppHostProject ▶️ View Recording
CreateAndRunTypeScriptStarterProject ▶️ View Recording
CreateStartAndStopAspireProject ▶️ View Recording
CreateTypeScriptAppHostWithViteApp ▶️ View Recording
DescribeCommandResolvesReplicaNames ▶️ View Recording
DescribeCommandShowsRunningResources ▶️ View Recording
DetachFormatJsonProducesValidJson ▶️ View Recording
DoctorCommand_DetectsDeprecatedAgentConfig ▶️ View Recording
DoctorCommand_WithSslCertDir_ShowsTrusted ▶️ View Recording
DoctorCommand_WithoutSslCertDir_ShowsPartiallyTrusted ▶️ View Recording
GlobalMigration_HandlesCommentsAndTrailingCommas ▶️ View Recording
GlobalMigration_HandlesMalformedLegacyJson ▶️ View Recording
GlobalMigration_PreservesAllValueTypes ▶️ View Recording
GlobalMigration_SkipsWhenNewConfigExists ▶️ View Recording
GlobalSettings_MigratedFromLegacyFormat ▶️ View Recording
InvalidAppHostPathWithComments_IsHealedOnRun ▶️ View Recording
LogsCommandShowsResourceLogs ▶️ View Recording
PsCommandListsRunningAppHost ▶️ View Recording
PsFormatJsonOutputsOnlyJsonToStdout ▶️ View Recording
PublishWithDockerComposeServiceCallbackSucceeds ▶️ View Recording
RestoreGeneratesSdkFiles ▶️ View Recording
RunWithMissingAwaitShowsHelpfulError ▶️ View Recording
SecretCrudOnDotNetAppHost ▶️ View Recording
SecretCrudOnTypeScriptAppHost ▶️ View Recording
StagingChannel_ConfigureAndVerifySettings_ThenSwitchChannels ▶️ View Recording
StopAllAppHostsFromAppHostDirectory ▶️ View Recording
StopAllAppHostsFromUnrelatedDirectory ▶️ View Recording
StopNonInteractiveMultipleAppHostsShowsError ▶️ View Recording
StopNonInteractiveSingleAppHost ▶️ View Recording
StopWithNoRunningAppHostExitsSuccessfully ▶️ View Recording
TypeScriptAppHostWithProjectReferenceIntegration ▶️ View Recording

📹 Recordings uploaded automatically from CI run #23521368161

Copy link
Member

@adamint adamint left a comment

Choose a reason for hiding this comment

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

Explanation makes sense

@mitchdenny
Copy link
Member Author

/deployment-test

@github-actions
Copy link
Contributor

🚀 Deployment tests starting on PR #15564...

This will deploy to real Azure infrastructure. Results will be posted here when complete.

View workflow run

@github-actions github-actions bot temporarily deployed to deployment-testing March 25, 2026 04:44 Inactive
@github-actions github-actions bot had a problem deploying to deployment-testing March 25, 2026 04:44 Failure
@github-actions github-actions bot temporarily deployed to deployment-testing March 25, 2026 04:44 Inactive
@github-actions github-actions bot temporarily deployed to deployment-testing March 25, 2026 04:44 Inactive
@github-actions github-actions bot temporarily deployed to deployment-testing March 25, 2026 04:44 Inactive
@github-actions github-actions bot temporarily deployed to deployment-testing March 25, 2026 04:44 Inactive
@github-actions github-actions bot temporarily deployed to deployment-testing March 25, 2026 04:44 Inactive
@github-actions github-actions bot had a problem deploying to deployment-testing March 25, 2026 04:44 Failure
@github-actions github-actions bot temporarily deployed to deployment-testing March 25, 2026 04:44 Inactive
@github-actions github-actions bot temporarily deployed to deployment-testing March 25, 2026 04:44 Inactive
@github-actions github-actions bot temporarily deployed to deployment-testing March 25, 2026 04:44 Inactive
@github-actions github-actions bot temporarily deployed to deployment-testing March 25, 2026 04:44 Inactive
@github-actions github-actions bot temporarily deployed to deployment-testing March 25, 2026 04:44 Inactive
@github-actions github-actions bot temporarily deployed to deployment-testing March 25, 2026 04:44 Inactive
@github-actions github-actions bot temporarily deployed to deployment-testing March 25, 2026 04:44 Inactive
@github-actions github-actions bot had a problem deploying to deployment-testing March 25, 2026 04:44 Failure
@github-actions github-actions bot had a problem deploying to deployment-testing March 25, 2026 04:44 Failure
@github-actions github-actions bot temporarily deployed to deployment-testing March 25, 2026 04:44 Inactive
@github-actions github-actions bot temporarily deployed to deployment-testing March 25, 2026 04:44 Inactive
@github-actions github-actions bot temporarily deployed to deployment-testing March 25, 2026 04:44 Inactive
@github-actions github-actions bot temporarily deployed to deployment-testing March 25, 2026 04:44 Inactive
@github-actions github-actions bot temporarily deployed to deployment-testing March 25, 2026 04:44 Inactive
@github-actions github-actions bot temporarily deployed to deployment-testing March 25, 2026 04:44 Inactive
@github-actions github-actions bot temporarily deployed to deployment-testing March 25, 2026 04:44 Inactive
@github-actions github-actions bot temporarily deployed to deployment-testing March 25, 2026 04:44 Inactive
@github-actions github-actions bot temporarily deployed to deployment-testing March 25, 2026 04:44 Inactive
@github-actions github-actions bot had a problem deploying to deployment-testing March 25, 2026 04:44 Failure
@github-actions github-actions bot temporarily deployed to deployment-testing March 25, 2026 04:44 Inactive
@github-actions github-actions bot temporarily deployed to deployment-testing March 25, 2026 04:44 Inactive
@github-actions
Copy link
Contributor

Deployment E2E Tests failed — 24 passed, 5 failed, 0 cancelled

View test results and recordings

View workflow run

Test Result Recording
Deployment.EndToEnd-VnetSqlServerInfraDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-VnetKeyVaultInfraDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-VnetKeyVaultConnectivityDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AcaCompactNamingDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-PythonFastApiDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AcrPurgeTaskDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AppServiceReactDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AuthenticationTests ✅ Passed
Deployment.EndToEnd-AzureAppConfigDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AzureContainerRegistryDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AcaStarterDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-VnetStorageBlobConnectivityDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AzureEventHubsDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AzureStorageDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AzureLogAnalyticsDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AppServicePythonDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AcaCustomRegistryDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AksStarterDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AcaExistingRegistryDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AzureKeyVaultDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AcaDeploymentErrorOutputTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-VnetStorageBlobInfraDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AzureServiceBusDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-AksStarterWithRedisDeploymentTests ✅ Passed ▶️ View Recording
Deployment.EndToEnd-TypeScriptExpressDeploymentTests ❌ Failed ▶️ View Recording
Deployment.EndToEnd-VnetSqlServerConnectivityDeploymentTests ❌ Failed ▶️ View Recording
Deployment.EndToEnd-TypeScriptVnetSqlServerInfraDeploymentTests ❌ Failed ▶️ View Recording
Deployment.EndToEnd-AcaManagedRedisDeploymentTests ❌ Failed ▶️ View Recording
Deployment.EndToEnd-AcaCompactNamingUpgradeDeploymentTests ❌ Failed ▶️ View Recording

@JamesNK
Copy link
Member

JamesNK commented Mar 25, 2026

Will this conflict with #15557? cc @sebastienros

@mitchdenny
Copy link
Member Author

Yeah they both do the same thing regarding the subnet resource, but this one might do a little more. Happy to wait until Seb's goes in and then rebase this one once that goes in.

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.

Remove AspireExportIgnore from WithAdminDeploymentScriptSubnet now that networking types are included

4 participants