diff --git a/Directory.Packages.props b/Directory.Packages.props
index 118112abbc0..5f2a448ca56 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -110,8 +110,8 @@
-
-
+
+
diff --git a/eng/Signing.props b/eng/Signing.props
index 3400bb5677b..af6596f2879 100644
--- a/eng/Signing.props
+++ b/eng/Signing.props
@@ -51,7 +51,10 @@
+
+
+
diff --git a/eng/Versions.props b/eng/Versions.props
index d3c397ec9b3..eada7ba1557 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -39,7 +39,7 @@
10.0.0-beta.26123.2
10.0.0-beta.26123.2
10.0.0-beta.26123.2
- 10.0.2
+ 10.0.3
10.2.0
10.1.0-preview.1.25608.1
@@ -65,35 +65,35 @@
- 10.0.2
- 10.0.2
- 10.0.2
- 10.0.2
+ 10.0.3
+ 10.0.3
+ 10.0.3
+ 10.0.3
- 10.0.2
- 10.0.2
- 10.0.2
- 10.0.2
- 10.0.2
- 10.0.2
- 10.0.2
- 10.0.2
- 10.0.2
- 10.0.2
- 10.0.2
+ 10.0.3
+ 10.0.3
+ 10.0.3
+ 10.0.3
+ 10.0.3
+ 10.0.3
+ 10.0.3
+ 10.0.3
+ 10.0.3
+ 10.0.3
+ 10.0.3
- 10.0.2
- 10.0.2
- 10.0.2
- 10.0.2
- 10.0.2
- 10.0.2
- 10.0.2
- 10.0.2
- 10.0.2
- 10.0.2
- 10.0.2
- 10.0.2
+ 10.0.3
+ 10.0.3
+ 10.0.3
+ 10.0.3
+ 10.0.3
+ 10.0.3
+ 10.0.3
+ 10.0.3
+ 10.0.3
+ 10.0.3
+ 10.0.3
+ 10.0.3
diff --git a/extension/loc/xlf/aspire-vscode.xlf b/extension/loc/xlf/aspire-vscode.xlf
index ea53f379a7f..935b07ee76f 100644
--- a/extension/loc/xlf/aspire-vscode.xlf
+++ b/extension/loc/xlf/aspire-vscode.xlf
@@ -61,6 +61,9 @@
C# support is not enabled in this workspace. This project should have started through the Aspire CLI.
+
+ Close the dashboard browser when the debug session ends. Works with debug browser options (Chrome, Edge, Firefox).
+
Codespaces
@@ -190,6 +193,15 @@
Launch Aspire Dashboard
+
+ Launch Chrome as a debug session (auto-closes when debugging ends).
+
+
+ Launch Firefox as a debug session (requires Firefox Debugger extension).
+
+
+ Launch Microsoft Edge as a debug session (auto-closes when debugging ends).
+
Launch the effective Aspire apphost in your workspace
@@ -307,6 +319,9 @@
The apphost is not compatible. Consider upgrading the apphost or Aspire CLI.
+
+ The browser to use when auto-launching the Aspire Dashboard.
+
The path to the Aspire CLI executable. If not set, the extension will attempt to use 'aspire' from the system PATH.
@@ -319,6 +334,9 @@
Update integrations
+
+ Use the system default browser (cannot auto-close).
+
View logs
diff --git a/extension/package.json b/extension/package.json
index 3744fb344c8..8a1b9392351 100644
--- a/extension/package.json
+++ b/extension/package.json
@@ -29,7 +29,10 @@
"onDebugDynamicConfigurations:aspire",
"workspaceContains:**/*.csproj",
"onView:workbench.view.debug",
- "workspaceContains:**/apphost.cs"
+ "workspaceContains:**/apphost.cs",
+ "onCommand:aspire-vscode.installCliStable",
+ "onCommand:aspire-vscode.installCliDaily",
+ "onCommand:aspire-vscode.verifyCliInstalled"
],
"main": "./dist/extension.js",
"l10n": "./l10n",
@@ -234,6 +237,21 @@
"title": "%command.executeResourceCommand%",
"category": "Aspire",
"icon": "$(terminal)"
+ },
+ {
+ "command": "aspire-vscode.installCliStable",
+ "title": "%command.installCliStable%",
+ "category": "Aspire"
+ },
+ {
+ "command": "aspire-vscode.installCliDaily",
+ "title": "%command.installCliDaily%",
+ "category": "Aspire"
+ },
+ {
+ "command": "aspire-vscode.verifyCliInstalled",
+ "title": "%command.verifyCliInstalled%",
+ "category": "Aspire"
}
],
"jsonValidation": [
@@ -403,6 +421,25 @@
"description": "%configuration.aspire.enableAspireDashboardAutoLaunch%",
"scope": "window"
},
+ "aspire.dashboardBrowser": {
+ "type": "string",
+ "enum": ["openExternalBrowser", "debugChrome", "debugEdge", "debugFirefox"],
+ "default": "openExternalBrowser",
+ "description": "%configuration.aspire.dashboardBrowser%",
+ "enumDescriptions": [
+ "%configuration.aspire.dashboardBrowser.openExternalBrowser%",
+ "%configuration.aspire.dashboardBrowser.debugChrome%",
+ "%configuration.aspire.dashboardBrowser.debugEdge%",
+ "%configuration.aspire.dashboardBrowser.debugFirefox%"
+ ],
+ "scope": "window"
+ },
+ "aspire.closeDashboardOnDebugEnd": {
+ "type": "boolean",
+ "default": true,
+ "description": "%configuration.aspire.closeDashboardOnDebugEnd%",
+ "scope": "window"
+ },
"aspire.enableDebugConfigEnvironmentLogging": {
"type": "boolean",
"default": true,
@@ -410,7 +447,77 @@
"scope": "window"
}
}
- }
+ },
+ "walkthroughs": [
+ {
+ "id": "aspire-vscode.getStarted",
+ "title": "%walkthrough.getStarted.title%",
+ "description": "%walkthrough.getStarted.description%",
+ "steps": [
+ {
+ "id": "aspire-vscode.getStarted.welcome",
+ "title": "%walkthrough.getStarted.welcome.title%",
+ "description": "%walkthrough.getStarted.welcome.description%",
+ "media": {
+ "markdown": "walkthrough/welcome.md"
+ }
+ },
+ {
+ "id": "aspire-vscode.getStarted.installCli",
+ "title": "%walkthrough.getStarted.installCli.title%",
+ "description": "%walkthrough.getStarted.installCli.description%",
+ "media": {
+ "markdown": "walkthrough/installCli.md"
+ },
+ "completionEvents": [
+ "onCommand:aspire-vscode.verifyCliInstalled"
+ ]
+ },
+ {
+ "id": "aspire-vscode.getStarted.createProject",
+ "title": "%walkthrough.getStarted.createProject.title%",
+ "description": "%walkthrough.getStarted.createProject.description%",
+ "media": {
+ "markdown": "walkthrough/createProject.md"
+ },
+ "completionEvents": [
+ "onCommand:aspire-vscode.new"
+ ]
+ },
+ {
+ "id": "aspire-vscode.getStarted.runApp",
+ "title": "%walkthrough.getStarted.runApp.title%",
+ "description": "%walkthrough.getStarted.runApp.description%",
+ "media": {
+ "markdown": "walkthrough/runApp.md"
+ },
+ "completionEvents": [
+ "onCommand:aspire-vscode.runAppHost",
+ "onCommand:aspire-vscode.debugAppHost"
+ ]
+ },
+ {
+ "id": "aspire-vscode.getStarted.dashboard",
+ "title": "%walkthrough.getStarted.dashboard.title%",
+ "description": "%walkthrough.getStarted.dashboard.description%",
+ "media": {
+ "markdown": "walkthrough/dashboard.md"
+ },
+ "completionEvents": [
+ "onCommand:aspire-vscode.openDashboard"
+ ]
+ },
+ {
+ "id": "aspire-vscode.getStarted.nextSteps",
+ "title": "%walkthrough.getStarted.nextSteps.title%",
+ "description": "%walkthrough.getStarted.nextSteps.description%",
+ "media": {
+ "markdown": "walkthrough/nextSteps.md"
+ }
+ }
+ ]
+ }
+ ]
},
"repository": {
"type": "git",
diff --git a/extension/package.nls.json b/extension/package.nls.json
index e5eb3ee8891..55197b32c1f 100644
--- a/extension/package.nls.json
+++ b/extension/package.nls.json
@@ -22,6 +22,12 @@
"configuration.aspire.enableAspireCliDebugLogging": "Enable console debug logging for Aspire CLI commands executed by the extension.",
"configuration.aspire.enableAspireDcpDebugLogging": "Enable Developer Control Plane (DCP) debug logging for Aspire applications. Logs will be stored in the workspace's .aspire/dcp/logs-{debugSessionId} folder.",
"configuration.aspire.enableAspireDashboardAutoLaunch": "Enable automatic launch of the Aspire Dashboard when using the Aspire debugger.",
+ "configuration.aspire.dashboardBrowser": "The browser to use when auto-launching the Aspire Dashboard.",
+ "configuration.aspire.dashboardBrowser.openExternalBrowser": "Use the system default browser (cannot auto-close).",
+ "configuration.aspire.dashboardBrowser.debugChrome": "Launch Chrome as a debug session (auto-closes when debugging ends).",
+ "configuration.aspire.dashboardBrowser.debugEdge": "Launch Microsoft Edge as a debug session (auto-closes when debugging ends).",
+ "configuration.aspire.dashboardBrowser.debugFirefox": "Launch Firefox as a debug session (requires Firefox Debugger extension).",
+ "configuration.aspire.closeDashboardOnDebugEnd": "Close the dashboard browser when the debug session ends. Works with debug browser options (Chrome, Edge, Firefox).",
"configuration.aspire.enableDebugConfigEnvironmentLogging": "Include environment variables when logging debug session configurations. This can help diagnose environment-related issues but may expose sensitive information in logs.",
"command.runAppHost": "Run Aspire apphost",
"command.debugAppHost": "Debug Aspire apphost",
@@ -119,5 +125,22 @@
"command.startResource": "Start",
"command.restartResource": "Restart",
"command.viewResourceLogs": "View logs",
- "command.executeResourceCommand": "Execute resource command"
+ "command.executeResourceCommand": "Execute resource command",
+ "command.installCliStable": "Install Aspire CLI (stable)",
+ "command.installCliDaily": "Install Aspire CLI (daily)",
+ "command.verifyCliInstalled": "Verify Aspire CLI installation",
+ "walkthrough.getStarted.title": "Get started with Aspire",
+ "walkthrough.getStarted.description": "Learn how to create, run, and monitor distributed applications with Aspire.",
+ "walkthrough.getStarted.welcome.title": "Welcome to Aspire",
+ "walkthrough.getStarted.welcome.description": "Aspire helps you build observable, production-ready distributed apps — orchestrating front ends, APIs, containers, and databases from code.\n\nIt works with **any language**: C#, Python, JavaScript, Go, Java, and more.",
+ "walkthrough.getStarted.installCli.title": "Install the Aspire CLI",
+ "walkthrough.getStarted.installCli.description": "The Aspire CLI creates, runs, and manages your applications. Install it using the commands in the panel, then verify your installation.\n\n[Verify installation](command:aspire-vscode.verifyCliInstalled)",
+ "walkthrough.getStarted.createProject.title": "Create a new project",
+ "walkthrough.getStarted.createProject.description": "Scaffold a new Aspire project from a starter template. The template includes an apphost orchestrator, a sample API, and a web frontend.\n\n[Create new project](command:aspire-vscode.new)",
+ "walkthrough.getStarted.runApp.title": "Run your app",
+ "walkthrough.getStarted.runApp.description": "Start your Aspire app to launch all services and open the real-time dashboard.\n\n[Run apphost](command:aspire-vscode.runAppHost)\n\n[Debug apphost](command:aspire-vscode.debugAppHost)",
+ "walkthrough.getStarted.dashboard.title": "Explore the dashboard",
+ "walkthrough.getStarted.dashboard.description": "The Aspire Dashboard shows your resources, endpoints, logs, traces, and metrics — all in one place.\n\n[Open dashboard](command:aspire-vscode.openDashboard)",
+ "walkthrough.getStarted.nextSteps.title": "Next steps",
+ "walkthrough.getStarted.nextSteps.description": "You're all set! Add integrations for databases, messaging, and cloud services, or deploy your app to production.\n\n[Add an integration](command:aspire-vscode.add)\n\n[Open Aspire docs](https://aspire.dev/docs/)"
}
diff --git a/extension/resources/aspire-dashboard-dark.png b/extension/resources/aspire-dashboard-dark.png
new file mode 100644
index 00000000000..b582a735e5b
Binary files /dev/null and b/extension/resources/aspire-dashboard-dark.png differ
diff --git a/extension/src/commands/walkthroughCommands.ts b/extension/src/commands/walkthroughCommands.ts
new file mode 100644
index 00000000000..af1161ee7dc
--- /dev/null
+++ b/extension/src/commands/walkthroughCommands.ts
@@ -0,0 +1,36 @@
+import * as vscode from 'vscode';
+import { aspireTerminalName } from '../loc/strings';
+
+function getOrCreateTerminal(): vscode.Terminal {
+ const existing = vscode.window.terminals.find(t => t.name === aspireTerminalName);
+ if (existing) {
+ return existing;
+ }
+ return vscode.window.createTerminal({ name: aspireTerminalName });
+}
+
+function runInTerminal(command: string): void {
+ const terminal = getOrCreateTerminal();
+ terminal.show();
+ terminal.sendText(command);
+}
+
+export async function installCliStableCommand(): Promise {
+ if (process.platform === 'win32') {
+ runInTerminal('irm https://aspire.dev/install.ps1 | iex');
+ } else {
+ runInTerminal('curl -sSL https://aspire.dev/install.sh | bash');
+ }
+}
+
+export async function installCliDailyCommand(): Promise {
+ if (process.platform === 'win32') {
+ runInTerminal('iex "& { $(irm https://aspire.dev/install.ps1) } -Quality dev"');
+ } else {
+ runInTerminal('curl -sSL https://aspire.dev/install.sh | bash -s -- -q dev');
+ }
+}
+
+export async function verifyCliInstalledCommand(): Promise {
+ runInTerminal('aspire --version');
+}
diff --git a/extension/src/debugger/AspireDebugSession.ts b/extension/src/debugger/AspireDebugSession.ts
index 434eb0cf793..5a0f340bbac 100644
--- a/extension/src/debugger/AspireDebugSession.ts
+++ b/extension/src/debugger/AspireDebugSession.ts
@@ -6,15 +6,18 @@ import { AspireResourceExtendedDebugConfiguration, AspireResourceDebugSession, E
import { extensionLogOutputChannel } from "../utils/logging";
import AspireDcpServer, { generateDcpIdPrefix } from "../dcp/AspireDcpServer";
import { spawnCliProcess } from "./languages/cli";
-import { disconnectingFromSession, launchingWithAppHost, launchingWithDirectory, processExceptionOccurred, processExitedWithCode } from "../loc/strings";
+import { disconnectingFromSession, launchingWithAppHost, launchingWithDirectory, processExceptionOccurred, processExitedWithCode, aspireDashboard } from "../loc/strings";
import { projectDebuggerExtension } from "./languages/dotnet";
import AspireRpcServer from "../server/AspireRpcServer";
import { createDebugSessionConfiguration } from "./debuggerExtensions";
import { AspireTerminalProvider } from "../utils/AspireTerminalProvider";
import { ICliRpcClient } from "../server/rpcClient";
import path from "path";
+import os from "os";
import { EnvironmentVariables } from "../utils/environment";
+export type DashboardBrowserType = 'openExternalBrowser' | 'debugChrome' | 'debugEdge' | 'debugFirefox';
+
export class AspireDebugSession implements vscode.DebugAdapter {
private readonly _onDidSendMessage = new EventEmitter();
private _messageSeq = 1;
@@ -28,6 +31,7 @@ export class AspireDebugSession implements vscode.DebugAdapter {
private _resourceDebugSessions: AspireResourceDebugSession[] = [];
private _trackedDebugAdapters: string[] = [];
private _rpcClient?: ICliRpcClient;
+ private _dashboardDebugSession: vscode.DebugSession | null = null;
private readonly _disposables: vscode.Disposable[] = [];
private _disposed = false;
private _userInitiatedStop = false;
@@ -291,6 +295,79 @@ export class AspireDebugSession implements vscode.DebugAdapter {
});
}
+ /**
+ * Opens the dashboard URL in the specified browser.
+ * For debugChrome/debugEdge/debugFirefox, launches as a child debug session that auto-closes with the Aspire debug session.
+ */
+ async openDashboard(url: string, browserType: DashboardBrowserType): Promise {
+ extensionLogOutputChannel.info(`Opening dashboard in browser: ${browserType}, URL: ${url}`);
+
+ switch (browserType) {
+ case 'debugChrome':
+ await this.launchDebugBrowser(url, 'pwa-chrome');
+ break;
+
+ case 'debugEdge':
+ await this.launchDebugBrowser(url, 'pwa-msedge');
+ break;
+
+ case 'debugFirefox':
+ await this.launchDebugBrowser(url, 'firefox');
+ break;
+
+ case 'openExternalBrowser':
+ default:
+ // Use VS Code's default external browser handling
+ await vscode.env.openExternal(vscode.Uri.parse(url));
+ break;
+ }
+ }
+
+ /**
+ * Launches a browser as a child debug session.
+ * The browser will automatically close when the parent Aspire debug session ends.
+ */
+ private async launchDebugBrowser(url: string, debugType: 'pwa-chrome' | 'pwa-msedge' | 'firefox'): Promise {
+ const debugConfig: vscode.DebugConfiguration = {
+ type: debugType,
+ name: aspireDashboard,
+ request: 'launch',
+ url: url,
+ };
+
+ // Add type-specific options
+ if (debugType === 'pwa-chrome' || debugType === 'pwa-msedge') {
+ // Don't pause on entry for Chrome/Edge
+ debugConfig.pauseForSourceMap = false;
+ }
+ else if (debugType === 'firefox') {
+ // Firefox debugger requires webRoot; resolve to actual workspace path
+ debugConfig.webRoot = vscode.workspace.workspaceFolders?.[0]?.uri.fsPath ?? os.tmpdir();
+ debugConfig.pathMappings = [];
+ }
+
+ // Register listener before starting so we don't miss the event
+ const disposable = vscode.debug.onDidStartDebugSession((session) => {
+ if (session.configuration.name === aspireDashboard && session.type === debugType) {
+ this._dashboardDebugSession = session;
+ disposable.dispose();
+ }
+ });
+
+ // Start as a child debug session - it will close when parent closes
+ const didStart = await vscode.debug.startDebugging(
+ undefined,
+ debugConfig,
+ this._session
+ );
+
+ if (!didStart) {
+ disposable.dispose();
+ extensionLogOutputChannel.warn(`Failed to start debug browser (${debugType}), falling back to default browser`);
+ await vscode.env.openExternal(vscode.Uri.parse(url));
+ }
+ }
+
dispose(): void {
if (this._disposed) {
return;
@@ -302,6 +379,36 @@ export class AspireDebugSession implements vscode.DebugAdapter {
this._trackedDebugAdapters = [];
}
+ /**
+ * Closes the dashboard browser if closeDashboardOnDebugEnd is enabled.
+ * Handles closing debug browser sessions.
+ */
+ private closeDashboard(): void {
+ const aspireConfig = vscode.workspace.getConfiguration('aspire');
+ const shouldClose = aspireConfig.get('closeDashboardOnDebugEnd', true);
+
+ if (!shouldClose) {
+ this._dashboardDebugSession = null;
+ return;
+ }
+
+ extensionLogOutputChannel.info('Closing dashboard browser...');
+
+ // For debug browsers, stop the debug session
+ if (this._dashboardDebugSession) {
+ vscode.debug.stopDebugging(this._dashboardDebugSession).then(
+ () => extensionLogOutputChannel.info('Dashboard debug session stopped.'),
+ (err) => extensionLogOutputChannel.warn(`Failed to stop dashboard debug session: ${err}`)
+ );
+ this._dashboardDebugSession = null;
+ return;
+ }
+ // At this point there is no tracked dashboard debug session to stop.
+ // Any debug browser child sessions (debugChrome, debugEdge, debugFirefox) will
+ // automatically close when the parent Aspire session is stopped, so no further
+ // cleanup is required here.
+ }
+
private sendResponse(request: any, body: any = {}) {
this._onDidSendMessage.fire({
type: 'response',
diff --git a/extension/src/extension.ts b/extension/src/extension.ts
index 2e159fcc92b..085d27b6516 100644
--- a/extension/src/extension.ts
+++ b/extension/src/extension.ts
@@ -26,6 +26,7 @@ import { openLocalSettingsCommand, openGlobalSettingsCommand } from './commands/
import { checkCliAvailableOrRedirect, checkForExistingAppHostPathInWorkspace } from './utils/workspace';
import { AspireEditorCommandProvider } from './editor/AspireEditorCommandProvider';
import { AspireAppHostTreeProvider } from './views/AspireAppHostTreeProvider';
+import { installCliStableCommand, installCliDailyCommand, verifyCliInstalledCommand } from './commands/walkthroughCommands';
import { AspireStatusBarProvider } from './views/AspireStatusBarProvider';
let aspireExtensionContext = new AspireExtensionContext();
@@ -68,6 +69,11 @@ export async function activate(context: vscode.ExtensionContext) {
const runAppHostCommandRegistration = vscode.commands.registerCommand('aspire-vscode.runAppHost', () => editorCommandProvider.tryExecuteRunAppHost(true));
const debugAppHostCommandRegistration = vscode.commands.registerCommand('aspire-vscode.debugAppHost', () => editorCommandProvider.tryExecuteRunAppHost(false));
+ // Walkthrough commands (no CLI check - CLI may not be installed yet)
+ const installCliStableRegistration = vscode.commands.registerCommand('aspire-vscode.installCliStable', installCliStableCommand);
+ const installCliDailyRegistration = vscode.commands.registerCommand('aspire-vscode.installCliDaily', installCliDailyCommand);
+ const verifyCliInstalledRegistration = vscode.commands.registerCommand('aspire-vscode.verifyCliInstalled', verifyCliInstalledCommand);
+
// Aspire panel - running app hosts tree view
const appHostTreeProvider = new AspireAppHostTreeProvider(terminalProvider);
const appHostTreeView = vscode.window.createTreeView('aspire-vscode.runningAppHosts', {
@@ -97,6 +103,7 @@ export async function activate(context: vscode.ExtensionContext) {
context.subscriptions.push(cliAddCommandRegistration, cliNewCommandRegistration, cliInitCommandRegistration, cliDeployCommandRegistration, cliPublishCommandRegistration, openTerminalCommandRegistration, configureLaunchJsonCommandRegistration);
context.subscriptions.push(cliUpdateCommandRegistration, cliUpdateSelfCommandRegistration, settingsCommandRegistration, openLocalSettingsCommandRegistration, openGlobalSettingsCommandRegistration, runAppHostCommandRegistration, debugAppHostCommandRegistration);
+ context.subscriptions.push(installCliStableRegistration, installCliDailyRegistration, verifyCliInstalledRegistration);
const debugConfigProvider = new AspireDebugConfigurationProvider();
context.subscriptions.push(
diff --git a/extension/src/loc/strings.ts b/extension/src/loc/strings.ts
index 44d743af0d9..78045a3d6fc 100644
--- a/extension/src/loc/strings.ts
+++ b/extension/src/loc/strings.ts
@@ -9,6 +9,7 @@ export const codespacesUrl = (url: string) => vscode.l10n.t('Codespaces: {0}', u
export const directLink = vscode.l10n.t('Open local URL');
export const codespacesLink = vscode.l10n.t('Open codespaces URL');
export const openAspireDashboard = vscode.l10n.t('Launch Aspire Dashboard');
+export const aspireDashboard = vscode.l10n.t('Aspire Dashboard');
export const noWorkspaceOpen = vscode.l10n.t('No workspace is open. Please open a folder or workspace before running this command.');
export const failedToShowPromptEmpty = vscode.l10n.t('Failed to show prompt, text was empty.');
export const rpcServerAddressError = vscode.l10n.t('Failed to get RPC server address. The extension may not function correctly.');
diff --git a/extension/src/server/interactionService.ts b/extension/src/server/interactionService.ts
index 57379e71087..6f8f2abf9c3 100644
--- a/extension/src/server/interactionService.ts
+++ b/extension/src/server/interactionService.ts
@@ -8,7 +8,7 @@ import { ProgressNotifier } from './progressNotifier';
import { applyTextStyle, formatText } from '../utils/strings';
import { extensionLogOutputChannel } from '../utils/logging';
import { AspireExtendedDebugConfiguration, EnvVar } from '../dcp/types';
-import { AspireDebugSession } from '../debugger/AspireDebugSession';
+import { AspireDebugSession, DashboardBrowserType } from '../debugger/AspireDebugSession';
import { AnsiColors } from '../utils/AspireTerminalProvider';
import { isDirectory } from '../utils/io';
@@ -34,6 +34,7 @@ export interface IInteractionService {
logMessage: (logLevel: CSLogLevel, message: string) => void;
launchAppHost(projectFile: string, args: string[], environment: EnvVar[], debug: boolean): Promise;
stopDebugging: () => void;
+ closeDashboard: () => void;
notifyAppHostStartupCompleted: () => void;
startDebugSession: (workingDirectory: string, projectFile: string | null, debug: boolean) => Promise;
writeDebugSessionMessage: (message: string, stdout: boolean, textStyle?: string) => void;
@@ -328,11 +329,16 @@ export class InteractionService implements IInteractionService {
// If aspire.enableAspireDashboardAutoLaunch is true, the dashboard will be launched automatically and we do not need
// to show an information message.
- const enableDashboardAutoLaunch = vscode.workspace.getConfiguration('aspire').get('enableAspireDashboardAutoLaunch', true);
+ const aspireConfig = vscode.workspace.getConfiguration('aspire');
+ const enableDashboardAutoLaunch = aspireConfig.get('enableAspireDashboardAutoLaunch', true);
if (enableDashboardAutoLaunch) {
- // Open the dashboard URL in an external browser. Prefer codespaces URL if available.
+ // Open the dashboard URL in the configured browser. Prefer codespaces URL if available.
const urlToOpen = codespacesUrl || baseUrl;
- vscode.env.openExternal(vscode.Uri.parse(urlToOpen));
+ const debugSession = this._getAspireDebugSession();
+ if (debugSession) {
+ const browserType = aspireConfig.get('dashboardBrowser', 'openExternalBrowser');
+ await debugSession.openDashboard(urlToOpen, browserType);
+ }
return;
}
@@ -481,6 +487,13 @@ export class InteractionService implements IInteractionService {
clearProgressNotification() {
this._progressNotifier.clear();
}
+
+ /**
+ * Closes the dashboard browser. Delegates to the current AspireDebugSession.
+ */
+ closeDashboard(): void {
+ // No-op when called from InteractionService - the debug session handles closing in dispose()
+ }
}
function tryExecuteEndpoint(interactionService: IInteractionService, withAuthentication: (callback: (...params: any[]) => any) => (...params: any[]) => any) {
diff --git a/extension/src/views/AspireAppHostTreeProvider.ts b/extension/src/views/AspireAppHostTreeProvider.ts
index 5178b99e7bc..030e6b9858a 100644
--- a/extension/src/views/AspireAppHostTreeProvider.ts
+++ b/extension/src/views/AspireAppHostTreeProvider.ts
@@ -93,13 +93,13 @@ class ResourceItem extends vscode.TreeItem {
function getResourceContextValue(resource: ResourceJson): string {
const commands = resource.commands ? Object.keys(resource.commands) : [];
const parts = ['resource'];
- if (commands.includes('resource-start')) {
+ if (commands.includes('start') || commands.includes('resource-start')) {
parts.push('canStart');
}
- if (commands.includes('resource-stop')) {
+ if (commands.includes('stop') || commands.includes('resource-stop')) {
parts.push('canStop');
}
- if (commands.includes('resource-restart')) {
+ if (commands.includes('restart') || commands.includes('resource-restart')) {
parts.push('canRestart');
}
return parts.join(':');
@@ -314,7 +314,7 @@ export class AspireAppHostTreeProvider implements vscode.TreeDataProvider 0 ? ` ${extraArgs.join(' ')}` : '';
- this._terminalProvider.sendAspireCommandToAspireTerminal(`${command} "${element.resource.name}" --apphost "${appHost.appHostPath}"${suffix}`);
+ this._terminalProvider.sendAspireCommandToAspireTerminal(`resource "${element.resource.name}" ${command} --apphost "${appHost.appHostPath}"${suffix}`);
}
private _findAppHostForResource(element: ResourceItem): AppHostDisplayInfo | undefined {
diff --git a/extension/walkthrough/createProject.md b/extension/walkthrough/createProject.md
new file mode 100644
index 00000000000..7c471764c6d
--- /dev/null
+++ b/extension/walkthrough/createProject.md
@@ -0,0 +1,29 @@
+# Create your first Aspire app
+
+[Create a new Aspire project](command:aspire-vscode.new) to scaffold a new solution from a starter template.
+The starter template gives you:
+- An **apphost** that orchestrates your services, connections, and startup order
+- A sample **API service** with health checks
+- A **web frontend** that references the API
+
+**The apphost** is the heart of your app — it defines everything in code:
+
+```csharp
+var builder = DistributedApplication.CreateBuilder(args);
+var apiService = builder.AddProject("apiservice")
+ .WithHttpHealthCheck("/health");
+builder.AddProject("webfrontend")
+ .WithExternalHttpEndpoints()
+ .WithReference(apiService) // web app can call the API
+ .WaitFor(apiService); // start API first
+builder.Build().Run();
+```
+
+| Method | What it does |
+|---|---|
+| `AddProject` | Registers a service |
+| `WithReference` | Connects services |
+| `WaitFor` | Controls startup order |
+| `WithHttpHealthCheck` | Monitors health |
+
+Your application topology is defined in code, making it easy to understand, modify, and version control. [Learn more on aspire.dev](https://aspire.dev/get-started/first-app/)
diff --git a/extension/walkthrough/dashboard.md b/extension/walkthrough/dashboard.md
new file mode 100644
index 00000000000..910d92480d8
--- /dev/null
+++ b/extension/walkthrough/dashboard.md
@@ -0,0 +1,22 @@
+# The Aspire Dashboard
+
+The Aspire Dashboard gives you real-time visibility into your running application. It's also a lightweight [OpenTelemetry](https://opentelemetry.io/) viewer for any structured logs, metrics, or traces you have instrumented in your app.
+
+### What you'll see
+
+- **Resources** — all your services, containers, and executables with their current state
+- **Endpoints** — live URLs for each service
+- **Console Logs** — aggregated output from all services in one place
+- **Structured Logs** — searchable, structured log entries with OpenTelemetry
+- **Traces** — distributed traces showing request flow across services
+- **Metrics** — performance counters and custom metrics
+
+### Health monitoring
+
+Each resource shows its health status at a glance:
+
+- 🟢 **Running** — service is healthy
+- 🟡 **Starting** — service is spinning up
+- 🔴 **Failed** — something went wrong
+
+The dashboard launches automatically when you run your app and is accessible from a local URL in your terminal output.
diff --git a/extension/walkthrough/installCli.md b/extension/walkthrough/installCli.md
new file mode 100644
index 00000000000..30f0d823909
--- /dev/null
+++ b/extension/walkthrough/installCli.md
@@ -0,0 +1,27 @@
+# Install the Aspire CLI
+
+The Aspire CLI is a cross-platform tool that helps you create, run, and manage Aspire applications.
+
+### Latest release
+
+> [Run install in terminal](command:aspire-vscode.installCliStable)
+
+| Platform | Command |
+|----------|---------|
+| macOS / Linux | `curl -sSL https://aspire.dev/install.sh \| bash` |
+| Windows | `irm https://aspire.dev/install.ps1 \| iex` |
+
+### Daily build (preview)
+
+> [Run daily install in terminal](command:aspire-vscode.installCliDaily)
+
+| Platform | Command |
+|----------|---------|
+| macOS / Linux | `curl -sSL https://aspire.dev/install.sh \| bash -s -- -q dev` |
+| Windows | `iex "& { $(irm https://aspire.dev/install.ps1) } -Quality dev"` |
+
+### Verify
+
+After installing, click **Verify installation** in the sidebar or run `aspire --version`.
+
+> For more details, see the [Aspire CLI installation guide](https://aspire.dev/get-started/install-cli/).
diff --git a/extension/walkthrough/nextSteps.md b/extension/walkthrough/nextSteps.md
new file mode 100644
index 00000000000..47148ed3d1a
--- /dev/null
+++ b/extension/walkthrough/nextSteps.md
@@ -0,0 +1,28 @@
+# You're ready to build with Aspire!
+
+Here are some next steps to explore:
+
+### Add integrations
+
+Aspire has 40+ integrations for databases, message queues, cloud services, and more:
+
+- **Databases** — PostgreSQL, SQL Server, Redis, MongoDB, MySQL
+- **Messaging** — RabbitMQ, Kafka, Azure Service Bus
+- **Cloud** — Azure, AWS services
+- **Containers** — any OCI-compatible container image
+
+Use the **Aspire: Add an integration** command to browse and add integrations to your project.
+
+### Deploy your app
+
+When you're ready to go to production, use the **Aspire: Publish deployment artifacts** command to generate deployment manifests for your app.
+
+For a full walkthrough, see [Deploy your first app](https://aspire.dev/get-started/deploy-first-app/) on aspire.dev.
+
+### Learn more
+
+- [Aspire documentation](https://aspire.dev/docs/)
+- [Integration gallery](https://aspire.dev/integrations/gallery/)
+- [Dashboard overview](https://aspire.dev/dashboard/overview/)
+- [Deployment guide](https://aspire.dev/deployment/overview/)
+- [Community & Discord](https://discord.com/invite/raNPcaaSj8)
diff --git a/extension/walkthrough/runApp.md b/extension/walkthrough/runApp.md
new file mode 100644
index 00000000000..ce1a8bdecfa
--- /dev/null
+++ b/extension/walkthrough/runApp.md
@@ -0,0 +1,19 @@
+# Run your app
+
+Use the **Run apphost** or **Debug apphost** buttons in the sidebar, or run the commands from the Command Palette. You can also right-click an apphost in the Aspire view.
+
+When you run, the extension:
+1. Discovers the apphost project in your workspace
+2. Builds your solution
+3. Launches all services in the correct order
+4. Opens the **Aspire Dashboard** for real-time monitoring
+
+### Debugging
+When you **debug** instead of run, the extension attaches debuggers to your services automatically — set breakpoints in any project and they'll be hit as requests flow through your app.
+
+### The dashboard
+Once running, the dashboard shows all your resources, endpoints, logs, traces, and metrics in one place:
+
+
+
+To learn more, see the [Aspire Dashboard overview](https://aspire.dev/dashboard/overview/).
diff --git a/extension/walkthrough/welcome.md b/extension/walkthrough/welcome.md
new file mode 100644
index 00000000000..616bddce908
--- /dev/null
+++ b/extension/walkthrough/welcome.md
@@ -0,0 +1,26 @@
+# Welcome to Aspire
+
+Aspire streamlines building, running, debugging, and deploying distributed apps. Define your services, databases, and frontends in code — then launch and debug everything with a single command.
+
+### Key benefits
+
+- **Unified development experience** — launch and debug your entire distributed application with a single command
+- **Code-first configuration** — define your app's architecture in code, no complex config files required
+- **Local orchestration** — automatically handle service startup, dependencies, and connections during development
+- **Deployment flexibility** — deploy to Kubernetes, cloud providers, or your own servers using the same architecture definition
+- **Extensible** — integrate with your favorite tools and services through a rich ecosystem of [integrations](https://aspire.dev/integrations/gallery/)
+
+### How it works
+
+1. Define your services and their connections in an **apphost** project
+2. Run everything locally with a single command
+3. Monitor it all through the **Aspire Dashboard**
+4. Deploy the same architecture definition to production
+
+Aspire uses a code-first approach — your infrastructure definition lives alongside your code, with type safety, code completion, and version control built in.
+
+### Works with your stack
+
+Aspire is polyglot — it works with **C#**, **Python**, **JavaScript**, **TypeScript**, **Go**, **Java**, and more.
+
+[Learn more on aspire.dev](https://aspire.dev/docs/)
diff --git a/playground/Stress/Stress.AppHost/Program.cs b/playground/Stress/Stress.AppHost/Program.cs
index 001b0b673eb..f32a197eeec 100644
--- a/playground/Stress/Stress.AppHost/Program.cs
+++ b/playground/Stress/Stress.AppHost/Program.cs
@@ -112,7 +112,7 @@
displayName: "Stop all resources",
executeCommand: async (c) =>
{
- await ExecuteCommandForAllResourcesAsync(c.ServiceProvider, "resource-stop", c.CancellationToken);
+ await ExecuteCommandForAllResourcesAsync(c.ServiceProvider, KnownResourceCommands.StopCommand, c.CancellationToken);
return CommandResults.Success();
},
commandOptions: new() { IconName = "Stop", IconVariant = IconVariant.Filled })
@@ -121,7 +121,7 @@
displayName: "Start all resources",
executeCommand: async (c) =>
{
- await ExecuteCommandForAllResourcesAsync(c.ServiceProvider, "resource-start", c.CancellationToken);
+ await ExecuteCommandForAllResourcesAsync(c.ServiceProvider, KnownResourceCommands.StartCommand, c.CancellationToken);
return CommandResults.Success();
},
commandOptions: new() { IconName = "Play", IconVariant = IconVariant.Filled });
diff --git a/playground/polyglot/TypeScript/Aspire.Hosting.Azure.AppConfiguration/ValidationAppHost/.aspire/settings.json b/playground/polyglot/TypeScript/Aspire.Hosting.Azure.AppConfiguration/ValidationAppHost/.aspire/settings.json
new file mode 100644
index 00000000000..e8d1c41abd9
--- /dev/null
+++ b/playground/polyglot/TypeScript/Aspire.Hosting.Azure.AppConfiguration/ValidationAppHost/.aspire/settings.json
@@ -0,0 +1,7 @@
+{
+ "appHostPath": "../apphost.ts",
+ "language": "typescript/nodejs",
+ "packages": {
+ "Aspire.Hosting.Azure.AppConfiguration": ""
+ }
+}
diff --git a/playground/polyglot/TypeScript/Aspire.Hosting.Azure.AppConfiguration/ValidationAppHost/.modules/.codegen-hash b/playground/polyglot/TypeScript/Aspire.Hosting.Azure.AppConfiguration/ValidationAppHost/.modules/.codegen-hash
new file mode 100644
index 00000000000..693f53d00c7
--- /dev/null
+++ b/playground/polyglot/TypeScript/Aspire.Hosting.Azure.AppConfiguration/ValidationAppHost/.modules/.codegen-hash
@@ -0,0 +1 @@
+BBC4E06F9B0A1EED3C45E9F2D7F9252F4E5759D47A90F8507502F9A94CED3CFD
\ No newline at end of file
diff --git a/playground/polyglot/TypeScript/Aspire.Hosting.Azure.AppConfiguration/ValidationAppHost/.modules/aspire.ts b/playground/polyglot/TypeScript/Aspire.Hosting.Azure.AppConfiguration/ValidationAppHost/.modules/aspire.ts
new file mode 100644
index 00000000000..41222104634
--- /dev/null
+++ b/playground/polyglot/TypeScript/Aspire.Hosting.Azure.AppConfiguration/ValidationAppHost/.modules/aspire.ts
@@ -0,0 +1,6131 @@
+// aspire.ts - Capability-based Aspire SDK
+// This SDK uses the ATS (Aspire Type System) capability API.
+// Capabilities are endpoints like 'Aspire.Hosting/createBuilder'.
+//
+// GENERATED CODE - DO NOT EDIT
+
+import {
+ AspireClient as AspireClientRpc,
+ Handle,
+ MarshalledHandle,
+ CapabilityError,
+ registerCallback,
+ wrapIfHandle,
+ registerHandleWrapper
+} from './transport.js';
+
+import {
+ ResourceBuilderBase,
+ ReferenceExpression,
+ refExpr,
+ AspireDict,
+ AspireList
+} from './base.js';
+
+// ============================================================================
+// Handle Type Aliases (Internal - not exported to users)
+// ============================================================================
+
+/** Handle to AzureAppConfigurationEmulatorResource */
+type AzureAppConfigurationEmulatorResourceHandle = Handle<'Aspire.Hosting.Azure.AppConfiguration/Aspire.Hosting.Azure.AzureAppConfigurationEmulatorResource'>;
+
+/** Handle to AzureAppConfigurationResource */
+type AzureAppConfigurationResourceHandle = Handle<'Aspire.Hosting.Azure.AppConfiguration/Aspire.Hosting.Azure.AzureAppConfigurationResource'>;
+
+/** Handle to CommandLineArgsCallbackContext */
+type CommandLineArgsCallbackContextHandle = Handle<'Aspire.Hosting/Aspire.Hosting.ApplicationModel.CommandLineArgsCallbackContext'>;
+
+/** Handle to ContainerResource */
+type ContainerResourceHandle = Handle<'Aspire.Hosting/Aspire.Hosting.ApplicationModel.ContainerResource'>;
+
+/** Handle to EndpointReference */
+type EndpointReferenceHandle = Handle<'Aspire.Hosting/Aspire.Hosting.ApplicationModel.EndpointReference'>;
+
+/** Handle to EndpointReferenceExpression */
+type EndpointReferenceExpressionHandle = Handle<'Aspire.Hosting/Aspire.Hosting.ApplicationModel.EndpointReferenceExpression'>;
+
+/** Handle to EnvironmentCallbackContext */
+type EnvironmentCallbackContextHandle = Handle<'Aspire.Hosting/Aspire.Hosting.ApplicationModel.EnvironmentCallbackContext'>;
+
+/** Handle to ExecutableResource */
+type ExecutableResourceHandle = Handle<'Aspire.Hosting/Aspire.Hosting.ApplicationModel.ExecutableResource'>;
+
+/** Handle to ExecuteCommandContext */
+type ExecuteCommandContextHandle = Handle<'Aspire.Hosting/Aspire.Hosting.ApplicationModel.ExecuteCommandContext'>;
+
+/** Handle to IResource */
+type IResourceHandle = Handle<'Aspire.Hosting/Aspire.Hosting.ApplicationModel.IResource'>;
+
+/** Handle to IResourceWithArgs */
+type IResourceWithArgsHandle = Handle<'Aspire.Hosting/Aspire.Hosting.ApplicationModel.IResourceWithArgs'>;
+
+/** Handle to IResourceWithConnectionString */
+type IResourceWithConnectionStringHandle = Handle<'Aspire.Hosting/Aspire.Hosting.ApplicationModel.IResourceWithConnectionString'>;
+
+/** Handle to IResourceWithEndpoints */
+type IResourceWithEndpointsHandle = Handle<'Aspire.Hosting/Aspire.Hosting.ApplicationModel.IResourceWithEndpoints'>;
+
+/** Handle to IResourceWithEnvironment */
+type IResourceWithEnvironmentHandle = Handle<'Aspire.Hosting/Aspire.Hosting.ApplicationModel.IResourceWithEnvironment'>;
+
+/** Handle to IResourceWithWaitSupport */
+type IResourceWithWaitSupportHandle = Handle<'Aspire.Hosting/Aspire.Hosting.ApplicationModel.IResourceWithWaitSupport'>;
+
+/** Handle to ParameterResource */
+type ParameterResourceHandle = Handle<'Aspire.Hosting/Aspire.Hosting.ApplicationModel.ParameterResource'>;
+
+/** Handle to ProjectResource */
+type ProjectResourceHandle = Handle<'Aspire.Hosting/Aspire.Hosting.ApplicationModel.ProjectResource'>;
+
+/** Handle to ReferenceExpression */
+type ReferenceExpressionHandle = Handle<'Aspire.Hosting/Aspire.Hosting.ApplicationModel.ReferenceExpression'>;
+
+/** Handle to ResourceLoggerService */
+type ResourceLoggerServiceHandle = Handle<'Aspire.Hosting/Aspire.Hosting.ApplicationModel.ResourceLoggerService'>;
+
+/** Handle to ResourceNotificationService */
+type ResourceNotificationServiceHandle = Handle<'Aspire.Hosting/Aspire.Hosting.ApplicationModel.ResourceNotificationService'>;
+
+/** Handle to ResourceUrlsCallbackContext */
+type ResourceUrlsCallbackContextHandle = Handle<'Aspire.Hosting/Aspire.Hosting.ApplicationModel.ResourceUrlsCallbackContext'>;
+
+/** Handle to DistributedApplication */
+type DistributedApplicationHandle = Handle<'Aspire.Hosting/Aspire.Hosting.DistributedApplication'>;
+
+/** Handle to DistributedApplicationExecutionContext */
+type DistributedApplicationExecutionContextHandle = Handle<'Aspire.Hosting/Aspire.Hosting.DistributedApplicationExecutionContext'>;
+
+/** Handle to DistributedApplicationEventSubscription */
+type DistributedApplicationEventSubscriptionHandle = Handle<'Aspire.Hosting/Aspire.Hosting.Eventing.DistributedApplicationEventSubscription'>;
+
+/** Handle to IDistributedApplicationEventing */
+type IDistributedApplicationEventingHandle = Handle<'Aspire.Hosting/Aspire.Hosting.Eventing.IDistributedApplicationEventing'>;
+
+/** Handle to IDistributedApplicationBuilder */
+type IDistributedApplicationBuilderHandle = Handle<'Aspire.Hosting/Aspire.Hosting.IDistributedApplicationBuilder'>;
+
+/** Handle to IResourceWithServiceDiscovery */
+type IResourceWithServiceDiscoveryHandle = Handle<'Aspire.Hosting/Aspire.Hosting.IResourceWithServiceDiscovery'>;
+
+/** Handle to Dict */
+type DictstringanyHandle = Handle<'Aspire.Hosting/Dict'>;
+
+/** Handle to List */
+type ListanyHandle = Handle<'Aspire.Hosting/List'>;
+
+/** Handle to IConfiguration */
+type IConfigurationHandle = Handle<'Microsoft.Extensions.Configuration.Abstractions/Microsoft.Extensions.Configuration.IConfiguration'>;
+
+/** Handle to IHostEnvironment */
+type IHostEnvironmentHandle = Handle<'Microsoft.Extensions.Hosting.Abstractions/Microsoft.Extensions.Hosting.IHostEnvironment'>;
+
+/** Handle to ILogger */
+type ILoggerHandle = Handle<'Microsoft.Extensions.Logging.Abstractions/Microsoft.Extensions.Logging.ILogger'>;
+
+/** Handle to string[] */
+type stringArrayHandle = Handle<'string[]'>;
+
+/** Handle to IServiceProvider */
+type IServiceProviderHandle = Handle<'System.ComponentModel/System.IServiceProvider'>;
+
+// ============================================================================
+// Enum Types
+// ============================================================================
+
+/** Enum type for AzureAppConfigurationRole */
+export enum AzureAppConfigurationRole {
+ AppConfigurationDataOwner = "AppConfigurationDataOwner",
+ AppConfigurationDataReader = "AppConfigurationDataReader",
+}
+
+/** Enum type for ContainerLifetime */
+export enum ContainerLifetime {
+ Session = "Session",
+ Persistent = "Persistent",
+}
+
+/** Enum type for DistributedApplicationOperation */
+export enum DistributedApplicationOperation {
+ Run = "Run",
+ Publish = "Publish",
+}
+
+/** Enum type for EndpointProperty */
+export enum EndpointProperty {
+ Url = "Url",
+ Host = "Host",
+ IPV4Host = "IPV4Host",
+ Port = "Port",
+ Scheme = "Scheme",
+ TargetPort = "TargetPort",
+ HostAndPort = "HostAndPort",
+}
+
+/** Enum type for IconVariant */
+export enum IconVariant {
+ Regular = "Regular",
+ Filled = "Filled",
+}
+
+/** Enum type for ImagePullPolicy */
+export enum ImagePullPolicy {
+ Default = "Default",
+ Always = "Always",
+ Missing = "Missing",
+ Never = "Never",
+}
+
+/** Enum type for ProtocolType */
+export enum ProtocolType {
+ IP = "IP",
+ IPv6HopByHopOptions = "IPv6HopByHopOptions",
+ Unspecified = "Unspecified",
+ Icmp = "Icmp",
+ Igmp = "Igmp",
+ Ggp = "Ggp",
+ IPv4 = "IPv4",
+ Tcp = "Tcp",
+ Pup = "Pup",
+ Udp = "Udp",
+ Idp = "Idp",
+ IPv6 = "IPv6",
+ IPv6RoutingHeader = "IPv6RoutingHeader",
+ IPv6FragmentHeader = "IPv6FragmentHeader",
+ IPSecEncapsulatingSecurityPayload = "IPSecEncapsulatingSecurityPayload",
+ IPSecAuthenticationHeader = "IPSecAuthenticationHeader",
+ IcmpV6 = "IcmpV6",
+ IPv6NoNextHeader = "IPv6NoNextHeader",
+ IPv6DestinationOptions = "IPv6DestinationOptions",
+ ND = "ND",
+ Raw = "Raw",
+ Ipx = "Ipx",
+ Spx = "Spx",
+ SpxII = "SpxII",
+ Unknown = "Unknown",
+}
+
+/** Enum type for UrlDisplayLocation */
+export enum UrlDisplayLocation {
+ SummaryAndDetails = "SummaryAndDetails",
+ DetailsOnly = "DetailsOnly",
+}
+
+// ============================================================================
+// DTO Interfaces
+// ============================================================================
+
+/** DTO interface for CommandOptions */
+export interface CommandOptions {
+ description?: string;
+ parameter?: any;
+ confirmationMessage?: string;
+ iconName?: string;
+ iconVariant?: IconVariant;
+ isHighlighted?: boolean;
+ updateState?: any;
+}
+
+/** DTO interface for CreateBuilderOptions */
+export interface CreateBuilderOptions {
+ args?: string[];
+ projectDirectory?: string;
+ appHostFilePath?: string;
+ containerRegistryOverride?: string;
+ disableDashboard?: boolean;
+ dashboardApplicationName?: string;
+ allowUnsecuredTransport?: boolean;
+ enableResourceLogging?: boolean;
+}
+
+/** DTO interface for ExecuteCommandResult */
+export interface ExecuteCommandResult {
+ success?: boolean;
+ canceled?: boolean;
+ errorMessage?: string;
+}
+
+/** DTO interface for ResourceEventDto */
+export interface ResourceEventDto {
+ resourceName?: string;
+ resourceId?: string;
+ state?: string;
+ stateStyle?: string;
+ healthStatus?: string;
+ exitCode?: number;
+}
+
+/** DTO interface for ResourceUrlAnnotation */
+export interface ResourceUrlAnnotation {
+ url?: string;
+ displayText?: string;
+ endpoint?: EndpointReferenceHandle;
+ displayLocation?: UrlDisplayLocation;
+}
+
+// ============================================================================
+// Options Interfaces
+// ============================================================================
+
+export interface AddConnectionStringOptions {
+ environmentVariableName?: string;
+}
+
+export interface AddParameterOptions {
+ secret?: boolean;
+}
+
+export interface GetValueAsyncOptions {
+ cancellationToken?: AbortSignal;
+}
+
+export interface RunAsEmulatorOptions {
+ configureEmulator?: (obj: AzureAppConfigurationEmulatorResource) => Promise;
+}
+
+export interface RunOptions {
+ cancellationToken?: AbortSignal;
+}
+
+export interface WaitForCompletionOptions {
+ exitCode?: number;
+}
+
+export interface WithBindMountOptions {
+ isReadOnly?: boolean;
+}
+
+export interface WithCommandOptions {
+ commandOptions?: CommandOptions;
+}
+
+export interface WithDataBindMountOptions {
+ path?: string;
+}
+
+export interface WithDataVolumeOptions {
+ name?: string;
+}
+
+export interface WithDescriptionOptions {
+ enableMarkdown?: boolean;
+}
+
+export interface WithEndpointOptions {
+ port?: number;
+ targetPort?: number;
+ scheme?: string;
+ name?: string;
+ env?: string;
+ isProxied?: boolean;
+ isExternal?: boolean;
+ protocol?: ProtocolType;
+}
+
+export interface WithHostPortOptions {
+ port?: number;
+}
+
+export interface WithHttpEndpointOptions {
+ port?: number;
+ targetPort?: number;
+ name?: string;
+ env?: string;
+ isProxied?: boolean;
+}
+
+export interface WithHttpHealthCheckOptions {
+ path?: string;
+ statusCode?: number;
+ endpointName?: string;
+}
+
+export interface WithHttpsEndpointOptions {
+ port?: number;
+ targetPort?: number;
+ name?: string;
+ env?: string;
+ isProxied?: boolean;
+}
+
+export interface WithImageOptions {
+ tag?: string;
+}
+
+export interface WithReferenceOptions {
+ connectionName?: string;
+ optional?: boolean;
+}
+
+export interface WithUrlExpressionOptions {
+ displayText?: string;
+}
+
+export interface WithUrlOptions {
+ displayText?: string;
+}
+
+export interface WithVolumeOptions {
+ name?: string;
+ isReadOnly?: boolean;
+}
+
+// ============================================================================
+// CommandLineArgsCallbackContext
+// ============================================================================
+
+/**
+ * Type class for CommandLineArgsCallbackContext.
+ */
+export class CommandLineArgsCallbackContext {
+ constructor(private _handle: CommandLineArgsCallbackContextHandle, private _client: AspireClientRpc) {}
+
+ /** Serialize for JSON-RPC transport */
+ toJSON(): MarshalledHandle { return this._handle.toJSON(); }
+
+ /** Gets the Args property */
+ private _args?: AspireList;
+ get args(): AspireList {
+ if (!this._args) {
+ this._args = new AspireList(
+ this._handle,
+ this._client,
+ 'Aspire.Hosting.ApplicationModel/CommandLineArgsCallbackContext.args',
+ 'Aspire.Hosting.ApplicationModel/CommandLineArgsCallbackContext.args'
+ );
+ }
+ return this._args;
+ }
+
+ /** Gets the CancellationToken property */
+ cancellationToken = {
+ get: async (): Promise => {
+ return await this._client.invokeCapability(
+ 'Aspire.Hosting.ApplicationModel/CommandLineArgsCallbackContext.cancellationToken',
+ { context: this._handle }
+ );
+ },
+ };
+
+ /** Gets the ExecutionContext property */
+ executionContext = {
+ get: async (): Promise => {
+ const handle = await this._client.invokeCapability(
+ 'Aspire.Hosting.ApplicationModel/CommandLineArgsCallbackContext.executionContext',
+ { context: this._handle }
+ );
+ return new DistributedApplicationExecutionContext(handle, this._client);
+ },
+ };
+
+}
+
+// ============================================================================
+// DistributedApplication
+// ============================================================================
+
+/**
+ * Type class for DistributedApplication.
+ */
+export class DistributedApplication {
+ constructor(private _handle: DistributedApplicationHandle, private _client: AspireClientRpc) {}
+
+ /** Serialize for JSON-RPC transport */
+ toJSON(): MarshalledHandle { return this._handle.toJSON(); }
+
+ /** Runs the distributed application */
+ /** @internal */
+ async _runInternal(cancellationToken?: AbortSignal): Promise {
+ const rpcArgs: Record = { context: this._handle };
+ if (cancellationToken !== undefined) rpcArgs.cancellationToken = cancellationToken;
+ await this._client.invokeCapability(
+ 'Aspire.Hosting/run',
+ rpcArgs
+ );
+ return this;
+ }
+
+ run(options?: RunOptions): DistributedApplicationPromise {
+ const cancellationToken = options?.cancellationToken;
+ return new DistributedApplicationPromise(this._runInternal(cancellationToken));
+ }
+
+}
+
+/**
+ * Thenable wrapper for DistributedApplication that enables fluent chaining.
+ */
+export class DistributedApplicationPromise implements PromiseLike {
+ constructor(private _promise: Promise) {}
+
+ then(
+ onfulfilled?: ((value: DistributedApplication) => TResult1 | PromiseLike) | null,
+ onrejected?: ((reason: unknown) => TResult2 | PromiseLike) | null
+ ): PromiseLike {
+ return this._promise.then(onfulfilled, onrejected);
+ }
+
+ /** Runs the distributed application */
+ run(options?: RunOptions): DistributedApplicationPromise {
+ return new DistributedApplicationPromise(this._promise.then(obj => obj.run(options)));
+ }
+
+}
+
+// ============================================================================
+// DistributedApplicationExecutionContext
+// ============================================================================
+
+/**
+ * Type class for DistributedApplicationExecutionContext.
+ */
+export class DistributedApplicationExecutionContext {
+ constructor(private _handle: DistributedApplicationExecutionContextHandle, private _client: AspireClientRpc) {}
+
+ /** Serialize for JSON-RPC transport */
+ toJSON(): MarshalledHandle { return this._handle.toJSON(); }
+
+ /** Gets the PublisherName property */
+ publisherName = {
+ get: async (): Promise => {
+ return await this._client.invokeCapability(
+ 'Aspire.Hosting/DistributedApplicationExecutionContext.publisherName',
+ { context: this._handle }
+ );
+ },
+ set: async (value: string): Promise => {
+ await this._client.invokeCapability(
+ 'Aspire.Hosting/DistributedApplicationExecutionContext.setPublisherName',
+ { context: this._handle, value }
+ );
+ }
+ };
+
+ /** Gets the Operation property */
+ operation = {
+ get: async (): Promise => {
+ return await this._client.invokeCapability(
+ 'Aspire.Hosting/DistributedApplicationExecutionContext.operation',
+ { context: this._handle }
+ );
+ },
+ };
+
+ /** Gets the IsPublishMode property */
+ isPublishMode = {
+ get: async (): Promise => {
+ return await this._client.invokeCapability(
+ 'Aspire.Hosting/DistributedApplicationExecutionContext.isPublishMode',
+ { context: this._handle }
+ );
+ },
+ };
+
+ /** Gets the IsRunMode property */
+ isRunMode = {
+ get: async (): Promise => {
+ return await this._client.invokeCapability(
+ 'Aspire.Hosting/DistributedApplicationExecutionContext.isRunMode',
+ { context: this._handle }
+ );
+ },
+ };
+
+}
+
+// ============================================================================
+// EndpointReference
+// ============================================================================
+
+/**
+ * Type class for EndpointReference.
+ */
+export class EndpointReference {
+ constructor(private _handle: EndpointReferenceHandle, private _client: AspireClientRpc) {}
+
+ /** Serialize for JSON-RPC transport */
+ toJSON(): MarshalledHandle { return this._handle.toJSON(); }
+
+ /** Gets the EndpointName property */
+ endpointName = {
+ get: async (): Promise => {
+ return await this._client.invokeCapability(
+ 'Aspire.Hosting.ApplicationModel/EndpointReference.endpointName',
+ { context: this._handle }
+ );
+ },
+ };
+
+ /** Gets the ErrorMessage property */
+ errorMessage = {
+ get: async (): Promise => {
+ return await this._client.invokeCapability(
+ 'Aspire.Hosting.ApplicationModel/EndpointReference.errorMessage',
+ { context: this._handle }
+ );
+ },
+ set: async (value: string): Promise => {
+ await this._client.invokeCapability(
+ 'Aspire.Hosting.ApplicationModel/EndpointReference.setErrorMessage',
+ { context: this._handle, value }
+ );
+ }
+ };
+
+ /** Gets the IsAllocated property */
+ isAllocated = {
+ get: async (): Promise => {
+ return await this._client.invokeCapability(
+ 'Aspire.Hosting.ApplicationModel/EndpointReference.isAllocated',
+ { context: this._handle }
+ );
+ },
+ };
+
+ /** Gets the Exists property */
+ exists = {
+ get: async (): Promise => {
+ return await this._client.invokeCapability(
+ 'Aspire.Hosting.ApplicationModel/EndpointReference.exists',
+ { context: this._handle }
+ );
+ },
+ };
+
+ /** Gets the IsHttp property */
+ isHttp = {
+ get: async (): Promise => {
+ return await this._client.invokeCapability(
+ 'Aspire.Hosting.ApplicationModel/EndpointReference.isHttp',
+ { context: this._handle }
+ );
+ },
+ };
+
+ /** Gets the IsHttps property */
+ isHttps = {
+ get: async (): Promise => {
+ return await this._client.invokeCapability(
+ 'Aspire.Hosting.ApplicationModel/EndpointReference.isHttps',
+ { context: this._handle }
+ );
+ },
+ };
+
+ /** Gets the Port property */
+ port = {
+ get: async (): Promise => {
+ return await this._client.invokeCapability(
+ 'Aspire.Hosting.ApplicationModel/EndpointReference.port',
+ { context: this._handle }
+ );
+ },
+ };
+
+ /** Gets the TargetPort property */
+ targetPort = {
+ get: async (): Promise => {
+ return await this._client.invokeCapability(
+ 'Aspire.Hosting.ApplicationModel/EndpointReference.targetPort',
+ { context: this._handle }
+ );
+ },
+ };
+
+ /** Gets the Host property */
+ host = {
+ get: async (): Promise => {
+ return await this._client.invokeCapability(
+ 'Aspire.Hosting.ApplicationModel/EndpointReference.host',
+ { context: this._handle }
+ );
+ },
+ };
+
+ /** Gets the Scheme property */
+ scheme = {
+ get: async (): Promise => {
+ return await this._client.invokeCapability(
+ 'Aspire.Hosting.ApplicationModel/EndpointReference.scheme',
+ { context: this._handle }
+ );
+ },
+ };
+
+ /** Gets the Url property */
+ url = {
+ get: async (): Promise => {
+ return await this._client.invokeCapability(
+ 'Aspire.Hosting.ApplicationModel/EndpointReference.url',
+ { context: this._handle }
+ );
+ },
+ };
+
+ /** Gets the URL of the endpoint asynchronously */
+ async getValueAsync(options?: GetValueAsyncOptions): Promise {
+ const cancellationToken = options?.cancellationToken;
+ const rpcArgs: Record = { context: this._handle };
+ if (cancellationToken !== undefined) rpcArgs.cancellationToken = cancellationToken;
+ return await this._client.invokeCapability(
+ 'Aspire.Hosting.ApplicationModel/getValueAsync',
+ rpcArgs
+ );
+ }
+
+}
+
+/**
+ * Thenable wrapper for EndpointReference that enables fluent chaining.
+ */
+export class EndpointReferencePromise implements PromiseLike {
+ constructor(private _promise: Promise) {}
+
+ then(
+ onfulfilled?: ((value: EndpointReference) => TResult1 | PromiseLike) | null,
+ onrejected?: ((reason: unknown) => TResult2 | PromiseLike) | null
+ ): PromiseLike {
+ return this._promise.then(onfulfilled, onrejected);
+ }
+
+ /** Gets the URL of the endpoint asynchronously */
+ getValueAsync(options?: GetValueAsyncOptions): Promise {
+ return this._promise.then(obj => obj.getValueAsync(options));
+ }
+
+}
+
+// ============================================================================
+// EndpointReferenceExpression
+// ============================================================================
+
+/**
+ * Type class for EndpointReferenceExpression.
+ */
+export class EndpointReferenceExpression {
+ constructor(private _handle: EndpointReferenceExpressionHandle, private _client: AspireClientRpc) {}
+
+ /** Serialize for JSON-RPC transport */
+ toJSON(): MarshalledHandle { return this._handle.toJSON(); }
+
+ /** Gets the Endpoint property */
+ endpoint = {
+ get: async (): Promise => {
+ const handle = await this._client.invokeCapability(
+ 'Aspire.Hosting.ApplicationModel/EndpointReferenceExpression.endpoint',
+ { context: this._handle }
+ );
+ return new EndpointReference(handle, this._client);
+ },
+ };
+
+ /** Gets the Property property */
+ property = {
+ get: async (): Promise => {
+ return await this._client.invokeCapability(
+ 'Aspire.Hosting.ApplicationModel/EndpointReferenceExpression.property',
+ { context: this._handle }
+ );
+ },
+ };
+
+ /** Gets the ValueExpression property */
+ valueExpression = {
+ get: async (): Promise => {
+ return await this._client.invokeCapability(
+ 'Aspire.Hosting.ApplicationModel/EndpointReferenceExpression.valueExpression',
+ { context: this._handle }
+ );
+ },
+ };
+
+}
+
+// ============================================================================
+// EnvironmentCallbackContext
+// ============================================================================
+
+/**
+ * Type class for EnvironmentCallbackContext.
+ */
+export class EnvironmentCallbackContext {
+ constructor(private _handle: EnvironmentCallbackContextHandle, private _client: AspireClientRpc) {}
+
+ /** Serialize for JSON-RPC transport */
+ toJSON(): MarshalledHandle { return this._handle.toJSON(); }
+
+ /** Gets the EnvironmentVariables property */
+ private _environmentVariables?: AspireDict;
+ get environmentVariables(): AspireDict {
+ if (!this._environmentVariables) {
+ this._environmentVariables = new AspireDict(
+ this._handle,
+ this._client,
+ 'Aspire.Hosting.ApplicationModel/EnvironmentCallbackContext.environmentVariables',
+ 'Aspire.Hosting.ApplicationModel/EnvironmentCallbackContext.environmentVariables'
+ );
+ }
+ return this._environmentVariables;
+ }
+
+ /** Gets the CancellationToken property */
+ cancellationToken = {
+ get: async (): Promise => {
+ return await this._client.invokeCapability(
+ 'Aspire.Hosting.ApplicationModel/EnvironmentCallbackContext.cancellationToken',
+ { context: this._handle }
+ );
+ },
+ };
+
+ /** Gets the ExecutionContext property */
+ executionContext = {
+ get: async (): Promise => {
+ const handle = await this._client.invokeCapability(
+ 'Aspire.Hosting.ApplicationModel/EnvironmentCallbackContext.executionContext',
+ { context: this._handle }
+ );
+ return new DistributedApplicationExecutionContext(handle, this._client);
+ },
+ };
+
+}
+
+// ============================================================================
+// ExecuteCommandContext
+// ============================================================================
+
+/**
+ * Type class for ExecuteCommandContext.
+ */
+export class ExecuteCommandContext {
+ constructor(private _handle: ExecuteCommandContextHandle, private _client: AspireClientRpc) {}
+
+ /** Serialize for JSON-RPC transport */
+ toJSON(): MarshalledHandle { return this._handle.toJSON(); }
+
+ /** Gets the ResourceName property */
+ resourceName = {
+ get: async (): Promise => {
+ return await this._client.invokeCapability(
+ 'Aspire.Hosting.ApplicationModel/ExecuteCommandContext.resourceName',
+ { context: this._handle }
+ );
+ },
+ set: async (value: string): Promise => {
+ await this._client.invokeCapability(
+ 'Aspire.Hosting.ApplicationModel/ExecuteCommandContext.setResourceName',
+ { context: this._handle, value }
+ );
+ }
+ };
+
+ /** Gets the CancellationToken property */
+ cancellationToken = {
+ get: async (): Promise => {
+ return await this._client.invokeCapability(
+ 'Aspire.Hosting.ApplicationModel/ExecuteCommandContext.cancellationToken',
+ { context: this._handle }
+ );
+ },
+ set: async (value: AbortSignal): Promise => {
+ await this._client.invokeCapability(
+ 'Aspire.Hosting.ApplicationModel/ExecuteCommandContext.setCancellationToken',
+ { context: this._handle, value }
+ );
+ }
+ };
+
+}
+
+// ============================================================================
+// ResourceUrlsCallbackContext
+// ============================================================================
+
+/**
+ * Type class for ResourceUrlsCallbackContext.
+ */
+export class ResourceUrlsCallbackContext {
+ constructor(private _handle: ResourceUrlsCallbackContextHandle, private _client: AspireClientRpc) {}
+
+ /** Serialize for JSON-RPC transport */
+ toJSON(): MarshalledHandle { return this._handle.toJSON(); }
+
+ /** Gets the Urls property */
+ private _urls?: AspireList;
+ get urls(): AspireList {
+ if (!this._urls) {
+ this._urls = new AspireList(
+ this._handle,
+ this._client,
+ 'Aspire.Hosting.ApplicationModel/ResourceUrlsCallbackContext.urls',
+ 'Aspire.Hosting.ApplicationModel/ResourceUrlsCallbackContext.urls'
+ );
+ }
+ return this._urls;
+ }
+
+ /** Gets the CancellationToken property */
+ cancellationToken = {
+ get: async (): Promise => {
+ return await this._client.invokeCapability(
+ 'Aspire.Hosting.ApplicationModel/ResourceUrlsCallbackContext.cancellationToken',
+ { context: this._handle }
+ );
+ },
+ };
+
+ /** Gets the ExecutionContext property */
+ executionContext = {
+ get: async (): Promise => {
+ const handle = await this._client.invokeCapability(
+ 'Aspire.Hosting.ApplicationModel/ResourceUrlsCallbackContext.executionContext',
+ { context: this._handle }
+ );
+ return new DistributedApplicationExecutionContext(handle, this._client);
+ },
+ };
+
+}
+
+// ============================================================================
+// DistributedApplicationBuilder
+// ============================================================================
+
+/**
+ * Type class for DistributedApplicationBuilder.
+ */
+export class DistributedApplicationBuilder {
+ constructor(private _handle: IDistributedApplicationBuilderHandle, private _client: AspireClientRpc) {}
+
+ /** Serialize for JSON-RPC transport */
+ toJSON(): MarshalledHandle { return this._handle.toJSON(); }
+
+ /** Gets the AppHostDirectory property */
+ appHostDirectory = {
+ get: async (): Promise => {
+ return await this._client.invokeCapability(
+ 'Aspire.Hosting/IDistributedApplicationBuilder.appHostDirectory',
+ { context: this._handle }
+ );
+ },
+ };
+
+ /** Gets the Eventing property */
+ eventing = {
+ get: async (): Promise => {
+ const handle = await this._client.invokeCapability(
+ 'Aspire.Hosting/IDistributedApplicationBuilder.eventing',
+ { context: this._handle }
+ );
+ return new DistributedApplicationEventing(handle, this._client);
+ },
+ };
+
+ /** Gets the ExecutionContext property */
+ executionContext = {
+ get: async (): Promise => {
+ const handle = await this._client.invokeCapability(
+ 'Aspire.Hosting/IDistributedApplicationBuilder.executionContext',
+ { context: this._handle }
+ );
+ return new DistributedApplicationExecutionContext(handle, this._client);
+ },
+ };
+
+ /** Builds the distributed application */
+ /** @internal */
+ async _buildInternal(): Promise {
+ const rpcArgs: Record = { context: this._handle };
+ const result = await this._client.invokeCapability(
+ 'Aspire.Hosting/build',
+ rpcArgs
+ );
+ return new DistributedApplication(result, this._client);
+ }
+
+ build(): DistributedApplicationPromise {
+ return new DistributedApplicationPromise(this._buildInternal());
+ }
+
+ /** Adds a container resource */
+ /** @internal */
+ async _addContainerInternal(name: string, image: string): Promise {
+ const rpcArgs: Record = { builder: this._handle, name, image };
+ const result = await this._client.invokeCapability(
+ 'Aspire.Hosting/addContainer',
+ rpcArgs
+ );
+ return new ContainerResource(result, this._client);
+ }
+
+ addContainer(name: string, image: string): ContainerResourcePromise {
+ return new ContainerResourcePromise(this._addContainerInternal(name, image));
+ }
+
+ /** Adds an executable resource */
+ /** @internal */
+ async _addExecutableInternal(name: string, command: string, workingDirectory: string, args: string[]): Promise {
+ const rpcArgs: Record = { builder: this._handle, name, command, workingDirectory, args };
+ const result = await this._client.invokeCapability(
+ 'Aspire.Hosting/addExecutable',
+ rpcArgs
+ );
+ return new ExecutableResource(result, this._client);
+ }
+
+ addExecutable(name: string, command: string, workingDirectory: string, args: string[]): ExecutableResourcePromise {
+ return new ExecutableResourcePromise(this._addExecutableInternal(name, command, workingDirectory, args));
+ }
+
+ /** Adds a parameter resource */
+ /** @internal */
+ async _addParameterInternal(name: string, secret?: boolean): Promise {
+ const rpcArgs: Record = { builder: this._handle, name };
+ if (secret !== undefined) rpcArgs.secret = secret;
+ const result = await this._client.invokeCapability(
+ 'Aspire.Hosting/addParameter',
+ rpcArgs
+ );
+ return new ParameterResource(result, this._client);
+ }
+
+ addParameter(name: string, options?: AddParameterOptions): ParameterResourcePromise {
+ const secret = options?.secret;
+ return new ParameterResourcePromise(this._addParameterInternal(name, secret));
+ }
+
+ /** Adds a connection string resource */
+ /** @internal */
+ async _addConnectionStringInternal(name: string, environmentVariableName?: string): Promise {
+ const rpcArgs: Record = { builder: this._handle, name };
+ if (environmentVariableName !== undefined) rpcArgs.environmentVariableName = environmentVariableName;
+ const result = await this._client.invokeCapability(
+ 'Aspire.Hosting/addConnectionString',
+ rpcArgs
+ );
+ return new ResourceWithConnectionString(result, this._client);
+ }
+
+ addConnectionString(name: string, options?: AddConnectionStringOptions): ResourceWithConnectionStringPromise {
+ const environmentVariableName = options?.environmentVariableName;
+ return new ResourceWithConnectionStringPromise(this._addConnectionStringInternal(name, environmentVariableName));
+ }
+
+ /** Adds a .NET project resource */
+ /** @internal */
+ async _addProjectInternal(name: string, projectPath: string, launchProfileName: string): Promise {
+ const rpcArgs: Record = { builder: this._handle, name, projectPath, launchProfileName };
+ const result = await this._client.invokeCapability(
+ 'Aspire.Hosting/addProject',
+ rpcArgs
+ );
+ return new ProjectResource(result, this._client);
+ }
+
+ addProject(name: string, projectPath: string, launchProfileName: string): ProjectResourcePromise {
+ return new ProjectResourcePromise(this._addProjectInternal(name, projectPath, launchProfileName));
+ }
+
+ /** Adds an Azure App Configuration resource */
+ /** @internal */
+ async _addAzureAppConfigurationInternal(name: string): Promise {
+ const rpcArgs: Record = { builder: this._handle, name };
+ const result = await this._client.invokeCapability(
+ 'Aspire.Hosting.Azure.AppConfiguration/addAzureAppConfiguration',
+ rpcArgs
+ );
+ return new AzureAppConfigurationResource(result, this._client);
+ }
+
+ addAzureAppConfiguration(name: string): AzureAppConfigurationResourcePromise {
+ return new AzureAppConfigurationResourcePromise(this._addAzureAppConfigurationInternal(name));
+ }
+
+}
+
+/**
+ * Thenable wrapper for DistributedApplicationBuilder that enables fluent chaining.
+ */
+export class DistributedApplicationBuilderPromise implements PromiseLike {
+ constructor(private _promise: Promise) {}
+
+ then(
+ onfulfilled?: ((value: DistributedApplicationBuilder) => TResult1 | PromiseLike) | null,
+ onrejected?: ((reason: unknown) => TResult2 | PromiseLike) | null
+ ): PromiseLike {
+ return this._promise.then(onfulfilled, onrejected);
+ }
+
+ /** Builds the distributed application */
+ build(): DistributedApplicationPromise {
+ return new DistributedApplicationPromise(this._promise.then(obj => obj.build()));
+ }
+
+ /** Adds a container resource */
+ addContainer(name: string, image: string): ContainerResourcePromise {
+ return new ContainerResourcePromise(this._promise.then(obj => obj.addContainer(name, image)));
+ }
+
+ /** Adds an executable resource */
+ addExecutable(name: string, command: string, workingDirectory: string, args: string[]): ExecutableResourcePromise {
+ return new ExecutableResourcePromise(this._promise.then(obj => obj.addExecutable(name, command, workingDirectory, args)));
+ }
+
+ /** Adds a parameter resource */
+ addParameter(name: string, options?: AddParameterOptions): ParameterResourcePromise {
+ return new ParameterResourcePromise(this._promise.then(obj => obj.addParameter(name, options)));
+ }
+
+ /** Adds a connection string resource */
+ addConnectionString(name: string, options?: AddConnectionStringOptions): ResourceWithConnectionStringPromise {
+ return new ResourceWithConnectionStringPromise(this._promise.then(obj => obj.addConnectionString(name, options)));
+ }
+
+ /** Adds a .NET project resource */
+ addProject(name: string, projectPath: string, launchProfileName: string): ProjectResourcePromise {
+ return new ProjectResourcePromise(this._promise.then(obj => obj.addProject(name, projectPath, launchProfileName)));
+ }
+
+ /** Adds an Azure App Configuration resource */
+ addAzureAppConfiguration(name: string): AzureAppConfigurationResourcePromise {
+ return new AzureAppConfigurationResourcePromise(this._promise.then(obj => obj.addAzureAppConfiguration(name)));
+ }
+
+}
+
+// ============================================================================
+// DistributedApplicationEventing
+// ============================================================================
+
+/**
+ * Type class for DistributedApplicationEventing.
+ */
+export class DistributedApplicationEventing {
+ constructor(private _handle: IDistributedApplicationEventingHandle, private _client: AspireClientRpc) {}
+
+ /** Serialize for JSON-RPC transport */
+ toJSON(): MarshalledHandle { return this._handle.toJSON(); }
+
+ /** Invokes the Unsubscribe method */
+ /** @internal */
+ async _unsubscribeInternal(subscription: DistributedApplicationEventSubscriptionHandle): Promise {
+ const rpcArgs: Record = { context: this._handle, subscription };
+ await this._client.invokeCapability(
+ 'Aspire.Hosting.Eventing/IDistributedApplicationEventing.unsubscribe',
+ rpcArgs
+ );
+ return this;
+ }
+
+ unsubscribe(subscription: DistributedApplicationEventSubscriptionHandle): DistributedApplicationEventingPromise {
+ return new DistributedApplicationEventingPromise(this._unsubscribeInternal(subscription));
+ }
+
+}
+
+/**
+ * Thenable wrapper for DistributedApplicationEventing that enables fluent chaining.
+ */
+export class DistributedApplicationEventingPromise implements PromiseLike {
+ constructor(private _promise: Promise) {}
+
+ then(
+ onfulfilled?: ((value: DistributedApplicationEventing) => TResult1 | PromiseLike) | null,
+ onrejected?: ((reason: unknown) => TResult2 | PromiseLike) | null
+ ): PromiseLike {
+ return this._promise.then(onfulfilled, onrejected);
+ }
+
+ /** Invokes the Unsubscribe method */
+ unsubscribe(subscription: DistributedApplicationEventSubscriptionHandle): DistributedApplicationEventingPromise {
+ return new DistributedApplicationEventingPromise(this._promise.then(obj => obj.unsubscribe(subscription)));
+ }
+
+}
+
+// ============================================================================
+// AzureAppConfigurationEmulatorResource
+// ============================================================================
+
+export class AzureAppConfigurationEmulatorResource extends ResourceBuilderBase {
+ constructor(handle: AzureAppConfigurationEmulatorResourceHandle, client: AspireClientRpc) {
+ super(handle, client);
+ }
+
+ /** @internal */
+ private async _withBindMountInternal(source: string, target: string, isReadOnly?: boolean): Promise {
+ const rpcArgs: Record = { builder: this._handle, source, target };
+ if (isReadOnly !== undefined) rpcArgs.isReadOnly = isReadOnly;
+ const result = await this._client.invokeCapability(
+ 'Aspire.Hosting/withBindMount',
+ rpcArgs
+ );
+ return new AzureAppConfigurationEmulatorResource(result, this._client);
+ }
+
+ /** Adds a bind mount */
+ withBindMount(source: string, target: string, options?: WithBindMountOptions): AzureAppConfigurationEmulatorResourcePromise {
+ const isReadOnly = options?.isReadOnly;
+ return new AzureAppConfigurationEmulatorResourcePromise(this._withBindMountInternal(source, target, isReadOnly));
+ }
+
+ /** @internal */
+ private async _withEntrypointInternal(entrypoint: string): Promise {
+ const rpcArgs: Record = { builder: this._handle, entrypoint };
+ const result = await this._client.invokeCapability(
+ 'Aspire.Hosting/withEntrypoint',
+ rpcArgs
+ );
+ return new AzureAppConfigurationEmulatorResource(result, this._client);
+ }
+
+ /** Sets the container entrypoint */
+ withEntrypoint(entrypoint: string): AzureAppConfigurationEmulatorResourcePromise {
+ return new AzureAppConfigurationEmulatorResourcePromise(this._withEntrypointInternal(entrypoint));
+ }
+
+ /** @internal */
+ private async _withImageTagInternal(tag: string): Promise {
+ const rpcArgs: Record = { builder: this._handle, tag };
+ const result = await this._client.invokeCapability(
+ 'Aspire.Hosting/withImageTag',
+ rpcArgs
+ );
+ return new AzureAppConfigurationEmulatorResource(result, this._client);
+ }
+
+ /** Sets the container image tag */
+ withImageTag(tag: string): AzureAppConfigurationEmulatorResourcePromise {
+ return new AzureAppConfigurationEmulatorResourcePromise(this._withImageTagInternal(tag));
+ }
+
+ /** @internal */
+ private async _withImageRegistryInternal(registry: string): Promise {
+ const rpcArgs: Record = { builder: this._handle, registry };
+ const result = await this._client.invokeCapability(
+ 'Aspire.Hosting/withImageRegistry',
+ rpcArgs
+ );
+ return new AzureAppConfigurationEmulatorResource(result, this._client);
+ }
+
+ /** Sets the container image registry */
+ withImageRegistry(registry: string): AzureAppConfigurationEmulatorResourcePromise {
+ return new AzureAppConfigurationEmulatorResourcePromise(this._withImageRegistryInternal(registry));
+ }
+
+ /** @internal */
+ private async _withImageInternal(image: string, tag?: string): Promise {
+ const rpcArgs: Record = { builder: this._handle, image };
+ if (tag !== undefined) rpcArgs.tag = tag;
+ const result = await this._client.invokeCapability(
+ 'Aspire.Hosting/withImage',
+ rpcArgs
+ );
+ return new AzureAppConfigurationEmulatorResource(result, this._client);
+ }
+
+ /** Sets the container image */
+ withImage(image: string, options?: WithImageOptions): AzureAppConfigurationEmulatorResourcePromise {
+ const tag = options?.tag;
+ return new AzureAppConfigurationEmulatorResourcePromise(this._withImageInternal(image, tag));
+ }
+
+ /** @internal */
+ private async _withContainerRuntimeArgsInternal(args: string[]): Promise {
+ const rpcArgs: Record = { builder: this._handle, args };
+ const result = await this._client.invokeCapability(
+ 'Aspire.Hosting/withContainerRuntimeArgs',
+ rpcArgs
+ );
+ return new AzureAppConfigurationEmulatorResource(result, this._client);
+ }
+
+ /** Adds runtime arguments for the container */
+ withContainerRuntimeArgs(args: string[]): AzureAppConfigurationEmulatorResourcePromise {
+ return new AzureAppConfigurationEmulatorResourcePromise(this._withContainerRuntimeArgsInternal(args));
+ }
+
+ /** @internal */
+ private async _withLifetimeInternal(lifetime: ContainerLifetime): Promise {
+ const rpcArgs: Record = { builder: this._handle, lifetime };
+ const result = await this._client.invokeCapability(
+ 'Aspire.Hosting/withLifetime',
+ rpcArgs
+ );
+ return new AzureAppConfigurationEmulatorResource(result, this._client);
+ }
+
+ /** Sets the lifetime behavior of the container resource */
+ withLifetime(lifetime: ContainerLifetime): AzureAppConfigurationEmulatorResourcePromise {
+ return new AzureAppConfigurationEmulatorResourcePromise(this._withLifetimeInternal(lifetime));
+ }
+
+ /** @internal */
+ private async _withImagePullPolicyInternal(pullPolicy: ImagePullPolicy): Promise {
+ const rpcArgs: Record = { builder: this._handle, pullPolicy };
+ const result = await this._client.invokeCapability(
+ 'Aspire.Hosting/withImagePullPolicy',
+ rpcArgs
+ );
+ return new AzureAppConfigurationEmulatorResource(result, this._client);
+ }
+
+ /** Sets the container image pull policy */
+ withImagePullPolicy(pullPolicy: ImagePullPolicy): AzureAppConfigurationEmulatorResourcePromise {
+ return new AzureAppConfigurationEmulatorResourcePromise(this._withImagePullPolicyInternal(pullPolicy));
+ }
+
+ /** @internal */
+ private async _withContainerNameInternal(name: string): Promise {
+ const rpcArgs: Record = { builder: this._handle, name };
+ const result = await this._client.invokeCapability(
+ 'Aspire.Hosting/withContainerName',
+ rpcArgs
+ );
+ return new AzureAppConfigurationEmulatorResource(result, this._client);
+ }
+
+ /** Sets the container name */
+ withContainerName(name: string): AzureAppConfigurationEmulatorResourcePromise {
+ return new AzureAppConfigurationEmulatorResourcePromise(this._withContainerNameInternal(name));
+ }
+
+ /** @internal */
+ private async _withEnvironmentInternal(name: string, value: string): Promise {
+ const rpcArgs: Record = { builder: this._handle, name, value };
+ const result = await this._client.invokeCapability(
+ 'Aspire.Hosting/withEnvironment',
+ rpcArgs
+ );
+ return new AzureAppConfigurationEmulatorResource(result, this._client);
+ }
+
+ /** Sets an environment variable */
+ withEnvironment(name: string, value: string): AzureAppConfigurationEmulatorResourcePromise {
+ return new AzureAppConfigurationEmulatorResourcePromise(this._withEnvironmentInternal(name, value));
+ }
+
+ /** @internal */
+ private async _withEnvironmentExpressionInternal(name: string, value: ReferenceExpression): Promise {
+ const rpcArgs: Record = { builder: this._handle, name, value };
+ const result = await this._client.invokeCapability(
+ 'Aspire.Hosting/withEnvironmentExpression',
+ rpcArgs
+ );
+ return new AzureAppConfigurationEmulatorResource(result, this._client);
+ }
+
+ /** Adds an environment variable with a reference expression */
+ withEnvironmentExpression(name: string, value: ReferenceExpression): AzureAppConfigurationEmulatorResourcePromise {
+ return new AzureAppConfigurationEmulatorResourcePromise(this._withEnvironmentExpressionInternal(name, value));
+ }
+
+ /** @internal */
+ private async _withEnvironmentCallbackInternal(callback: (obj: EnvironmentCallbackContext) => Promise): Promise {
+ const callbackId = registerCallback(async (objData: unknown) => {
+ const objHandle = wrapIfHandle(objData) as EnvironmentCallbackContextHandle;
+ const obj = new EnvironmentCallbackContext(objHandle, this._client);
+ await callback(obj);
+ });
+ const rpcArgs: Record = { builder: this._handle, callback: callbackId };
+ const result = await this._client.invokeCapability(
+ 'Aspire.Hosting/withEnvironmentCallback',
+ rpcArgs
+ );
+ return new AzureAppConfigurationEmulatorResource(result, this._client);
+ }
+
+ /** Sets environment variables via callback */
+ withEnvironmentCallback(callback: (obj: EnvironmentCallbackContext) => Promise): AzureAppConfigurationEmulatorResourcePromise {
+ return new AzureAppConfigurationEmulatorResourcePromise(this._withEnvironmentCallbackInternal(callback));
+ }
+
+ /** @internal */
+ private async _withEnvironmentCallbackAsyncInternal(callback: (arg: EnvironmentCallbackContext) => Promise): Promise {
+ const callbackId = registerCallback(async (argData: unknown) => {
+ const argHandle = wrapIfHandle(argData) as EnvironmentCallbackContextHandle;
+ const arg = new EnvironmentCallbackContext(argHandle, this._client);
+ await callback(arg);
+ });
+ const rpcArgs: Record = { builder: this._handle, callback: callbackId };
+ const result = await this._client.invokeCapability(
+ 'Aspire.Hosting/withEnvironmentCallbackAsync',
+ rpcArgs
+ );
+ return new AzureAppConfigurationEmulatorResource(result, this._client);
+ }
+
+ /** Sets environment variables via async callback */
+ withEnvironmentCallbackAsync(callback: (arg: EnvironmentCallbackContext) => Promise): AzureAppConfigurationEmulatorResourcePromise {
+ return new AzureAppConfigurationEmulatorResourcePromise(this._withEnvironmentCallbackAsyncInternal(callback));
+ }
+
+ /** @internal */
+ private async _withArgsInternal(args: string[]): Promise {
+ const rpcArgs: Record = { builder: this._handle, args };
+ const result = await this._client.invokeCapability(
+ 'Aspire.Hosting/withArgs',
+ rpcArgs
+ );
+ return new AzureAppConfigurationEmulatorResource(result, this._client);
+ }
+
+ /** Adds arguments */
+ withArgs(args: string[]): AzureAppConfigurationEmulatorResourcePromise {
+ return new AzureAppConfigurationEmulatorResourcePromise(this._withArgsInternal(args));
+ }
+
+ /** @internal */
+ private async _withArgsCallbackInternal(callback: (obj: CommandLineArgsCallbackContext) => Promise): Promise {
+ const callbackId = registerCallback(async (objData: unknown) => {
+ const objHandle = wrapIfHandle(objData) as CommandLineArgsCallbackContextHandle;
+ const obj = new CommandLineArgsCallbackContext(objHandle, this._client);
+ await callback(obj);
+ });
+ const rpcArgs: Record = { builder: this._handle, callback: callbackId };
+ const result = await this._client.invokeCapability(
+ 'Aspire.Hosting/withArgsCallback',
+ rpcArgs
+ );
+ return new AzureAppConfigurationEmulatorResource(result, this._client);
+ }
+
+ /** Sets command-line arguments via callback */
+ withArgsCallback(callback: (obj: CommandLineArgsCallbackContext) => Promise): AzureAppConfigurationEmulatorResourcePromise {
+ return new AzureAppConfigurationEmulatorResourcePromise(this._withArgsCallbackInternal(callback));
+ }
+
+ /** @internal */
+ private async _withArgsCallbackAsyncInternal(callback: (arg: CommandLineArgsCallbackContext) => Promise): Promise {
+ const callbackId = registerCallback(async (argData: unknown) => {
+ const argHandle = wrapIfHandle(argData) as CommandLineArgsCallbackContextHandle;
+ const arg = new CommandLineArgsCallbackContext(argHandle, this._client);
+ await callback(arg);
+ });
+ const rpcArgs: Record = { builder: this._handle, callback: callbackId };
+ const result = await this._client.invokeCapability(
+ 'Aspire.Hosting/withArgsCallbackAsync',
+ rpcArgs
+ );
+ return new AzureAppConfigurationEmulatorResource(result, this._client);
+ }
+
+ /** Sets command-line arguments via async callback */
+ withArgsCallbackAsync(callback: (arg: CommandLineArgsCallbackContext) => Promise): AzureAppConfigurationEmulatorResourcePromise {
+ return new AzureAppConfigurationEmulatorResourcePromise(this._withArgsCallbackAsyncInternal(callback));
+ }
+
+ /** @internal */
+ private async _withReferenceInternal(source: ResourceBuilderBase, connectionName?: string, optional?: boolean): Promise {
+ const rpcArgs: Record = { builder: this._handle, source };
+ if (connectionName !== undefined) rpcArgs.connectionName = connectionName;
+ if (optional !== undefined) rpcArgs.optional = optional;
+ const result = await this._client.invokeCapability(
+ 'Aspire.Hosting/withReference',
+ rpcArgs
+ );
+ return new AzureAppConfigurationEmulatorResource(result, this._client);
+ }
+
+ /** Adds a reference to another resource */
+ withReference(source: ResourceBuilderBase, options?: WithReferenceOptions): AzureAppConfigurationEmulatorResourcePromise {
+ const connectionName = options?.connectionName;
+ const optional = options?.optional;
+ return new AzureAppConfigurationEmulatorResourcePromise(this._withReferenceInternal(source, connectionName, optional));
+ }
+
+ /** @internal */
+ private async _withServiceReferenceInternal(source: ResourceBuilderBase): Promise {
+ const rpcArgs: Record = { builder: this._handle, source };
+ const result = await this._client.invokeCapability(
+ 'Aspire.Hosting/withServiceReference',
+ rpcArgs
+ );
+ return new AzureAppConfigurationEmulatorResource(result, this._client);
+ }
+
+ /** Adds a service discovery reference to another resource */
+ withServiceReference(source: ResourceBuilderBase): AzureAppConfigurationEmulatorResourcePromise {
+ return new AzureAppConfigurationEmulatorResourcePromise(this._withServiceReferenceInternal(source));
+ }
+
+ /** @internal */
+ private async _withEndpointInternal(port?: number, targetPort?: number, scheme?: string, name?: string, env?: string, isProxied?: boolean, isExternal?: boolean, protocol?: ProtocolType): Promise {
+ const rpcArgs: Record = { builder: this._handle };
+ if (port !== undefined) rpcArgs.port = port;
+ if (targetPort !== undefined) rpcArgs.targetPort = targetPort;
+ if (scheme !== undefined) rpcArgs.scheme = scheme;
+ if (name !== undefined) rpcArgs.name = name;
+ if (env !== undefined) rpcArgs.env = env;
+ if (isProxied !== undefined) rpcArgs.isProxied = isProxied;
+ if (isExternal !== undefined) rpcArgs.isExternal = isExternal;
+ if (protocol !== undefined) rpcArgs.protocol = protocol;
+ const result = await this._client.invokeCapability(
+ 'Aspire.Hosting/withEndpoint',
+ rpcArgs
+ );
+ return new AzureAppConfigurationEmulatorResource(result, this._client);
+ }
+
+ /** Adds a network endpoint */
+ withEndpoint(options?: WithEndpointOptions): AzureAppConfigurationEmulatorResourcePromise {
+ const port = options?.port;
+ const targetPort = options?.targetPort;
+ const scheme = options?.scheme;
+ const name = options?.name;
+ const env = options?.env;
+ const isProxied = options?.isProxied;
+ const isExternal = options?.isExternal;
+ const protocol = options?.protocol;
+ return new AzureAppConfigurationEmulatorResourcePromise(this._withEndpointInternal(port, targetPort, scheme, name, env, isProxied, isExternal, protocol));
+ }
+
+ /** @internal */
+ private async _withHttpEndpointInternal(port?: number, targetPort?: number, name?: string, env?: string, isProxied?: boolean): Promise {
+ const rpcArgs: Record = { builder: this._handle };
+ if (port !== undefined) rpcArgs.port = port;
+ if (targetPort !== undefined) rpcArgs.targetPort = targetPort;
+ if (name !== undefined) rpcArgs.name = name;
+ if (env !== undefined) rpcArgs.env = env;
+ if (isProxied !== undefined) rpcArgs.isProxied = isProxied;
+ const result = await this._client.invokeCapability(
+ 'Aspire.Hosting/withHttpEndpoint',
+ rpcArgs
+ );
+ return new AzureAppConfigurationEmulatorResource(result, this._client);
+ }
+
+ /** Adds an HTTP endpoint */
+ withHttpEndpoint(options?: WithHttpEndpointOptions): AzureAppConfigurationEmulatorResourcePromise {
+ const port = options?.port;
+ const targetPort = options?.targetPort;
+ const name = options?.name;
+ const env = options?.env;
+ const isProxied = options?.isProxied;
+ return new AzureAppConfigurationEmulatorResourcePromise(this._withHttpEndpointInternal(port, targetPort, name, env, isProxied));
+ }
+
+ /** @internal */
+ private async _withHttpsEndpointInternal(port?: number, targetPort?: number, name?: string, env?: string, isProxied?: boolean): Promise {
+ const rpcArgs: Record = { builder: this._handle };
+ if (port !== undefined) rpcArgs.port = port;
+ if (targetPort !== undefined) rpcArgs.targetPort = targetPort;
+ if (name !== undefined) rpcArgs.name = name;
+ if (env !== undefined) rpcArgs.env = env;
+ if (isProxied !== undefined) rpcArgs.isProxied = isProxied;
+ const result = await this._client.invokeCapability(
+ 'Aspire.Hosting/withHttpsEndpoint',
+ rpcArgs
+ );
+ return new AzureAppConfigurationEmulatorResource(result, this._client);
+ }
+
+ /** Adds an HTTPS endpoint */
+ withHttpsEndpoint(options?: WithHttpsEndpointOptions): AzureAppConfigurationEmulatorResourcePromise {
+ const port = options?.port;
+ const targetPort = options?.targetPort;
+ const name = options?.name;
+ const env = options?.env;
+ const isProxied = options?.isProxied;
+ return new AzureAppConfigurationEmulatorResourcePromise(this._withHttpsEndpointInternal(port, targetPort, name, env, isProxied));
+ }
+
+ /** @internal */
+ private async _withExternalHttpEndpointsInternal(): Promise {
+ const rpcArgs: Record = { builder: this._handle };
+ const result = await this._client.invokeCapability(
+ 'Aspire.Hosting/withExternalHttpEndpoints',
+ rpcArgs
+ );
+ return new AzureAppConfigurationEmulatorResource(result, this._client);
+ }
+
+ /** Makes HTTP endpoints externally accessible */
+ withExternalHttpEndpoints(): AzureAppConfigurationEmulatorResourcePromise {
+ return new AzureAppConfigurationEmulatorResourcePromise(this._withExternalHttpEndpointsInternal());
+ }
+
+ /** Gets an endpoint reference */
+ async getEndpoint(name: string): Promise {
+ const rpcArgs: Record = { builder: this._handle, name };
+ return await this._client.invokeCapability(
+ 'Aspire.Hosting/getEndpoint',
+ rpcArgs
+ );
+ }
+
+ /** @internal */
+ private async _asHttp2ServiceInternal(): Promise {
+ const rpcArgs: Record = { builder: this._handle };
+ const result = await this._client.invokeCapability(
+ 'Aspire.Hosting/asHttp2Service',
+ rpcArgs
+ );
+ return new AzureAppConfigurationEmulatorResource(result, this._client);
+ }
+
+ /** Configures resource for HTTP/2 */
+ asHttp2Service(): AzureAppConfigurationEmulatorResourcePromise {
+ return new AzureAppConfigurationEmulatorResourcePromise(this._asHttp2ServiceInternal());
+ }
+
+ /** @internal */
+ private async _withUrlsCallbackInternal(callback: (obj: ResourceUrlsCallbackContext) => Promise): Promise {
+ const callbackId = registerCallback(async (objData: unknown) => {
+ const objHandle = wrapIfHandle(objData) as ResourceUrlsCallbackContextHandle;
+ const obj = new ResourceUrlsCallbackContext(objHandle, this._client);
+ await callback(obj);
+ });
+ const rpcArgs: Record = { builder: this._handle, callback: callbackId };
+ const result = await this._client.invokeCapability(
+ 'Aspire.Hosting/withUrlsCallback',
+ rpcArgs
+ );
+ return new AzureAppConfigurationEmulatorResource(result, this._client);
+ }
+
+ /** Customizes displayed URLs via callback */
+ withUrlsCallback(callback: (obj: ResourceUrlsCallbackContext) => Promise): AzureAppConfigurationEmulatorResourcePromise {
+ return new AzureAppConfigurationEmulatorResourcePromise(this._withUrlsCallbackInternal(callback));
+ }
+
+ /** @internal */
+ private async _withUrlsCallbackAsyncInternal(callback: (arg: ResourceUrlsCallbackContext) => Promise): Promise {
+ const callbackId = registerCallback(async (argData: unknown) => {
+ const argHandle = wrapIfHandle(argData) as ResourceUrlsCallbackContextHandle;
+ const arg = new ResourceUrlsCallbackContext(argHandle, this._client);
+ await callback(arg);
+ });
+ const rpcArgs: Record = { builder: this._handle, callback: callbackId };
+ const result = await this._client.invokeCapability(
+ 'Aspire.Hosting/withUrlsCallbackAsync',
+ rpcArgs
+ );
+ return new AzureAppConfigurationEmulatorResource(result, this._client);
+ }
+
+ /** Customizes displayed URLs via async callback */
+ withUrlsCallbackAsync(callback: (arg: ResourceUrlsCallbackContext) => Promise): AzureAppConfigurationEmulatorResourcePromise {
+ return new AzureAppConfigurationEmulatorResourcePromise(this._withUrlsCallbackAsyncInternal(callback));
+ }
+
+ /** @internal */
+ private async _withUrlInternal(url: string, displayText?: string): Promise {
+ const rpcArgs: Record = { builder: this._handle, url };
+ if (displayText !== undefined) rpcArgs.displayText = displayText;
+ const result = await this._client.invokeCapability(
+ 'Aspire.Hosting/withUrl',
+ rpcArgs
+ );
+ return new AzureAppConfigurationEmulatorResource(result, this._client);
+ }
+
+ /** Adds or modifies displayed URLs */
+ withUrl(url: string, options?: WithUrlOptions): AzureAppConfigurationEmulatorResourcePromise {
+ const displayText = options?.displayText;
+ return new AzureAppConfigurationEmulatorResourcePromise(this._withUrlInternal(url, displayText));
+ }
+
+ /** @internal */
+ private async _withUrlExpressionInternal(url: ReferenceExpression, displayText?: string): Promise {
+ const rpcArgs: Record = { builder: this._handle, url };
+ if (displayText !== undefined) rpcArgs.displayText = displayText;
+ const result = await this._client.invokeCapability(
+ 'Aspire.Hosting/withUrlExpression',
+ rpcArgs
+ );
+ return new AzureAppConfigurationEmulatorResource(result, this._client);
+ }
+
+ /** Adds a URL using a reference expression */
+ withUrlExpression(url: ReferenceExpression, options?: WithUrlExpressionOptions): AzureAppConfigurationEmulatorResourcePromise {
+ const displayText = options?.displayText;
+ return new AzureAppConfigurationEmulatorResourcePromise(this._withUrlExpressionInternal(url, displayText));
+ }
+
+ /** @internal */
+ private async _withUrlForEndpointInternal(endpointName: string, callback: (obj: ResourceUrlAnnotation) => Promise): Promise {
+ const callbackId = registerCallback(async (objData: unknown) => {
+ const obj = wrapIfHandle(objData) as ResourceUrlAnnotation;
+ await callback(obj);
+ });
+ const rpcArgs: Record = { builder: this._handle, endpointName, callback: callbackId };
+ const result = await this._client.invokeCapability(
+ 'Aspire.Hosting/withUrlForEndpoint',
+ rpcArgs
+ );
+ return new AzureAppConfigurationEmulatorResource(result, this._client);
+ }
+
+ /** Customizes the URL for a specific endpoint via callback */
+ withUrlForEndpoint(endpointName: string, callback: (obj: ResourceUrlAnnotation) => Promise): AzureAppConfigurationEmulatorResourcePromise {
+ return new AzureAppConfigurationEmulatorResourcePromise(this._withUrlForEndpointInternal(endpointName, callback));
+ }
+
+ /** @internal */
+ private async _withUrlForEndpointFactoryInternal(endpointName: string, callback: (arg: EndpointReference) => Promise): Promise