From 09e09665f577ad81a7b46a7a2bfd259ea8d7cc0b Mon Sep 17 00:00:00 2001 From: Michael Boucher Date: Sat, 28 Mar 2020 23:49:22 -0400 Subject: [PATCH 1/4] Fix Azure Environment Selector #133 --- src/tree/integration-account/IntegrationAccountsProvider.ts | 2 +- src/tree/logic-app/LogicAppsProvider.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tree/integration-account/IntegrationAccountsProvider.ts b/src/tree/integration-account/IntegrationAccountsProvider.ts index 93acf30e..a3f96703 100644 --- a/src/tree/integration-account/IntegrationAccountsProvider.ts +++ b/src/tree/integration-account/IntegrationAccountsProvider.ts @@ -24,7 +24,7 @@ export class IntegrationAccountProvider implements IChildProvider { this.nextLink = undefined; } - const client = new LogicAppsManagementClient(node.credentials, node.subscriptionId); + const client = new LogicAppsManagementClient(node.credentials, node.subscriptionId, node.environment.resourceManagerEndpointUrl); addExtensionUserAgent(client); const integrationAccounts = this.nextLink === undefined diff --git a/src/tree/logic-app/LogicAppsProvider.ts b/src/tree/logic-app/LogicAppsProvider.ts index 4bbb8924..4bbfcbcc 100644 --- a/src/tree/logic-app/LogicAppsProvider.ts +++ b/src/tree/logic-app/LogicAppsProvider.ts @@ -28,7 +28,7 @@ export class LogicAppsProvider implements IChildProvider { this.nextLink = undefined; } - const client = new LogicAppsManagementClient(node.credentials, node.subscriptionId); + const client = new LogicAppsManagementClient(node.credentials, node.subscriptionId, node.environment.resourceManagerEndpointUrl); addExtensionUserAgent(client); const logicApps = this.nextLink === undefined From 0006d8dd75d7a0f845c6c59412d13db7bd14bacc Mon Sep 17 00:00:00 2001 From: Michael Boucher Date: Tue, 31 Mar 2020 01:50:21 -0400 Subject: [PATCH 2/4] Fix #133 - Update vscode-azureextensionui to 0.17.1 --- package-lock.json | 6 +++--- package.json | 2 +- .../integration-account/agreements/createAgreementWizard.ts | 5 ++++- .../integration-account/createIntegrationAccountWizard.ts | 6 ++++-- src/wizard/integration-account/maps/createMapWizard.ts | 5 ++++- .../integration-account/partners/createPartnerWizard.ts | 5 ++++- .../integration-account/schemas/createSchemaWizard.ts | 5 ++++- src/wizard/logic-app/createLogicApp.ts | 5 ++++- 8 files changed, 28 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index 18240490..d0100e64 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6228,9 +6228,9 @@ } }, "vscode-azureextensionui": { - "version": "0.16.6", - "resolved": "https://registry.npmjs.org/vscode-azureextensionui/-/vscode-azureextensionui-0.16.6.tgz", - "integrity": "sha512-vb5PdCprfqfjy3gMrtiwRyf9Q2L5CqJJA4BAwVyfwMHEp4IZ9Co0nsgi+AIzCvqyvlBtwGG9HIsCm+vMhPtHww==", + "version": "0.17.1", + "resolved": "https://registry.npmjs.org/vscode-azureextensionui/-/vscode-azureextensionui-0.17.1.tgz", + "integrity": "sha512-K7UyoMgIhXf277Asowlc/5XW2ilMbFB55B1Ga9DJNk0ragBY4gsOHNfiYzZsACOcvFmN8pa9YpD/A437pp099w==", "requires": { "azure-arm-resource": "^3.0.0-preview", "azure-arm-storage": "^3.1.0", diff --git a/package.json b/package.json index 977e9bd8..4843911a 100644 --- a/package.json +++ b/package.json @@ -769,7 +769,7 @@ "lodash": "^4.17.15", "request": "^2.88.2", "request-promise-native": "^1.0.8", - "vscode-azureextensionui": "^0.16.5", + "vscode-azureextensionui": "0.17.1", "vscode-extension-telemetry": "0.0.18", "vscode-nls": "^3.2.5" }, diff --git a/src/wizard/integration-account/agreements/createAgreementWizard.ts b/src/wizard/integration-account/agreements/createAgreementWizard.ts index f0046349..e6a16b80 100644 --- a/src/wizard/integration-account/agreements/createAgreementWizard.ts +++ b/src/wizard/integration-account/agreements/createAgreementWizard.ts @@ -3,6 +3,7 @@ * Licensed under the MIT License. See LICENSE in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import { AzureEnvironment } from "ms-rest-azure"; import { BusinessIdentity, IntegrationAccount, IntegrationAccountPartner } from "azure-arm-logic/lib/models"; import { AzureWizard, AzureWizardExecuteStep, AzureWizardPromptStep, IActionContext, IAzureNode, IAzureTreeItem, ILocationWizardContext, IResourceGroupWizardContext } from "vscode-azureextensionui"; import { IntegrationAccountAgreementTreeItem } from "../../../tree/integration-account/IntegrationAccountAgreementTreeItem"; @@ -23,6 +24,7 @@ export interface IAgreementWizardContext extends ILocationWizardContext, IResour hostIdentity?: BusinessIdentity; guestPartner?: string; guestIdentity?: BusinessIdentity; + environment: AzureEnvironment; // Passing Data Around partners?: Map; @@ -53,7 +55,8 @@ export async function runNewAgreementWizard(integrationAccount: IntegrationAccou name: integrationAccount.id!.split("/").slice(-5, -4)[0] }, subscriptionDisplayName: node.subscriptionDisplayName, - subscriptionId: node.subscriptionId + subscriptionId: node.subscriptionId, + environment: node.environment }; // Create a new instance of an Azure wizard for creating Agreements. diff --git a/src/wizard/integration-account/createIntegrationAccountWizard.ts b/src/wizard/integration-account/createIntegrationAccountWizard.ts index 0a6f4d02..c2108c2f 100644 --- a/src/wizard/integration-account/createIntegrationAccountWizard.ts +++ b/src/wizard/integration-account/createIntegrationAccountWizard.ts @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See LICENSE in the project root for license information. *--------------------------------------------------------------------------------------------*/ - +import { AzureEnvironment } from "ms-rest-azure"; import { AzureWizard, AzureWizardExecuteStep, AzureWizardPromptStep, IActionContext, IAzureNode, IAzureTreeItem, ILocationWizardContext, IResourceGroupWizardContext, LocationListStep, ResourceGroupCreateStep, ResourceGroupListStep } from "vscode-azureextensionui"; import { IntegrationAccountTreeItem } from "../../tree/integration-account/IntegrationAccountTreeItem"; import { IntegrationAccountCreateStep } from "./integrationAccountCreateStep"; @@ -13,6 +13,7 @@ export interface IIntegrationAccountWizardContext extends ILocationWizardContext integrationAccount?: IntegrationAccountTreeItem; integrationAccountName?: string; sku?: string; + environment: AzureEnvironment; } export async function runNewIntegrationAccountWizard(node: IAzureNode, showCreatingNode: (label: string) => void): Promise { @@ -34,7 +35,8 @@ export async function runNewIntegrationAccountWizard(node: IAzureNode, showCreat let wizardContext: IIntegrationAccountWizardContext = { credentials: node.credentials, subscriptionDisplayName: node.subscriptionDisplayName, - subscriptionId: node.subscriptionId + subscriptionId: node.subscriptionId, + environment: node.environment }; // Create a new instance of an Azure wizard for creating Integration Accounts. diff --git a/src/wizard/integration-account/maps/createMapWizard.ts b/src/wizard/integration-account/maps/createMapWizard.ts index f4c94601..27242f21 100644 --- a/src/wizard/integration-account/maps/createMapWizard.ts +++ b/src/wizard/integration-account/maps/createMapWizard.ts @@ -3,6 +3,7 @@ * Licensed under the MIT License. See LICENSE in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import { AzureEnvironment } from "ms-rest-azure"; import { IntegrationAccount } from "azure-arm-logic/lib/models"; import { AzureWizard, AzureWizardExecuteStep, AzureWizardPromptStep, IActionContext, IAzureNode, IAzureTreeItem, ILocationWizardContext, IResourceGroupWizardContext } from "vscode-azureextensionui"; import { IntegrationAccountMapTreeItem } from "../../../tree/integration-account/IntegrationAccountMapTreeItem"; @@ -15,6 +16,7 @@ export interface IMapWizardContext extends ILocationWizardContext, IResourceGrou map?: IntegrationAccountMapTreeItem; mapName?: string; mapType?: string; + environment: AzureEnvironment; } export async function runNewMapWizard(integrationAccount: IntegrationAccount, node: IAzureNode, showCreatingNode: (label: string) => void): Promise { @@ -38,7 +40,8 @@ export async function runNewMapWizard(integrationAccount: IntegrationAccount, no name: integrationAccount.id!.split("/").slice(-5, -4)[0] }, subscriptionDisplayName: node.subscriptionDisplayName, - subscriptionId: node.subscriptionId + subscriptionId: node.subscriptionId, + environment: node.environment }; // Create a new instance of an Azure wizard for creating Maps. diff --git a/src/wizard/integration-account/partners/createPartnerWizard.ts b/src/wizard/integration-account/partners/createPartnerWizard.ts index ff206dfd..a7e52900 100644 --- a/src/wizard/integration-account/partners/createPartnerWizard.ts +++ b/src/wizard/integration-account/partners/createPartnerWizard.ts @@ -3,6 +3,7 @@ * Licensed under the MIT License. See LICENSE in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import { AzureEnvironment } from "ms-rest-azure"; import { IntegrationAccount } from "azure-arm-logic/lib/models"; import { AzureWizard, AzureWizardExecuteStep, AzureWizardPromptStep, IActionContext, IAzureNode, IAzureTreeItem, ILocationWizardContext, IResourceGroupWizardContext } from "vscode-azureextensionui"; import { IntegrationAccountPartnerTreeItem } from "../../../tree/integration-account/IntegrationAccountPartnerTreeItem"; @@ -17,6 +18,7 @@ export interface IPartnerWizardContext extends ILocationWizardContext, IResource partnerName?: string; partnerQualifier?: string; partnerValue?: string; + environment: AzureEnvironment; } export async function runNewPartnerWizard(integrationAccount: IntegrationAccount, node: IAzureNode, showCreatingNode: (label: string) => void): Promise { @@ -41,7 +43,8 @@ export async function runNewPartnerWizard(integrationAccount: IntegrationAccount name: integrationAccount.id!.split("/").slice(-5, -4)[0] }, subscriptionDisplayName: node.subscriptionDisplayName, - subscriptionId: node.subscriptionId + subscriptionId: node.subscriptionId, + environment: node.environment }; // Create a new instance of an Azure wizard for creating Partners. diff --git a/src/wizard/integration-account/schemas/createSchemaWizard.ts b/src/wizard/integration-account/schemas/createSchemaWizard.ts index 8af1da0b..eab6bd8c 100644 --- a/src/wizard/integration-account/schemas/createSchemaWizard.ts +++ b/src/wizard/integration-account/schemas/createSchemaWizard.ts @@ -3,6 +3,7 @@ * Licensed under the MIT License. See LICENSE in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import { AzureEnvironment } from "ms-rest-azure"; import { IntegrationAccount } from "azure-arm-logic/lib/models"; import { AzureWizard, AzureWizardExecuteStep, AzureWizardPromptStep, IActionContext, IAzureNode, IAzureTreeItem, ILocationWizardContext, IResourceGroupWizardContext } from "vscode-azureextensionui"; import { IntegrationAccountSchemaTreeItem } from "../../../tree/integration-account/IntegrationAccountSchemaTreeItem"; @@ -13,6 +14,7 @@ export interface ISchemaWizardContext extends ILocationWizardContext, IResourceG integrationAccountName: string; schema?: IntegrationAccountSchemaTreeItem; schemaName?: string; + environment: AzureEnvironment; } export async function runNewSchemaWizard(integrationAccount: IntegrationAccount, node: IAzureNode, showCreatingNode: (label: string) => void): Promise { @@ -35,7 +37,8 @@ export async function runNewSchemaWizard(integrationAccount: IntegrationAccount, name: integrationAccount.id!.split("/").slice(-5, -4)[0] }, subscriptionDisplayName: node.subscriptionDisplayName, - subscriptionId: node.subscriptionId + subscriptionId: node.subscriptionId, + environment: node.environment }; // Create a new instance of an Azure wizard for creating Schemas. diff --git a/src/wizard/logic-app/createLogicApp.ts b/src/wizard/logic-app/createLogicApp.ts index c0c3f761..9914bc7d 100644 --- a/src/wizard/logic-app/createLogicApp.ts +++ b/src/wizard/logic-app/createLogicApp.ts @@ -3,6 +3,7 @@ * Licensed under the MIT License. See LICENSE in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import { AzureEnvironment } from "ms-rest-azure"; import { AzureWizard, AzureWizardExecuteStep, AzureWizardPromptStep, IActionContext, IAzureNode, IAzureTreeItem, ILocationWizardContext, IResourceGroupWizardContext, LocationListStep, ResourceGroupCreateStep, ResourceGroupListStep } from "vscode-azureextensionui"; import { LogicAppTreeItem } from "../../tree/logic-app/LogicAppTreeItem"; import { LogicAppCreateStep } from "./LogicAppCreateStep"; @@ -11,6 +12,7 @@ import { LogicAppNameStep } from "./LogicAppNameStep"; export interface IAzureLogicAppWizardContext extends ILocationWizardContext, IResourceGroupWizardContext { logicApp?: LogicAppTreeItem; workflowName?: string; + environment: AzureEnvironment; } export async function createLogicApp(node: IAzureNode, showCreatingNode: (label: string) => void): Promise { @@ -31,7 +33,8 @@ export async function createLogicApp(node: IAzureNode, showCreatingNode: (label: let wizardContext: IAzureLogicAppWizardContext = { credentials: node.credentials, subscriptionDisplayName: node.subscriptionDisplayName, - subscriptionId: node.subscriptionId + subscriptionId: node.subscriptionId, + environment: node.environment }; // Create a new instance of an Azure wizard for creating Logic Apps. From c0df0d514679ba8a1990a58b6cb81530ca341f0f Mon Sep 17 00:00:00 2001 From: Michael Boucher Date: Tue, 31 Mar 2020 03:11:42 -0400 Subject: [PATCH 3/4] Fix #133 - Update Step classes to pass baseUri in LogicAppsManagementClient --- .../integration-account/agreements/agreementCreateStep.ts | 2 +- src/wizard/integration-account/agreements/agreementNameStep.ts | 2 +- src/wizard/integration-account/integrationAccountCreateStep.ts | 2 +- src/wizard/integration-account/integrationAccountNameStep.ts | 2 +- src/wizard/integration-account/maps/mapCreateStep.ts | 2 +- src/wizard/integration-account/maps/mapNameStep.ts | 2 +- src/wizard/integration-account/partners/partnerCreateStep.ts | 2 +- src/wizard/integration-account/schemas/schemaCreateStep.ts | 2 +- src/wizard/integration-account/schemas/schemaNameStep.ts | 2 +- src/wizard/logic-app/LogicAppCreateStep.ts | 2 +- src/wizard/logic-app/LogicAppNameStep.ts | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/wizard/integration-account/agreements/agreementCreateStep.ts b/src/wizard/integration-account/agreements/agreementCreateStep.ts index 4f5d18cd..28b7d539 100644 --- a/src/wizard/integration-account/agreements/agreementCreateStep.ts +++ b/src/wizard/integration-account/agreements/agreementCreateStep.ts @@ -12,7 +12,7 @@ import { IAgreementWizardContext } from "./createAgreementWizard"; export class AgreementCreateStep extends AzureWizardExecuteStep { public async execute(wizardContext: IAgreementWizardContext): Promise { - const client = new LogicAppsManagementClient(wizardContext.credentials, wizardContext.subscriptionId); + const client = new LogicAppsManagementClient(wizardContext.credentials, wizardContext.subscriptionId, wizardContext.environment.resourceManagerEndpointUrl); addExtensionUserAgent(client); const newAgreement: IntegrationAccountAgreement = await client.integrationAccountAgreements.createOrUpdate(wizardContext.resourceGroup!.name!, diff --git a/src/wizard/integration-account/agreements/agreementNameStep.ts b/src/wizard/integration-account/agreements/agreementNameStep.ts index 80faa6c1..662520f1 100644 --- a/src/wizard/integration-account/agreements/agreementNameStep.ts +++ b/src/wizard/integration-account/agreements/agreementNameStep.ts @@ -41,7 +41,7 @@ export class AgreementNameStep extends AzureWizardPromptStep { - const client = new LogicAppsManagementClient(wizardContext.credentials, wizardContext.subscriptionId); + const client = new LogicAppsManagementClient(wizardContext.credentials, wizardContext.subscriptionId, wizardContext.environment.resourceManagerEndpointUrl); addExtensionUserAgent(client); let agreements = await client.integrationAccountAgreements.list(wizardContext.resourceGroup!.name!, wizardContext.integrationAccountName); diff --git a/src/wizard/integration-account/integrationAccountCreateStep.ts b/src/wizard/integration-account/integrationAccountCreateStep.ts index 6920e5a5..9b628844 100644 --- a/src/wizard/integration-account/integrationAccountCreateStep.ts +++ b/src/wizard/integration-account/integrationAccountCreateStep.ts @@ -12,7 +12,7 @@ import { IIntegrationAccountWizardContext } from "./createIntegrationAccountWiza export class IntegrationAccountCreateStep extends AzureWizardExecuteStep { public async execute(wizardContext: IIntegrationAccountWizardContext): Promise { - const client = new LogicAppsManagementClient(wizardContext.credentials, wizardContext.subscriptionId); + const client = new LogicAppsManagementClient(wizardContext.credentials, wizardContext.subscriptionId, wizardContext.environment.resourceManagerEndpointUrl); addExtensionUserAgent(client); const newIntegrationAccount: IntegrationAccount = await client.integrationAccounts.createOrUpdate(wizardContext.resourceGroup!.name!, diff --git a/src/wizard/integration-account/integrationAccountNameStep.ts b/src/wizard/integration-account/integrationAccountNameStep.ts index e7301e67..97ff5668 100644 --- a/src/wizard/integration-account/integrationAccountNameStep.ts +++ b/src/wizard/integration-account/integrationAccountNameStep.ts @@ -52,7 +52,7 @@ export class IntegrationAccountNameStep extends AzureWizardPromptStep { public async execute(wizardContext: IMapWizardContext): Promise { - const client = new LogicAppsManagementClient(wizardContext.credentials, wizardContext.subscriptionId); + const client = new LogicAppsManagementClient(wizardContext.credentials, wizardContext.subscriptionId, wizardContext.environment.resourceManagerEndpointUrl); addExtensionUserAgent(client); const newMap: IntegrationAccountMap = await client.integrationAccountMaps.createOrUpdate(wizardContext.resourceGroup!.name!, diff --git a/src/wizard/integration-account/maps/mapNameStep.ts b/src/wizard/integration-account/maps/mapNameStep.ts index 7ab11771..5738f535 100644 --- a/src/wizard/integration-account/maps/mapNameStep.ts +++ b/src/wizard/integration-account/maps/mapNameStep.ts @@ -41,7 +41,7 @@ export class MapNameStep extends AzureWizardPromptStep { } private async isNameAvailable(name: string, wizardContext: IMapWizardContext): Promise { - const client = new LogicAppsManagementClient(wizardContext.credentials, wizardContext.subscriptionId); + const client = new LogicAppsManagementClient(wizardContext.credentials, wizardContext.subscriptionId, wizardContext.environment.resourceManagerEndpointUrl); addExtensionUserAgent(client); let maps = await client.integrationAccountMaps.list(wizardContext.resourceGroup!.name!, wizardContext.integrationAccountName); diff --git a/src/wizard/integration-account/partners/partnerCreateStep.ts b/src/wizard/integration-account/partners/partnerCreateStep.ts index dfe76a6b..284591a6 100644 --- a/src/wizard/integration-account/partners/partnerCreateStep.ts +++ b/src/wizard/integration-account/partners/partnerCreateStep.ts @@ -12,7 +12,7 @@ import { IPartnerWizardContext } from "./createPartnerWizard"; export class PartnerCreateStep extends AzureWizardExecuteStep { public async execute(wizardContext: IPartnerWizardContext): Promise { - const client = new LogicAppsManagementClient(wizardContext.credentials, wizardContext.subscriptionId); + const client = new LogicAppsManagementClient(wizardContext.credentials, wizardContext.subscriptionId, wizardContext.environment.resourceManagerEndpointUrl); addExtensionUserAgent(client); const newPartner: IntegrationAccountPartner = await client.integrationAccountPartners.createOrUpdate(wizardContext.resourceGroup!.name!, diff --git a/src/wizard/integration-account/schemas/schemaCreateStep.ts b/src/wizard/integration-account/schemas/schemaCreateStep.ts index 9125672a..d13df909 100644 --- a/src/wizard/integration-account/schemas/schemaCreateStep.ts +++ b/src/wizard/integration-account/schemas/schemaCreateStep.ts @@ -12,7 +12,7 @@ import { ISchemaWizardContext } from "./createSchemaWizard"; export class SchemaCreateStep extends AzureWizardExecuteStep { public async execute(wizardContext: ISchemaWizardContext): Promise { - const client = new LogicAppsManagementClient(wizardContext.credentials, wizardContext.subscriptionId); + const client = new LogicAppsManagementClient(wizardContext.credentials, wizardContext.subscriptionId, wizardContext.environment.resourceManagerEndpointUrl); addExtensionUserAgent(client); const newSchema: IntegrationAccountSchema = await client.integrationAccountSchemas.createOrUpdate(wizardContext.resourceGroup!.name!, diff --git a/src/wizard/integration-account/schemas/schemaNameStep.ts b/src/wizard/integration-account/schemas/schemaNameStep.ts index 17b1eb32..5c63ca97 100644 --- a/src/wizard/integration-account/schemas/schemaNameStep.ts +++ b/src/wizard/integration-account/schemas/schemaNameStep.ts @@ -41,7 +41,7 @@ export class SchemaNameStep extends AzureWizardPromptStep } private async isNameAvailable(name: string, wizardContext: ISchemaWizardContext): Promise { - const client = new LogicAppsManagementClient(wizardContext.credentials, wizardContext.subscriptionId); + const client = new LogicAppsManagementClient(wizardContext.credentials, wizardContext.subscriptionId, wizardContext.environment.resourceManagerEndpointUrl); addExtensionUserAgent(client); let schemas = await client.integrationAccountSchemas.list(wizardContext.resourceGroup!.name!, wizardContext.integrationAccountName); diff --git a/src/wizard/logic-app/LogicAppCreateStep.ts b/src/wizard/logic-app/LogicAppCreateStep.ts index fbecd5c4..f4bdb0d9 100644 --- a/src/wizard/logic-app/LogicAppCreateStep.ts +++ b/src/wizard/logic-app/LogicAppCreateStep.ts @@ -11,7 +11,7 @@ import { IAzureLogicAppWizardContext } from "./createLogicApp"; export class LogicAppCreateStep extends AzureWizardExecuteStep { public async execute(wizardContext: IAzureLogicAppWizardContext): Promise { - const client = new LogicAppsManagementClient(wizardContext.credentials, wizardContext.subscriptionId); + const client = new LogicAppsManagementClient(wizardContext.credentials, wizardContext.subscriptionId, wizardContext.environment.resourceManagerEndpointUrl); addExtensionUserAgent(client); const location = wizardContext.location!.name!; diff --git a/src/wizard/logic-app/LogicAppNameStep.ts b/src/wizard/logic-app/LogicAppNameStep.ts index 315cfd8e..21d7f08a 100644 --- a/src/wizard/logic-app/LogicAppNameStep.ts +++ b/src/wizard/logic-app/LogicAppNameStep.ts @@ -53,7 +53,7 @@ export class LogicAppNameStep extends AzureWizardPromptStep Date: Tue, 31 Mar 2020 04:16:01 -0400 Subject: [PATCH 4/4] Add credentials.environment to PartnerUtils --- src/utils/integration-account/partnerUtils.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/utils/integration-account/partnerUtils.ts b/src/utils/integration-account/partnerUtils.ts index 456ea0de..1b1a8281 100644 --- a/src/utils/integration-account/partnerUtils.ts +++ b/src/utils/integration-account/partnerUtils.ts @@ -3,6 +3,7 @@ * Licensed under the MIT License. See LICENSE in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import { AzureEnvironment } from "ms-rest-azure"; import LogicAppsManagementClient from "azure-arm-logic"; import { IntegrationAccountPartner } from "azure-arm-logic/lib/models"; import { ServiceClientCredentials } from "ms-rest"; @@ -31,8 +32,8 @@ export async function createNewPartner(partnerName: string, qualifier: string, v return partner; } -export async function getAllPartners(credentials: ServiceClientCredentials, subscriptionId: string, resourceGroup: string, integrationAccount: string): Promise { - const client = new LogicAppsManagementClient(credentials, subscriptionId); +export async function getAllPartners(credentials: IPartnerCredentials, subscriptionId: string, resourceGroup: string, integrationAccount: string): Promise { + const client = new LogicAppsManagementClient(credentials, subscriptionId, credentials.environment?.resourceManagerEndpointUrl); addExtensionUserAgent(client); const partners = await client.integrationAccountPartners.list(resourceGroup, integrationAccount); @@ -45,3 +46,7 @@ export async function getAllPartners(credentials: ServiceClientCredentials, subs return partners; } + +export interface IPartnerCredentials extends ServiceClientCredentials { + environment?: AzureEnvironment; +}