Skip to content

Commit 4c9dee8

Browse files
authored
ARM-rest-v2: Add mask hint for msdeploy when basic auth is disabled (#18184)
* Add mask hint for msdeploy when basic auth is disabled Though bearer AuthN is used, lets try to set publish profile password for mask hints to maintain compat with old behavior for MSDEPLOY on best effort basis. This needs to be cleaned up once MSDEPLOY suppport is reomve. Safe handle the exception setting up mask hint as we dont want to fail here. * Bump up version
1 parent d432af9 commit 4c9dee8

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

common-npm-packages/azure-arm-rest-v2/azureAppServiceUtility.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,15 @@ export class AzureAppServiceUtility {
114114
if(scmPolicyCheck === false) {
115115
token = await this._appService._client.getCredentials().getToken();
116116
method = "Bearer";
117+
// Though bearer AuthN is used, lets try to set publish profile password for mask hints to maintain compat with old behavior for MSDEPLOY.
118+
// This needs to be cleaned up once MSDEPLOY suppport is reomve. Safe handle the exception setting up mask hint as we dont want to fail here.
119+
try {
120+
tl.setVariable(`AZURE_APP_MSDEPLOY_${this._appService.getSlot()}_PASSWORD`, publishingCredentials.properties["publishingPassword"], true);
121+
}
122+
catch (error){
123+
// safe handle the exception setting up mask hint
124+
tl.debug(`Setting mask hint for publish profile password failed with error: ${error}`);
125+
}
117126
} else {
118127
tl.setVariable(`AZURE_APP_SERVICE_KUDU_${this._appService.getSlot()}_PASSWORD`, publishingCredentials.properties["publishingPassword"], true);
119128
const buffer = new Buffer(publishingCredentials.properties["publishingUserName"] + ':' + publishingCredentials.properties["publishingPassword"]);
@@ -237,4 +246,4 @@ export class AzureAppServiceUtility {
237246
return false;
238247
}
239248
}
240-
}
249+
}

common-npm-packages/azure-arm-rest-v2/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

common-npm-packages/azure-arm-rest-v2/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "azure-pipelines-tasks-azure-arm-rest-v2",
3-
"version": "3.221.2",
3+
"version": "3.221.3",
44
"description": "Common Lib for Azure ARM REST apis",
55
"repository": {
66
"type": "git",

0 commit comments

Comments
 (0)