Make azure portal work from server area (#10699)

This commit is contained in:
Amir Omidi
2020-06-03 14:02:23 -07:00
committed by GitHub
parent 61dce39f5a
commit 3860f07cab
4 changed files with 74 additions and 13 deletions

View File

@@ -238,18 +238,13 @@ export function registerAzureResourceCommands(appContext: AppContext, tree: Azur
}
});
appContext.apiWrapper.registerCommand('azure.resource.openInAzurePortal', async (node?: TreeNode) => {
if (!node) {
return;
}
appContext.apiWrapper.registerCommand('azure.resource.openInAzurePortal', async (connectionProfile: azdata.IConnectionProfile) => {
const treeItem: azdata.TreeItem = await node.getTreeItem();
if (!treeItem.payload) {
return;
}
let connectionProfile = Object.assign({}, treeItem.payload, { saveProfile: true });
if (!connectionProfile.azureResourceId) {
if (
!connectionProfile.azureResourceId ||
!connectionProfile.azurePortalEndpoint ||
!connectionProfile.azureTenantId
) {
return;
}