diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..226cf80 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,11 @@ +--- + +As all changes are publicly made available via PRs, you must agree to the terms before contributing: + +- [ ] I represent that each of _my contributions_ is entirely _my original work_ +- [ ] I have sole ownership of intellectual property rights to _my contribution_ +- [ ] I approve that the community is free to use _my contribution_ + +Make sure that you have checked all tick boxes before this PR can be approved. + +--- diff --git a/delete-adf-items/v2/deleteadfitems.ts b/delete-adf-items/v2/deleteadfitems.ts index 4474b85..d3dc057 100644 --- a/delete-adf-items/v2/deleteadfitems.ts +++ b/delete-adf-items/v2/deleteadfitems.ts @@ -104,6 +104,7 @@ function checkDataFactory(datafactoryOption: DatafactoryOptions): Promise { if (result && result.status !== 200) { error(loc("Generic_CheckDataFactory2", dataFactoryName)); + debug(`Error: ${result && result.bodyAsText}`); reject(loc("Generic_CheckDataFactory2", dataFactoryName)); } else { debug(`Datafactory '${dataFactoryName}' exist`); @@ -459,7 +460,14 @@ async function main(): Promise { const scheme = azureModels.AuthScheme; debug("Parsed task inputs"); - loginAzure(clientId, key, tenantID, authorityHostUrl, scheme, taskParameters.Audience) + loginAzure( + clientId, + key, + tenantID, + authorityHostUrl, + scheme, + taskParameters.Audience || azureModels.Audience + ) .then((azureClient: AzureServiceClient) => { datafactoryOption.azureClient = azureClient; debug("Azure client retrieved."); diff --git a/delete-adf-items/v2/models/azureModels.ts b/delete-adf-items/v2/models/azureModels.ts index 5a43693..484c0ba 100644 --- a/delete-adf-items/v2/models/azureModels.ts +++ b/delete-adf-items/v2/models/azureModels.ts @@ -116,6 +116,10 @@ export class AzureModels { return this.servicePrincipalKey; } + public get Audience(): string { + return `https://${this.EnvironmentUrl}/.default`; + } + public get EnvironmentUrl(): string { return new URL(this.environmentUrl).hostname as string; } diff --git a/delete-adf-items/v2/models/taskParameters.ts b/delete-adf-items/v2/models/taskParameters.ts index b6a36b7..ad6706f 100644 --- a/delete-adf-items/v2/models/taskParameters.ts +++ b/delete-adf-items/v2/models/taskParameters.ts @@ -117,9 +117,8 @@ export class TaskParameters { if (this.workspaceUrl) return new URL(this.workspaceUrl as string).hostname; } - public get Audience(): string { + public get Audience(): string | undefined { if (this.workspaceUrl) return "https://dev.azuresynapse.net/.default"; - return "https://management.azure.com/.default"; } public get ServiceFilter(): string | undefined { diff --git a/delete-adf-items/v2/task.json b/delete-adf-items/v2/task.json index 30f81cc..424096b 100644 --- a/delete-adf-items/v2/task.json +++ b/delete-adf-items/v2/task.json @@ -13,7 +13,7 @@ "version": { "Major": "2", "Minor": "5", - "Patch": "2" + "Patch": "3" }, "minimumAgentVersion": "1.100.0", "groups": [ diff --git a/deploy-adf-json/v2/deployadfjson.ts b/deploy-adf-json/v2/deployadfjson.ts index 99bbb55..24bb81a 100644 --- a/deploy-adf-json/v2/deployadfjson.ts +++ b/deploy-adf-json/v2/deployadfjson.ts @@ -110,6 +110,7 @@ function checkDataFactory(datafactoryOption: DatafactoryOptions): Promise { if (result && result.status !== 200) { error(loc("Generic_CheckDataFactory2", dataFactoryName)); + debug(`Error: ${result && result.bodyAsText}`); reject(loc("Generic_CheckDataFactory2", dataFactoryName)); } else { debug(`Datafactory '${dataFactoryName}' exist`); @@ -400,7 +401,14 @@ async function main(): Promise { const scheme = azureModels.AuthScheme; debug("Parsed task inputs"); - loginAzure(clientId, key, tenantID, authorityHostUrl, scheme, taskParameters.Audience) + loginAzure( + clientId, + key, + tenantID, + authorityHostUrl, + scheme, + taskParameters.Audience || azureModels.Audience + ) .then((azureClient: AzureServiceClient) => { datafactoryOption.azureClient = azureClient; debug("Azure client retrieved."); diff --git a/deploy-adf-json/v2/models/azureModels.ts b/deploy-adf-json/v2/models/azureModels.ts index 8e5c7a2..a366dc1 100644 --- a/deploy-adf-json/v2/models/azureModels.ts +++ b/deploy-adf-json/v2/models/azureModels.ts @@ -116,6 +116,10 @@ export class AzureModels { return this.servicePrincipalKey; } + public get Audience(): string { + return `https://${this.EnvironmentUrl}/.default`; + } + public get EnvironmentUrl(): string { return new URL(this.environmentUrl).hostname as string; } diff --git a/deploy-adf-json/v2/models/taskParameters.ts b/deploy-adf-json/v2/models/taskParameters.ts index 9a618d6..bea4cfc 100644 --- a/deploy-adf-json/v2/models/taskParameters.ts +++ b/deploy-adf-json/v2/models/taskParameters.ts @@ -91,7 +91,7 @@ export class TaskParameters { this.triggerPath = (this.triggerPath && this.triggerPath.replace(rootPath, "")) === "" ? undefined : this.triggerPath; - this.continue = getBoolInput("Continue", false); + this.continue = getBoolInput("Continue", false) as boolean; this.throttle = Number.parseInt(getInput("Throttle", false) as string); this.throttle = isNaN(this.throttle) ? 5 : this.throttle; this.detectDependency = getBoolInput("detectDependency", false); @@ -125,9 +125,8 @@ export class TaskParameters { if (this.workspaceUrl) return new URL(this.workspaceUrl as string).hostname; } - public get Audience(): string { + public get Audience(): string | undefined { if (this.workspaceUrl) return "https://dev.azuresynapse.net/.default"; - return "https://management.azure.com/.default"; } public get ServicePath(): string | undefined { diff --git a/deploy-adf-json/v2/task.json b/deploy-adf-json/v2/task.json index a25700b..1507acc 100644 --- a/deploy-adf-json/v2/task.json +++ b/deploy-adf-json/v2/task.json @@ -13,7 +13,7 @@ "version": { "Major": "2", "Minor": "5", - "Patch": "2" + "Patch": "3" }, "minimumAgentVersion": "1.100.0", "groups": [ diff --git a/query-adf-run/task.json b/query-adf-run/task.json index 6227130..e23c11b 100644 --- a/query-adf-run/task.json +++ b/query-adf-run/task.json @@ -15,7 +15,7 @@ "version": { "Major": "2", "Minor": "5", - "Patch": "2" + "Patch": "3" }, "instanceNameFormat": "Query Azure Data Factory runs", "groups": [ diff --git a/toggle-adf-trigger/v2/models/azureModels.ts b/toggle-adf-trigger/v2/models/azureModels.ts index 6a0f60e..d0f4e6b 100644 --- a/toggle-adf-trigger/v2/models/azureModels.ts +++ b/toggle-adf-trigger/v2/models/azureModels.ts @@ -116,6 +116,10 @@ export class AzureModels { return this.servicePrincipalKey; } + public get Audience(): string { + return `https://${this.EnvironmentUrl}/.default`; + } + public get EnvironmentUrl(): string { return new URL(this.environmentUrl).hostname as string; } diff --git a/toggle-adf-trigger/v2/models/taskParameters.ts b/toggle-adf-trigger/v2/models/taskParameters.ts index c4e4cd4..1149b5e 100644 --- a/toggle-adf-trigger/v2/models/taskParameters.ts +++ b/toggle-adf-trigger/v2/models/taskParameters.ts @@ -78,7 +78,7 @@ export class TaskParameters { break; } - this.continue = getBoolInput("Continue", false); + this.continue = getBoolInput("Continue", false) as boolean; this.throttle = Number.parseInt(getInput("Throttle", false) as string); this.throttle = isNaN(this.throttle) ? 5 : this.throttle; } catch (err: unknown) { @@ -102,9 +102,8 @@ export class TaskParameters { if (this.workspaceUrl) return new URL(this.workspaceUrl as string).hostname; } - public get Audience(): string { + public get Audience(): string | undefined { if (this.workspaceUrl) return "https://dev.azuresynapse.net/.default"; - return "https://management.azure.com/.default"; } public get TriggerFilter(): string { diff --git a/toggle-adf-trigger/v2/task.json b/toggle-adf-trigger/v2/task.json index fb65baf..5b9c9d4 100644 --- a/toggle-adf-trigger/v2/task.json +++ b/toggle-adf-trigger/v2/task.json @@ -13,7 +13,7 @@ "version": { "Major": "2", "Minor": "5", - "Patch": "2" + "Patch": "3" }, "minimumAgentVersion": "1.100.0", "groups": [ diff --git a/toggle-adf-trigger/v2/toggleadftrigger.ts b/toggle-adf-trigger/v2/toggleadftrigger.ts index 51a164a..276eb26 100644 --- a/toggle-adf-trigger/v2/toggleadftrigger.ts +++ b/toggle-adf-trigger/v2/toggleadftrigger.ts @@ -101,6 +101,7 @@ function checkDataFactory(datafactoryOption: DatafactoryOptions): Promise { if (result && result.status !== 200) { error(loc("Generic_CheckDataFactory2", dataFactoryName)); + debug(`Error: ${result && result.bodyAsText}`); reject(loc("Generic_CheckDataFactory2", dataFactoryName)); } else { debug(`Datafactory '${dataFactoryName}' exist`); @@ -365,7 +366,14 @@ async function main(): Promise { const scheme = azureModels.AuthScheme; debug("Parsed task inputs"); - loginAzure(clientId, key, tenantID, authorityHostUrl, scheme, taskParameters.Audience) + loginAzure( + clientId, + key, + tenantID, + authorityHostUrl, + scheme, + taskParameters.Audience || azureModels.Audience + ) .then((azureClient: AzureServiceClient) => { datafactoryOption.azureClient = azureClient; debug("Azure client retrieved."); diff --git a/trigger-adf-pipeline/v2/models/azureModels.ts b/trigger-adf-pipeline/v2/models/azureModels.ts index bc058bc..af6e985 100644 --- a/trigger-adf-pipeline/v2/models/azureModels.ts +++ b/trigger-adf-pipeline/v2/models/azureModels.ts @@ -116,6 +116,10 @@ export class AzureModels { return this.servicePrincipalKey; } + public get Audience(): string { + return `https://${this.EnvironmentUrl}/.default`; + } + public get EnvironmentUrl(): string { return new URL(this.environmentUrl).hostname as string; } diff --git a/trigger-adf-pipeline/v2/models/taskParameters.ts b/trigger-adf-pipeline/v2/models/taskParameters.ts index 762d214..3e93422 100644 --- a/trigger-adf-pipeline/v2/models/taskParameters.ts +++ b/trigger-adf-pipeline/v2/models/taskParameters.ts @@ -92,7 +92,7 @@ export class TaskParameters { (pipelineParameterType as string).toLowerCase() === "path" ) as string; - this.continue = getBoolInput("Continue", false); + this.continue = getBoolInput("Continue", false) as boolean; this.throttle = Number.parseInt(getInput("Throttle", false) as string); this.throttle = isNaN(this.throttle) ? 5 : this.throttle; this.deploymentOutputs = getInput("deploymentOutputs", false) as string; @@ -122,9 +122,8 @@ export class TaskParameters { if (this.workspaceUrl) return new URL(this.workspaceUrl as string).hostname; } - public get Audience(): string { + public get Audience(): string | undefined { if (this.workspaceUrl) return "https://dev.azuresynapse.net/.default"; - return "https://management.azure.com/.default"; } public get PipelineFilter(): string { diff --git a/trigger-adf-pipeline/v2/task.json b/trigger-adf-pipeline/v2/task.json index 8df226b..9e03020 100644 --- a/trigger-adf-pipeline/v2/task.json +++ b/trigger-adf-pipeline/v2/task.json @@ -13,7 +13,7 @@ "version": { "Major": "2", "Minor": "5", - "Patch": "2" + "Patch": "3" }, "minimumAgentVersion": "1.100.0", "groups": [ diff --git a/trigger-adf-pipeline/v2/triggeradfpipeline.ts b/trigger-adf-pipeline/v2/triggeradfpipeline.ts index f25b5b7..dac498a 100644 --- a/trigger-adf-pipeline/v2/triggeradfpipeline.ts +++ b/trigger-adf-pipeline/v2/triggeradfpipeline.ts @@ -117,6 +117,7 @@ function checkDataFactory(datafactoryOption: DatafactoryOptions): Promise { if (result && result.status !== 200) { error(loc("Generic_CheckDataFactory2", dataFactoryName)); + debug(`Error: ${result && result.bodyAsText}`); reject(loc("Generic_CheckDataFactory2", dataFactoryName)); } else { debug(`Datafactory '${dataFactoryName}' exist`); @@ -389,7 +390,14 @@ async function main(): Promise { const scheme = azureModels.AuthScheme; debug("Parsed task inputs"); - loginAzure(clientId, key, tenantID, authorityHostUrl, scheme, taskParameters.Audience) + loginAzure( + clientId, + key, + tenantID, + authorityHostUrl, + scheme, + taskParameters.Audience || azureModels.Audience + ) .then((azureClient: AzureServiceClient) => { datafactoryOption.azureClient = azureClient; debug("Azure client retrieved."); diff --git a/vss-extension-preview.json b/vss-extension-preview.json index 81defda..15f5f02 100644 --- a/vss-extension-preview.json +++ b/vss-extension-preview.json @@ -1,7 +1,7 @@ { "manifestVersion": 1, "id": "vsts-publish-adf-preview", - "version": "2.5.2", + "version": "2.5.3", "name": "Azure Data Factory (Preview)", "publisher": "liprec", "public": false, diff --git a/vss-extension.json b/vss-extension.json index 2989d49..30a3115 100644 --- a/vss-extension.json +++ b/vss-extension.json @@ -1,7 +1,7 @@ { "manifestVersion": 1, "id": "vsts-publish-adf", - "version": "2.5.2", + "version": "2.5.3", "name": "Azure Data Factory", "publisher": "liprec", "public": true,