Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions extensions/mssql/l10n/bundle.l10n.json
Original file line number Diff line number Diff line change
Expand Up @@ -3154,12 +3154,12 @@
"No databases found on the server. Please check your connection.": "No databases found on the server. Please check your connection.",
"Profiler is not supported on Microsoft Fabric SQL databases.": "Profiler is not supported on Microsoft Fabric SQL databases.",
"Unable to read proxy agent options.": "Unable to read proxy agent options.",
"Proxy settings found, but without a protocol (e.g. http://): '{0}'. You may encounter connection issues while using the MSSQL extension./{0} is the proxy URL": {
"message": "Proxy settings found, but without a protocol (e.g. http://): '{0}'. You may encounter connection issues while using the MSSQL extension.",
"Proxy settings found, but without a protocol (e.g. http://): '{0}'. You may encounter connection issues while using the MSSQL extension./{0} is the proxy URL": {
"message": "Proxy settings found, but without a protocol (e.g. http://): '{0}'. You may encounter connection issues while using the MSSQL extension.",
"comment": ["{0} is the proxy URL"]
},
"Proxy settings found, but encountered an error while parsing the URL: '{0}'. You may encounter connection issues while using the MSSQL extension. Error: {1}/{0} is the proxy URL{1} is the error message": {
"message": "Proxy settings found, but encountered an error while parsing the URL: '{0}'. You may encounter connection issues while using the MSSQL extension. Error: {1}",
"Proxy settings found, but encountered an error while parsing the URL: '{0}'. You may encounter connection issues while using the MSSQL extension. Error: {1}/{0} is the proxy URL{1} is the error message": {
"message": "Proxy settings found, but encountered an error while parsing the URL: '{0}'. You may encounter connection issues while using the MSSQL extension. Error: {1}",
"comment": ["{0} is the proxy URL", "{1} is the error message"]
},
"Backup Database - {0}/{0} is the database name": {
Expand Down
4 changes: 2 additions & 2 deletions extensions/mssql/src/constants/locConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3077,15 +3077,15 @@ export class Proxy {
public static missingProtocolWarning = (proxy: string) =>
l10n.t({
message:
"Proxy settings found, but without a protocol (e.g. http://): '{0}'. You may encounter connection issues while using the MSSQL extension.",
"Proxy settings found, but without a protocol (e.g. http://): '{0}'. You may encounter connection issues while using the MSSQL extension.",
args: [proxy],
comment: ["{0} is the proxy URL"],
});

public static unparseableWarning = (proxy: string, errorMessage: string) =>
l10n.t({
message:
"Proxy settings found, but encountered an error while parsing the URL: '{0}'. You may encounter connection issues while using the MSSQL extension. Error: {1}",
"Proxy settings found, but encountered an error while parsing the URL: '{0}'. You may encounter connection issues while using the MSSQL extension. Error: {1}",
args: [proxy, errorMessage],
comment: ["{0} is the proxy URL", "{1} is the error message"],
});
Expand Down
22 changes: 15 additions & 7 deletions extensions/mssql/src/http/httpClientCore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import { Readable } from "stream";
import { ILogger } from "../models/interfaces";

const UnableToGetProxyAgentOptionsMessage = "Unable to read proxy agent options to get tenants.";
const HTTPS_PORT = 443;
const HTTP_PORT = 80;

export interface IHttpClientMessages {
missingProtocolWarning(proxy: string): string;
Expand Down Expand Up @@ -168,12 +170,12 @@ export class HttpClientCore {
: new URL(proxy).protocol;

if (!scheme) {
message = `Proxy settings found, but without a protocol (e.g. http://): '${proxy}'. You may encounter connection issues while using the MSSQL extension.`;
message = `Proxy settings found, but without a protocol (e.g. http://): '${proxy}'. You may encounter connection issues while using this extension.`;
localizedMessage = this.dependencies.messages?.missingProtocolWarning(proxy);
}
} catch (err) {
const errorMessage = this.getErrorMessage(err);
message = `Proxy settings found, but encountered an error while parsing the URL: '${proxy}'. You may encounter connection issues while using the MSSQL extension. Error: ${errorMessage}`;
message = `Proxy settings found, but encountered an error while parsing the URL: '${proxy}'. You may encounter connection issues while using this extension. Error: ${errorMessage}`;
localizedMessage = this.dependencies.messages?.unparseableWarning(proxy, errorMessage);
}

Expand Down Expand Up @@ -286,10 +288,11 @@ export class HttpClientCore {
// Request URL will include HTTPS port 443 ('https://management.azure.com:443/tenants?api-version=2019-11-01'), so
// that Axios doesn't try to reach this URL with HTTP port 80 on HTTP proxies, which result in an error. See https://github.com/axios/axios/issues/925

const HTTPS_PORT = 443;
const HTTP_PORT = 80;
const parsedRequestUrl = new URL(requestUrl);
const port = parsedRequestUrl.protocol?.startsWith("https") ? HTTPS_PORT : HTTP_PORT;
// Preserve explicitly-specified ports (e.g., https://host:8443/...), only inject default when no port was provided
const port =
parsedRequestUrl.port ||
(parsedRequestUrl.protocol?.startsWith("https") ? HTTPS_PORT : HTTP_PORT);

return `${parsedRequestUrl.protocol}//${parsedRequestUrl.hostname}:${port}${parsedRequestUrl.pathname}${parsedRequestUrl.search}`;
}
Expand Down Expand Up @@ -410,9 +413,14 @@ export class HttpClientCore {

return {
host: proxyEndpoint.hostname,
port: Number(proxyEndpoint.port),
port: proxyEndpoint.port
? Number(proxyEndpoint.port)
: proxyEndpoint.protocol === "https:"
Comment thread
ssreerama marked this conversation as resolved.
? HTTPS_PORT
: HTTP_PORT,
auth,
rejectUnauthorized: typeof strictSSL === "boolean",
// Default to rejecting unauthorized certs unless the user explicitly disables strict SSL.
rejectUnauthorized: strictSSL !== false,
Comment thread
ssreerama marked this conversation as resolved.
};
}

Expand Down
1 change: 1 addition & 0 deletions extensions/sql-database-projects/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ _The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
## [1.5.8] - 2026-03-18

- Adds support for Microsoft.Build.Sql 2.1.0
- Added HTTP(S) proxy support for downloading build DLLs, enabling the extension to work in environments behind a corporate proxy

## [1.5.7] - 2026-02-27

Expand Down
15 changes: 0 additions & 15 deletions extensions/sql-database-projects/VSCODE_DEVELOPMENT.md

This file was deleted.

4 changes: 4 additions & 0 deletions extensions/sql-database-projects/l10n/bundle.l10n.json
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,10 @@
"Download error": "Download error",
"Download progress": "Download progress",
"Downloading": "Downloading",
"Proxy settings found, but without a protocol (e.g. http://): '{0}'. You may encounter connection issues while using the SQL Database Projects extension.": "Proxy settings found, but without a protocol (e.g. http://): '{0}'. You may encounter connection issues while using the SQL Database Projects extension.",
"Proxy settings found, but encountered an error while parsing the URL: '{0}'. You may encounter connection issues while using the SQL Database Projects extension. Error: {1}": "Proxy settings found, but encountered an error while parsing the URL: '{0}'. You may encounter connection issues while using the SQL Database Projects extension. Error: {1}",
"Unable to read proxy agent options.": "Unable to read proxy agent options.",
"Unable to reach nuget.org. If you are behind a proxy or in an offline environment, you can manually place the required DLL files in the build directory: {0}": "Unable to reach nuget.org. If you are behind a proxy or in an offline environment, you can manually place the required DLL files in the build directory: {0}",
"Downloading {0} nuget to get build DLLs ": "Downloading {0} nuget to get build DLLs ",
"Downloading from {0} to {1}": "Downloading from {0} to {1}",
"Extracting DacFx build DLLs to {0}": "Extracting DacFx build DLLs to {0}",
Expand Down
2 changes: 2 additions & 0 deletions extensions/sql-database-projects/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,7 @@
"fs-extra": "^5.0.0",
"promisify-child-process": "^3.1.1",
"semver": "^7.5.2",
"tunnel": "0.0.6",
"vscode-jsonrpc": "^8.2.1",
"vscode-languageclient": "5.2.1",
"which": "^2.0.2",
Expand All @@ -592,6 +593,7 @@
"@types/semver": "^7.3.1",
"@types/sinon": "^9.0.4",
"@types/sinon-chai": "^4.0.0",
"@types/tunnel": "0.0.1",
"@types/vscode": "1.98.0",
"@types/which": "^2.0.1",
"@types/xml-formatter": "^1.1.0",
Expand Down
24 changes: 24 additions & 0 deletions extensions/sql-database-projects/src/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
export const dataSourceDropdownTitle = l10n.t("Data source");
export const noDataSourcesText = l10n.t("No data sources in this project");
export const loadProfilePlaceholderText = l10n.t("Load profile...");
export const profileReadError = (err: any) =>

Check warning on line 194 in extensions/sql-database-projects/src/common/constants.ts

View workflow job for this annotation

GitHub Actions / build-and-test

Unexpected any. Specify a different type
l10n.t("Error loading the publish profile. {0}", utils.getErrorMessage(err));
export const sqlCmdVariables = l10n.t("SQLCMD Variables");
export const sqlCmdVariableColumn = l10n.t("Name");
Expand Down Expand Up @@ -517,7 +517,7 @@
export function circularProjectReference(project1: string, project2: string) {
return l10n.t("Circular reference from project {0} to project {1}", project1, project2);
}
export function errorFindingBuildFilesLocation(err: any) {

Check warning on line 520 in extensions/sql-database-projects/src/common/constants.ts

View workflow job for this annotation

GitHub Actions / build-and-test

Unexpected any. Specify a different type
return l10n.t("Error finding build files location: {0}", utils.getErrorMessage(err));
}
export function projBuildFailed(errorMessage: string) {
Expand Down Expand Up @@ -883,7 +883,31 @@

//#endregion

//#region proxy
export const Proxy = {
missingProtocolWarning: (proxy: string) =>
l10n.t(
"Proxy settings found, but without a protocol (e.g. http://): '{0}'. You may encounter connection issues while using the SQL Database Projects extension.",
proxy,
),
unparseableWarning: (proxy: string, errorMessage: string) =>
l10n.t(
"Proxy settings found, but encountered an error while parsing the URL: '{0}'. You may encounter connection issues while using the SQL Database Projects extension. Error: {1}",
proxy,
errorMessage,
),
Comment thread
ssreerama marked this conversation as resolved.
unableToGetProxyAgentOptions: l10n.t("Unable to read proxy agent options."),
};
//#endregion

//#region buildHelper
export function nugetDownloadFailedHelp(buildDirPath: string): string {
Comment thread
Benjin marked this conversation as resolved.
return l10n.t(
"Unable to reach nuget.org. If you are behind a proxy or in an offline environment, you can manually place the required DLL files in the build directory: {0}",
buildDirPath,
);
}

export function downloadingNuget(nuget: string) {
return l10n.t("Downloading {0} nuget to get build DLLs ", nuget);
}
Expand Down
135 changes: 0 additions & 135 deletions extensions/sql-database-projects/src/common/httpClient.ts

This file was deleted.

Loading
Loading