Skip to content

Commit

Permalink
Python extension path fix - Azure App Service Manage Task m132 (#7048)
Browse files Browse the repository at this point in the history
* resolved merge conflicts

* make string const

* removed space

* removed space

* added comment to track

* changed task version
  • Loading branch information
vincent1173 authored Apr 23, 2018
1 parent 8d31d94 commit d0612c3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions Tasks/AzureAppServiceManage/operations/KuduServiceUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import tl = require('vsts-task-lib/task');
import Q = require('q');
import { Kudu } from 'azure-arm-rest/azure-arm-app-service-kudu';
import webClient = require('azure-arm-rest/webClient');
const pythonExtensionPrefix: string = "azureappservice-";

export class KuduServiceUtils {
private _appServiceKuduService: Kudu;
Expand Down Expand Up @@ -52,8 +53,10 @@ export class KuduServiceUtils {

for(var extensionID of extensionList) {
var siteExtensionDetails = null;
if(siteExtensionMap[extensionID]) {
siteExtensionDetails = siteExtensionMap[extensionID];

// Python extensions are moved to Nuget and the extensions IDs are changed. The belo check ensures that old extensions are mapped to new extension ID.
if(siteExtensionMap[extensionID] || (extensionID.startsWith('python') && siteExtensionMap[pythonExtensionPrefix + extensionID])) {
siteExtensionDetails = siteExtensionMap[extensionID] || siteExtensionMap[pythonExtensionPrefix + extensionID];
console.log(tl.loc('ExtensionAlreadyInstalled', extensionID));
}
else {
Expand Down Expand Up @@ -123,7 +126,7 @@ export class KuduServiceUtils {
}

private _getExtensionLocalPath(extensionInfo: JSON): string {
var extensionId: string = extensionInfo['id'];
var extensionId: string = extensionInfo['id'].replace(pythonExtensionPrefix, "");
var homeDir = "D:\\home\\";

if(extensionId.startsWith('python2')) {
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureAppServiceManage/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"version": {
"Major": 0,
"Minor": 2,
"Patch": 25
"Patch": 27
},
"minimumAgentVersion": "1.102.0",
"instanceNameFormat": "$(Action): $(WebAppName)",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureAppServiceManage/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"version": {
"Major": 0,
"Minor": 2,
"Patch": 25
"Patch": 27
},
"minimumAgentVersion": "1.102.0",
"instanceNameFormat": "ms-resource:loc.instanceNameFormat",
Expand Down

0 comments on commit d0612c3

Please sign in to comment.