azure-pipelines-tasks-azurermdeploycommon 3.221.1 → 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
+ let token = "";
145
+ let method = "";
144
146
  if (scmPolicyCheck === false) {
145
- tl.debug('Kudu: Getting Bearer token');
146
- const accessToken = yield this._appService._client.getCredentials().getToken();
147
- return "Bearer " + accessToken;
147
+ token = yield this._appService._client.getCredentials().getToken();
148
+ method = "Bearer";
148
149
  }
149
150
  else {
150
151
  tl.setVariable(`AZURE_APP_SERVICE_KUDU_${this._appService.getSlot()}_PASSWORD`, publishingCredentials.properties["publishingPassword"], true);
151
- var accessToken = (new Buffer(publishingCredentials.properties["publishingUserName"] + ':' + publishingCredentials.properties["publishingPassword"]).toString('base64'));
152
- tl.debug("Kudu: using basic auth.");
153
- return "Basic " + accessToken;
152
+ const buffer = new Buffer(publishingCredentials.properties["publishingUserName"] + ':' + publishingCredentials.properties["publishingPassword"]);
153
+ token = buffer.toString('base64');
154
+ method = "Basic";
154
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) {
@@ -134,17 +134,26 @@ export class AzureAppServiceUtility {
134
134
  private async getKuduAuthHeader(publishingCredentials: any): Promise<string> {
135
135
  const scmPolicyCheck = await this.isSitePublishingCredentialsEnabled();
136
136
 
137
+ let token = "";
138
+ let method = "";
139
+
137
140
  if(scmPolicyCheck === false) {
138
- tl.debug('Kudu: Getting Bearer token');
139
- const accessToken = await this._appService._client.getCredentials().getToken();
140
- return "Bearer " + accessToken;
141
+ token = await this._appService._client.getCredentials().getToken();
142
+ method = "Bearer";
141
143
  } else {
142
144
  tl.setVariable(`AZURE_APP_SERVICE_KUDU_${this._appService.getSlot()}_PASSWORD`, publishingCredentials.properties["publishingPassword"], true);
143
- var accessToken = (new Buffer(publishingCredentials.properties["publishingUserName"] + ':' + publishingCredentials.properties["publishingPassword"]).toString('base64'));
144
- tl.debug("Kudu: using basic auth.");
145
-
146
- return "Basic " + accessToken;
145
+ const buffer = new Buffer(publishingCredentials.properties["publishingUserName"] + ':' + publishingCredentials.properties["publishingPassword"]);
146
+ token = buffer.toString('base64');
147
+ method = "Basic";
147
148
  }
149
+
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));
155
+
156
+ return method + " " + token;
148
157
  }
149
158
 
150
159
  public async getPhysicalPath(virtualApplication: string): Promise<string> {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "azure-pipelines-tasks-azurermdeploycommon",
3
- "version": "3.221.1",
3
+ "version": "3.221.2",
4
4
  "description": "Common Lib for Azure ARM REST apis",
5
5
  "repository": {
6
6
  "type": "git",