azure-pipelines-tasks-azurermdeploycommon 3.221.0 → 3.221.2
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.
|
@@ -141,17 +141,24 @@ class AzureAppServiceUtility {
|
|
|
141
141
|
getKuduAuthHeader(publishingCredentials) {
|
|
142
142
|
return __awaiter(this, void 0, void 0, function* () {
|
|
143
143
|
const scmPolicyCheck = yield this.isSitePublishingCredentialsEnabled();
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
144
|
+
let token = "";
|
|
145
|
+
let method = "";
|
|
146
|
+
if (scmPolicyCheck === false) {
|
|
147
|
+
token = yield this._appService._client.getCredentials().getToken();
|
|
148
|
+
method = "Bearer";
|
|
148
149
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
150
|
+
else {
|
|
151
|
+
tl.setVariable(`AZURE_APP_SERVICE_KUDU_${this._appService.getSlot()}_PASSWORD`, publishingCredentials.properties["publishingPassword"], true);
|
|
152
|
+
const buffer = new Buffer(publishingCredentials.properties["publishingUserName"] + ':' + publishingCredentials.properties["publishingPassword"]);
|
|
153
|
+
token = buffer.toString('base64');
|
|
154
|
+
method = "Basic";
|
|
155
|
+
}
|
|
156
|
+
const authMethodtelemetry = {
|
|
157
|
+
authMethod: method
|
|
158
|
+
};
|
|
159
|
+
tl.debug(`Using ${method} authentication method for Kudu service.`);
|
|
160
|
+
console.log("##vso[telemetry.publish area=TaskDeploymentMethod;feature=AzureAppServiceDeployment]" + JSON.stringify(authMethodtelemetry));
|
|
161
|
+
return method + " " + token;
|
|
155
162
|
});
|
|
156
163
|
}
|
|
157
164
|
getPhysicalPath(virtualApplication) {
|
|
@@ -301,8 +308,8 @@ class AzureAppServiceUtility {
|
|
|
301
308
|
}
|
|
302
309
|
}
|
|
303
310
|
catch (error) {
|
|
304
|
-
tl.debug(`
|
|
305
|
-
return
|
|
311
|
+
tl.debug(`Call to get SCM Policy check failed: ${error}`);
|
|
312
|
+
return false;
|
|
306
313
|
}
|
|
307
314
|
});
|
|
308
315
|
}
|
|
@@ -134,20 +134,26 @@ export class AzureAppServiceUtility {
|
|
|
134
134
|
private async getKuduAuthHeader(publishingCredentials: any): Promise<string> {
|
|
135
135
|
const scmPolicyCheck = await this.isSitePublishingCredentialsEnabled();
|
|
136
136
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
137
|
+
let token = "";
|
|
138
|
+
let method = "";
|
|
139
|
+
|
|
140
|
+
if(scmPolicyCheck === false) {
|
|
141
|
+
token = await this._appService._client.getCredentials().getToken();
|
|
142
|
+
method = "Bearer";
|
|
143
|
+
} else {
|
|
144
|
+
tl.setVariable(`AZURE_APP_SERVICE_KUDU_${this._appService.getSlot()}_PASSWORD`, publishingCredentials.properties["publishingPassword"], true);
|
|
145
|
+
const buffer = new Buffer(publishingCredentials.properties["publishingUserName"] + ':' + publishingCredentials.properties["publishingPassword"]);
|
|
146
|
+
token = buffer.toString('base64');
|
|
147
|
+
method = "Basic";
|
|
141
148
|
}
|
|
142
149
|
|
|
143
|
-
const
|
|
144
|
-
|
|
150
|
+
const authMethodtelemetry = {
|
|
151
|
+
authMethod: method
|
|
152
|
+
};
|
|
153
|
+
tl.debug(`Using ${method} authentication method for Kudu service.`);
|
|
154
|
+
console.log("##vso[telemetry.publish area=TaskDeploymentMethod;feature=AzureAppServiceDeployment]" + JSON.stringify(authMethodtelemetry));
|
|
145
155
|
|
|
146
|
-
|
|
147
|
-
tl.debug("Kudu: using basic auth.");
|
|
148
|
-
|
|
149
|
-
const auth = (new Buffer(userName + ':' + password).toString('base64'));
|
|
150
|
-
return "Basic " + auth;
|
|
156
|
+
return method + " " + token;
|
|
151
157
|
}
|
|
152
158
|
|
|
153
159
|
public async getPhysicalPath(virtualApplication: string): Promise<string> {
|
|
@@ -309,8 +315,8 @@ export class AzureAppServiceUtility {
|
|
|
309
315
|
}
|
|
310
316
|
}
|
|
311
317
|
catch(error){
|
|
312
|
-
tl.debug(`
|
|
313
|
-
return
|
|
318
|
+
tl.debug(`Call to get SCM Policy check failed: ${error}`);
|
|
319
|
+
return false;
|
|
314
320
|
}
|
|
315
321
|
}
|
|
316
322
|
|