azure-pipelines-tasks-azurermdeploycommon 3.221.2 → 3.221.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -143,13 +143,24 @@ class AzureAppServiceUtility {
|
|
|
143
143
|
const scmPolicyCheck = yield this.isSitePublishingCredentialsEnabled();
|
|
144
144
|
let token = "";
|
|
145
145
|
let method = "";
|
|
146
|
+
const password = publishingCredentials.properties["publishingPassword"];
|
|
147
|
+
const userName = publishingCredentials.properties["publishingUserName"];
|
|
146
148
|
if (scmPolicyCheck === false) {
|
|
147
149
|
token = yield this._appService._client.getCredentials().getToken();
|
|
148
150
|
method = "Bearer";
|
|
151
|
+
// Though bearer AuthN is used, lets try to set publish profile password for mask hints to maintain compat with old behavior for MSDEPLOY.
|
|
152
|
+
// 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.
|
|
153
|
+
try {
|
|
154
|
+
tl.setVariable(`AZURE_APP_MSDEPLOY_${this._appService.getSlot()}_PASSWORD`, password, true);
|
|
155
|
+
}
|
|
156
|
+
catch (error) {
|
|
157
|
+
// safe handle the exception setting up mask hint
|
|
158
|
+
tl.debug(`Setting mask hint for publish profile password failed with error: ${error}`);
|
|
159
|
+
}
|
|
149
160
|
}
|
|
150
161
|
else {
|
|
151
|
-
tl.setVariable(`AZURE_APP_SERVICE_KUDU_${this._appService.getSlot()}_PASSWORD`,
|
|
152
|
-
const buffer = new Buffer(
|
|
162
|
+
tl.setVariable(`AZURE_APP_SERVICE_KUDU_${this._appService.getSlot()}_PASSWORD`, password, true);
|
|
163
|
+
const buffer = new Buffer(userName + ':' + password);
|
|
153
164
|
token = buffer.toString('base64');
|
|
154
165
|
method = "Basic";
|
|
155
166
|
}
|
|
@@ -137,12 +137,27 @@ export class AzureAppServiceUtility {
|
|
|
137
137
|
let token = "";
|
|
138
138
|
let method = "";
|
|
139
139
|
|
|
140
|
+
const password = publishingCredentials.properties["publishingPassword"];
|
|
141
|
+
const userName = publishingCredentials.properties["publishingUserName"];
|
|
142
|
+
|
|
140
143
|
if(scmPolicyCheck === false) {
|
|
141
144
|
token = await this._appService._client.getCredentials().getToken();
|
|
142
145
|
method = "Bearer";
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
// Though bearer AuthN is used, lets try to set publish profile password for mask hints to maintain compat with old behavior for MSDEPLOY.
|
|
149
|
+
// 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.
|
|
150
|
+
try {
|
|
151
|
+
tl.setVariable(`AZURE_APP_MSDEPLOY_${this._appService.getSlot()}_PASSWORD`, password, true);
|
|
152
|
+
}
|
|
153
|
+
catch (error) {
|
|
154
|
+
// safe handle the exception setting up mask hint
|
|
155
|
+
tl.debug(`Setting mask hint for publish profile password failed with error: ${error}`);
|
|
156
|
+
}
|
|
157
|
+
|
|
143
158
|
} else {
|
|
144
|
-
tl.setVariable(`AZURE_APP_SERVICE_KUDU_${this._appService.getSlot()}_PASSWORD`,
|
|
145
|
-
const buffer = new Buffer(
|
|
159
|
+
tl.setVariable(`AZURE_APP_SERVICE_KUDU_${this._appService.getSlot()}_PASSWORD`, password, true);
|
|
160
|
+
const buffer = new Buffer(userName + ':' + password);
|
|
146
161
|
token = buffer.toString('base64');
|
|
147
162
|
method = "Basic";
|
|
148
163
|
}
|