Support for MongoDB clusters / vCore (#22512)

* Initial support for MongoDB clusters / vCore

* Get cluster connection string from arm

* Preserve Azure account for any auth type

When a service has been selected through the Azure
browser, we want to preserve the Azure account
information even if a different authentication has
been selected. This allows doing ARM operations
using the signed in Azure account for any resources
including those with a different login types such
as clusters.
This commit is contained in:
Vsevolod Kukol
2023-06-08 00:38:35 +02:00
committed by GitHub
parent 346b207f4e
commit e0d5cd18b9
8 changed files with 33 additions and 12 deletions

View File

@@ -974,9 +974,9 @@ export class ConnectionWidget extends lifecycle.Disposable {
});
}
if (this.authType === AuthenticationType.AzureMFA || this.authType === AuthenticationType.AzureMFAAndUser) {
if (this.authType === AuthenticationType.AzureMFA || this.authType === AuthenticationType.AzureMFAAndUser || connectionInfo.azureAccount !== null) {
this.fillInAzureAccountOptions().then(async () => {
let accountName = (this.authType === AuthenticationType.AzureMFA)
let accountName = ((this.authType === AuthenticationType.AzureMFA) || connectionInfo.azureAccount !== null)
? connectionInfo.azureAccount : connectionInfo.userName;
let account: azdata.Account;
if (accountName) {
@@ -1262,7 +1262,11 @@ export class ConnectionWidget extends lifecycle.Disposable {
model.userName = this.userName;
model.password = this.password;
model.authenticationType = this.authenticationType;
model.azureAccount = this.authToken;
const azureAccount = this.authToken;
if (azureAccount) {
// set the azureAccount only if one has been selected, otherwise preserve the initial model value
model.azureAccount = azureAccount;
}
model.savePassword = this._rememberPasswordCheckBox.checked;
model.databaseName = this.databaseName;
if (this._customOptionWidgets) {