azure-pipelines-tasks-azurermdeploycommon 3.222.0 → 3.222.1

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.
@@ -12,11 +12,12 @@ export declare class AzureAppServiceUtility {
12
12
  private getKuduAuthHeader;
13
13
  getPhysicalPath(virtualApplication: string): Promise<string>;
14
14
  updateConfigurationSettings(properties: any, formatJSON?: boolean): Promise<void>;
15
- updateAndMonitorAppSettings(addProperties?: any, deleteProperties?: any, formatJSON?: boolean): Promise<boolean>;
15
+ updateAndMonitorAppSettings(addProperties?: any, deleteProperties?: any, formatJSON?: boolean, perSlot?: boolean): Promise<boolean>;
16
16
  updateConnectionStrings(addProperties: any): Promise<boolean>;
17
17
  enableRenameLockedFiles(): Promise<void>;
18
18
  updateStartupCommandAndRuntimeStack(runtimeStack: string, startupCommand?: string): Promise<void>;
19
19
  isSitePublishingCredentialsEnabled(): Promise<boolean>;
20
20
  private _getPhysicalToVirtualPathMap;
21
21
  private _getNewMetadata;
22
+ isFunctionAppOnCentauri(): Promise<boolean>;
22
23
  }
@@ -205,7 +205,7 @@ class AzureAppServiceUtility {
205
205
  console.log(tl.loc('UpdatedAppServiceConfigurationSettings'));
206
206
  });
207
207
  }
208
- updateAndMonitorAppSettings(addProperties, deleteProperties, formatJSON) {
208
+ updateAndMonitorAppSettings(addProperties, deleteProperties, formatJSON, perSlot = true) {
209
209
  return __awaiter(this, void 0, void 0, function* () {
210
210
  if (formatJSON) {
211
211
  var appSettingsProperties = {};
@@ -240,7 +240,9 @@ class AzureAppServiceUtility {
240
240
  else {
241
241
  console.log(tl.loc('AppServiceApplicationSettingsAlreadyPresent'));
242
242
  }
243
- yield this._appService.patchApplicationSettingsSlot(addProperties);
243
+ if (perSlot) {
244
+ yield this._appService.patchApplicationSettingsSlot(addProperties);
245
+ }
244
246
  return isNewValueUpdated;
245
247
  });
246
248
  }
@@ -390,5 +392,23 @@ class AzureAppServiceUtility {
390
392
  }
391
393
  return newProperties;
392
394
  }
395
+ isFunctionAppOnCentauri() {
396
+ return __awaiter(this, void 0, void 0, function* () {
397
+ try {
398
+ let details = yield this._appService.get();
399
+ if (details.properties["managedEnvironmentId"]) {
400
+ tl.debug("Function Container app is on Centauri.");
401
+ return true;
402
+ }
403
+ else {
404
+ return false;
405
+ }
406
+ }
407
+ catch (error) {
408
+ tl.debug(`Skipping Centauri check: ${error}`);
409
+ return false;
410
+ }
411
+ });
412
+ }
393
413
  }
394
414
  exports.AzureAppServiceUtility = AzureAppServiceUtility;
@@ -209,7 +209,7 @@ export class AzureAppServiceUtility {
209
209
  console.log(tl.loc('UpdatedAppServiceConfigurationSettings'));
210
210
  }
211
211
 
212
- public async updateAndMonitorAppSettings(addProperties?: any, deleteProperties?: any, formatJSON?: boolean): Promise<boolean> {
212
+ public async updateAndMonitorAppSettings(addProperties?: any, deleteProperties?: any, formatJSON?: boolean, perSlot: boolean = true): Promise<boolean> {
213
213
  if(formatJSON) {
214
214
  var appSettingsProperties = {};
215
215
  for(var property in addProperties) {
@@ -251,7 +251,9 @@ export class AzureAppServiceUtility {
251
251
  console.log(tl.loc('AppServiceApplicationSettingsAlreadyPresent'));
252
252
  }
253
253
 
254
- await this._appService.patchApplicationSettingsSlot(addProperties);
254
+ if (perSlot) {
255
+ await this._appService.patchApplicationSettingsSlot(addProperties);
256
+ }
255
257
  return isNewValueUpdated;
256
258
  }
257
259
 
@@ -413,4 +415,21 @@ export class AzureAppServiceUtility {
413
415
  return newProperties;
414
416
  }
415
417
 
418
+ public async isFunctionAppOnCentauri(): Promise<boolean>{
419
+ try{
420
+ let details: any = await this._appService.get();
421
+ if (details.properties["managedEnvironmentId"]){
422
+ tl.debug("Function Container app is on Centauri.");
423
+ return true;
424
+ }
425
+ else{
426
+ return false;
427
+ }
428
+ }
429
+ catch(error){
430
+ tl.debug(`Skipping Centauri check: ${error}`);
431
+ return false;
432
+ }
433
+ }
434
+
416
435
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "azure-pipelines-tasks-azurermdeploycommon",
3
- "version": "3.222.0",
3
+ "version": "3.222.1",
4
4
  "description": "Common Lib for Azure ARM REST apis",
5
5
  "repository": {
6
6
  "type": "git",