Export WithAdminDeploymentScriptSubnet for polyglot app hosts#15564
Export WithAdminDeploymentScriptSubnet for polyglot app hosts#15564mitchdenny wants to merge 1 commit intomainfrom
Conversation
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>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15564Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15564" |
There was a problem hiding this comment.
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
WithAdminDeploymentScriptSubnetvia[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. |
| [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( |
There was a problem hiding this comment.
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.
|
🎬 CLI E2E Test Recordings — 49 recordings uploaded (commit View recordings
📹 Recordings uploaded automatically from CI run #23521368161 |
|
/deployment-test |
|
🚀 Deployment tests starting on PR #15564... This will deploy to real Azure infrastructure. Results will be posted here when complete. |
|
❌ Deployment E2E Tests failed — 24 passed, 5 failed, 0 cancelled View test results and recordings
|
|
Will this conflict with #15557? cc @sebastienros |
|
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. |
Description
Removes the
[AspireExportIgnore]attribute fromWithAdminDeploymentScriptSubnetand replaces it with[AspireExport], making this method available to polyglot (TypeScript, Python, etc.) app hosts.Background: The method was originally blocked because
AzureSubnetResourcefromAspire.Hosting.Azure.Networkwas 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:
[AspireExportIgnore]with[AspireExport("withAdminDeploymentScriptSubnet", ...)]onAzureSqlExtensions.WithAdminDeploymentScriptSubnetwithAdminDeploymentScriptSubnet(proves codegen works and compiles)TypeScriptVnetSqlServerInfraDeploymentTestsdeployment E2E test for TypeScript app host with VNet + SQL + PE + explicit deployment script subnetFixes #15373
Checklist