mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
fix a dependent bot issue (#19418)
This commit is contained in:
@@ -37,12 +37,12 @@
|
|||||||
"@types/chai": "3.4.34",
|
"@types/chai": "3.4.34",
|
||||||
"@types/mocha": "^5.2.5",
|
"@types/mocha": "^5.2.5",
|
||||||
"@types/node": "^10.14.8",
|
"@types/node": "^10.14.8",
|
||||||
"azure-keyvault": "^3.0.4",
|
"@azure/keyvault-secrets": "^4.4.0",
|
||||||
|
"@azure/identity": "^2.0.4",
|
||||||
"chai": "3.5.0",
|
"chai": "3.5.0",
|
||||||
"mocha": "^5.2.0",
|
"mocha": "^5.2.0",
|
||||||
"mocha-junit-reporter": "^1.17.0",
|
"mocha-junit-reporter": "^1.17.0",
|
||||||
"mocha-multi-reporters": "^1.1.7",
|
"mocha-multi-reporters": "^1.1.7",
|
||||||
"ms-rest-azure": "^2.6.0",
|
|
||||||
"@microsoft/vscodetestcover": "^1.2.0"
|
"@microsoft/vscodetestcover": "^1.2.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,8 +81,8 @@ if (!fs.existsSync(NOTEBOOK_PYTHON_INSTALL_PATH)) {
|
|||||||
throw message;
|
throw message;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msrestAzure = require('ms-rest-azure');
|
const { DefaultAzureCredential } = require('@azure/identity');
|
||||||
const KeyVault = require('azure-keyvault');
|
const { SecretClient } = require('@azure/keyvault-secrets');
|
||||||
const child_process = require('child_process');
|
const child_process = require('child_process');
|
||||||
|
|
||||||
// Name of the values that are stored in Azure Key Vault
|
// Name of the values that are stored in Azure Key Vault
|
||||||
@@ -137,30 +137,22 @@ process.env[ENVAR_PYTHON_INSTALL_PATH] = NOTEBOOK_PYTHON_INSTALL_PATH;
|
|||||||
process.env[ENVAR_RUN_PYTHON3_TEST] = '1';
|
process.env[ENVAR_RUN_PYTHON3_TEST] = '1';
|
||||||
process.env[ENVAR_RUN_PYSPARK_TEST] = '0';
|
process.env[ENVAR_RUN_PYSPARK_TEST] = '0';
|
||||||
|
|
||||||
const promises = [];
|
const credential = new DefaultAzureCredential();
|
||||||
|
const client = new SecretClient(AKV_URL, credential);
|
||||||
|
|
||||||
// Open up a web browser to the login page so the user doesn't have to copy the URL manually
|
async function main() {
|
||||||
const start = (process.platform == 'darwin' ? 'open' : process.platform == 'win32' ? 'start' : 'xdg-open');
|
for (const entry of SecretEnVarMapping) {
|
||||||
child_process.exec(`${start} https://microsoft.com/devicelogin`);
|
|
||||||
|
|
||||||
// Fetch the values from AKV
|
|
||||||
msrestAzure.interactiveLogin().then((credentials) => {
|
|
||||||
const client = new KeyVault.KeyVaultClient(credentials);
|
|
||||||
SecretEnVarMapping.forEach(entry => {
|
|
||||||
const secretName = entry[0];
|
const secretName = entry[0];
|
||||||
const environmentVariable = entry[1];
|
const environmentVariable = entry[1];
|
||||||
const promise = client.getSecret(AKV_URL, secretName, '').then((result) => {
|
try {
|
||||||
|
const result = await client.getSecret(secretName);
|
||||||
console.log(`${secretName}: ${result.value}`);
|
console.log(`${secretName}: ${result.value}`);
|
||||||
process.env[environmentVariable] = result.value;
|
process.env[environmentVariable] = result.value;
|
||||||
}, (err) => {
|
} catch (err) {
|
||||||
console.error('An error occured while retrieving the value for secret:' + secretName);
|
console.error('An error occured while retrieving the value for secret:' + secretName);
|
||||||
console.error(err);
|
console.error(err);
|
||||||
});
|
}
|
||||||
promises.push(promise);
|
}
|
||||||
});
|
|
||||||
|
|
||||||
Promise.all(promises).then(
|
|
||||||
() => {
|
|
||||||
console.log('Done reading values from Azure KeyVault!');
|
console.log('Done reading values from Azure KeyVault!');
|
||||||
console.log(`Launching new window: ${LAUNCH_OPTION}...`);
|
console.log(`Launching new window: ${LAUNCH_OPTION}...`);
|
||||||
if (LAUNCH_OPTION === LAUNCH_VSCODE) {
|
if (LAUNCH_OPTION === LAUNCH_VSCODE) {
|
||||||
@@ -168,9 +160,6 @@ msrestAzure.interactiveLogin().then((credentials) => {
|
|||||||
}
|
}
|
||||||
child_process.execSync(LAUNCH_OPTION);
|
child_process.execSync(LAUNCH_OPTION);
|
||||||
console.log('New window for running test has been opened.');
|
console.log('New window for running test has been opened.');
|
||||||
}
|
}
|
||||||
);
|
|
||||||
}, (err) => {
|
main();
|
||||||
console.error('An error occured while logging in to Azure portal');
|
|
||||||
console.error(err);
|
|
||||||
});
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user