function getLocalTunnelParameterCommand()

in tools/vscode-azurewebpubsub/src/workflows/hubSetting/localTunnel/AttachLocalTunnelStep.ts [103:108]


function getLocalTunnelParameterCommand(upstreamPort: number, subscriptionId: string, resourceGroup: string, hubName: string, connectionString?: string, endpoint?: string): string {
    if (connectionString && endpoint || !connectionString && !endpoint) throw new Error("Either connectionString or endpoint should be provided.");
    const baseCommand = `awps-tunnel run --hub "${hubName}" --subscription "${subscriptionId}" --resourceGroup "${resourceGroup}" --upstream "http://localhost:${upstreamPort}"`;
    const suffixCommand = connectionString ? `--connection "${connectionString}"` : (`--endpoint "${endpoint}"`);
    return `${baseCommand} ${suffixCommand}`;
}