Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ playground/**/dist/
#Aspire CLI
.aspire/

# Required for polyglot apps
!playground/polyglot/**/.aspire/

# Release notes automation output
tools/ReleaseNotes/analysis-output/
tools/ReleaseNotes/release-notes-*.md
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"appHostPath": "../apphost.ts",
"language": "typescript/nodejs",
"channel": "pr-13970",
"sdkVersion": "13.1.0",
"packages": {
"Aspire.Hosting.SqlServer": "13.2.0-pr.13970.g0575147c"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"profiles": {
"https": {
"applicationUrl": "https://localhost:55686;http://localhost:57768",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"DOTNET_ENVIRONMENT": "Development",
"ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL": "https://localhost:51980",
"ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:28684"
}
}
}
}
34 changes: 34 additions & 0 deletions playground/polyglot/TypeScript/Aspire.Hosting.SqlServer/apphost.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { createBuilder, ContainerLifetime } from './.modules/aspire.js';

const builder = await createBuilder();

// Test 1: Basic SQL Server resource creation (addSqlServer)
const sqlServer = await builder.addSqlServer("sql");

// Test 2: Add database to SQL Server (addDatabase)
await sqlServer.addDatabase("mydb");

// Test 3: Test withDataVolume
await builder.addSqlServer("sql-volume")
.withDataVolume();

// Test 4: Test withHostPort
await builder.addSqlServer("sql-port")
.withHostPort({ port: 11433 });

// Test 5: Test password parameter with addParameter
const customPassword = await builder.addParameter("sql-password", { secret: true });
await builder.addSqlServer("sql-custom-pass", { password: customPassword });

// Test 6: Chained configuration - multiple With* methods
const sqlChained = await builder.addSqlServer("sql-chained")
.withLifetime(ContainerLifetime.Persistent)
.withDataVolume({ name: "sql-chained-data" })
.withHostPort({ port: 12433 });

// Test 7: Add multiple databases to same server
await sqlChained.addDatabase("db1");
await sqlChained.addDatabase("db2", { databaseName: "customdb2" });

// Build and run the app
await builder.build().run();
Loading
Loading