Skip to content

Commit 16e0107

Browse files
committed
Handled PR comments
1 parent 1fa0971 commit 16e0107

File tree

11 files changed

+61
-80
lines changed

11 files changed

+61
-80
lines changed

Tasks/AzureRmWebAppDeploymentV5/deploymentProvider/BuiltInLinuxWebAppDeploymentProvider.ts

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -65,25 +65,12 @@ export class BuiltInLinuxWebAppDeploymentProvider extends AzureRmWebAppDeploymen
6565
let tempPackagePath = deployUtility.generateTemporaryFolderOrZipPath(tl.getVariable('AGENT.TEMPDIRECTORY'), false);
6666
let archivedWebPackage = await zipUtility.archiveFolder(this.taskParams.Package.getPath(), "", tempPackagePath);
6767
tl.debug("Compressed folder into zip " + archivedWebPackage);
68-
if (zipDeploy) {
69-
this.zipDeploymentID = await this.kuduServiceUtility.deployUsingZipDeploy(archivedWebPackage, this.taskParams.TakeAppOfflineFlag,
70-
{ slotName: this.appService.getSlot() }, true);
71-
}
72-
else {
73-
this.zipDeploymentID = await this.kuduServiceUtility.deployUsingOneDeploy(archivedWebPackage, isClean, this.taskParams.TakeAppOfflineFlag,
74-
{ slotName: this.appService.getSlot() }, 'Zip', true);
75-
}
68+
await this.InvokeDeploymentMethod(zipDeploy, archivedWebPackage, 'Zip', isClean);
7669

7770
break;
71+
7872
case PackageType.zip:
79-
if (zipDeploy) {
80-
this.zipDeploymentID = await this.kuduServiceUtility.deployUsingZipDeploy(this.taskParams.Package.getPath(), this.taskParams.TakeAppOfflineFlag,
81-
{ slotName: this.appService.getSlot() }, true);
82-
}
83-
else {
84-
this.zipDeploymentID = await this.kuduServiceUtility.deployUsingOneDeploy(this.taskParams.Package.getPath(), isClean, this.taskParams.TakeAppOfflineFlag,
85-
{ slotName: this.appService.getSlot() }, 'Zip', true);
86-
}
73+
await this.InvokeDeploymentMethod(zipDeploy, this.taskParams.Package.getPath(), 'Zip', isClean);
8774

8875
break;
8976

@@ -93,14 +80,7 @@ export class BuiltInLinuxWebAppDeploymentProvider extends AzureRmWebAppDeploymen
9380
var output = await webCommonUtility.archiveFolderForDeployment(false, folderPath);
9481
var webPackage = output.webDeployPkg;
9582
tl.debug("Initiated deployment via kudu service for webapp jar package : "+ webPackage);
96-
if (zipDeploy) {
97-
this.zipDeploymentID = await this.kuduServiceUtility.deployUsingZipDeploy(webPackage, this.taskParams.TakeAppOfflineFlag,
98-
{ slotName: this.appService.getSlot() }, true);
99-
}
100-
else {
101-
this.zipDeploymentID = await this.kuduServiceUtility.deployUsingOneDeploy(webPackage, isClean, this.taskParams.TakeAppOfflineFlag,
102-
{ slotName: this.appService.getSlot() }, 'Jar', true);
103-
}
83+
await this.InvokeDeploymentMethod(zipDeploy, webPackage, 'Jar', isClean);
10484

10585
break;
10686

@@ -129,4 +109,15 @@ export class BuiltInLinuxWebAppDeploymentProvider extends AzureRmWebAppDeploymen
129109
}
130110
}
131111
}
112+
113+
private async InvokeDeploymentMethod(zipDeploy: boolean, packagePath: string, packageType: string, isClean: boolean){
114+
if (zipDeploy) {
115+
this.zipDeploymentID = await this.kuduServiceUtility.deployUsingZipDeploy(packagePath, this.taskParams.TakeAppOfflineFlag,
116+
{ slotName: this.appService.getSlot() }, true);
117+
}
118+
else {
119+
this.zipDeploymentID = await this.kuduServiceUtility.deployUsingOneDeploy(packagePath, isClean, this.taskParams.TakeAppOfflineFlag,
120+
{ slotName: this.appService.getSlot() }, packageType, true);
121+
}
122+
}
132123
}

Tasks/AzureRmWebAppDeploymentV5/task.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,7 @@
687687
"JarPathNotPresent": "Java jar path is not present",
688688
"FailedToUpdateApplicationInsightsResource": "Failed to update Application Insights '%s' Resource. Error: %s",
689689
"RunFromZipPreventsFileInUseError": "Move from Web Deploy to RunFrom Package, which helps in avoiding FILE_IN_USE error. Note that Run From Package does not support msBuild package type. Please change your package format to use this deployment method.",
690-
"MSDeployNotSupportTokenAuth": "App Service is configured to not use basic authentication. This requires Web Deploy msdeploy.exe version 7.1.7225 or higher. You need a version of Visual Studio that includes an updated version of msdeploy.exe. For more information, visit https://aka.ms/azdo-webapp-msdeploy ."
690+
"MSDeployNotSupportTokenAuth": "App Service is configured to not use basic authentication. This requires Web Deploy msdeploy.exe version 7.1.7225 or higher. You need a version of Visual Studio that includes an updated version of msdeploy.exe. For more information, visit https://aka.ms/azdo-webapp-msdeploy .",
691+
"RunFromPackageAppsetting": "NOTE: Run From Package makes wwwroot read-only, so you will receive an error when writing files to this directory."
691692
}
692693
}

Tasks/AzureRmWebAppDeploymentV5/task.loc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,7 @@
687687
"JarPathNotPresent": "ms-resource:loc.messages.JarPathNotPresent",
688688
"FailedToUpdateApplicationInsightsResource": "ms-resource:loc.messages.FailedToUpdateApplicationInsightsResource",
689689
"RunFromZipPreventsFileInUseError": "ms-resource:loc.messages.RunFromZipPreventsFileInUseError",
690-
"MSDeployNotSupportTokenAuth": "ms-resource:loc.messages.MSDeployNotSupportTokenAuth"
690+
"MSDeployNotSupportTokenAuth": "ms-resource:loc.messages.MSDeployNotSupportTokenAuth",
691+
"RunFromPackageAppsetting": "ms-resource:loc.messages.RunFromPackageAppsetting"
691692
}
692693
}

_generated/AzureRmWebAppDeploymentV5/Strings/resources.resjson/en-US/resources.resjson

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,5 +233,6 @@
233233
"loc.messages.JarPathNotPresent": "Java jar path is not present",
234234
"loc.messages.FailedToUpdateApplicationInsightsResource": "Failed to update Application Insights '%s' Resource. Error: %s",
235235
"loc.messages.RunFromZipPreventsFileInUseError": "Move from Web Deploy to RunFrom Package, which helps in avoiding FILE_IN_USE error. Note that Run From Package does not support msBuild package type. Please change your package format to use this deployment method.",
236-
"loc.messages.MSDeployNotSupportTokenAuth": "App Service is configured to not use basic authentication. This requires Web Deploy msdeploy.exe version 7.1.7225 or higher. You need a version of Visual Studio that includes an updated version of msdeploy.exe. For more information, visit https://aka.ms/azdo-webapp-msdeploy ."
236+
"loc.messages.MSDeployNotSupportTokenAuth": "App Service is configured to not use basic authentication. This requires Web Deploy msdeploy.exe version 7.1.7225 or higher. You need a version of Visual Studio that includes an updated version of msdeploy.exe. For more information, visit https://aka.ms/azdo-webapp-msdeploy .",
237+
"loc.messages.RunFromPackageAppsetting": "NOTE: Run From Package makes wwwroot read-only, so you will receive an error when writing files to this directory."
237238
}

_generated/AzureRmWebAppDeploymentV5/deploymentProvider/BuiltInLinuxWebAppDeploymentProvider.ts

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -65,25 +65,12 @@ export class BuiltInLinuxWebAppDeploymentProvider extends AzureRmWebAppDeploymen
6565
let tempPackagePath = deployUtility.generateTemporaryFolderOrZipPath(tl.getVariable('AGENT.TEMPDIRECTORY'), false);
6666
let archivedWebPackage = await zipUtility.archiveFolder(this.taskParams.Package.getPath(), "", tempPackagePath);
6767
tl.debug("Compressed folder into zip " + archivedWebPackage);
68-
if (zipDeploy) {
69-
this.zipDeploymentID = await this.kuduServiceUtility.deployUsingZipDeploy(archivedWebPackage, this.taskParams.TakeAppOfflineFlag,
70-
{ slotName: this.appService.getSlot() }, true);
71-
}
72-
else {
73-
this.zipDeploymentID = await this.kuduServiceUtility.deployUsingOneDeploy(archivedWebPackage, isClean, this.taskParams.TakeAppOfflineFlag,
74-
{ slotName: this.appService.getSlot() }, 'Zip', true);
75-
}
68+
await this.InvokeDeploymentMethod(zipDeploy, archivedWebPackage, 'Zip', isClean);
7669

7770
break;
71+
7872
case PackageType.zip:
79-
if (zipDeploy) {
80-
this.zipDeploymentID = await this.kuduServiceUtility.deployUsingZipDeploy(this.taskParams.Package.getPath(), this.taskParams.TakeAppOfflineFlag,
81-
{ slotName: this.appService.getSlot() }, true);
82-
}
83-
else {
84-
this.zipDeploymentID = await this.kuduServiceUtility.deployUsingOneDeploy(this.taskParams.Package.getPath(), isClean, this.taskParams.TakeAppOfflineFlag,
85-
{ slotName: this.appService.getSlot() }, 'Zip', true);
86-
}
73+
await this.InvokeDeploymentMethod(zipDeploy, this.taskParams.Package.getPath(), 'Zip', isClean);
8774

8875
break;
8976

@@ -93,14 +80,7 @@ export class BuiltInLinuxWebAppDeploymentProvider extends AzureRmWebAppDeploymen
9380
var output = await webCommonUtility.archiveFolderForDeployment(false, folderPath);
9481
var webPackage = output.webDeployPkg;
9582
tl.debug("Initiated deployment via kudu service for webapp jar package : "+ webPackage);
96-
if (zipDeploy) {
97-
this.zipDeploymentID = await this.kuduServiceUtility.deployUsingZipDeploy(webPackage, this.taskParams.TakeAppOfflineFlag,
98-
{ slotName: this.appService.getSlot() }, true);
99-
}
100-
else {
101-
this.zipDeploymentID = await this.kuduServiceUtility.deployUsingOneDeploy(webPackage, isClean, this.taskParams.TakeAppOfflineFlag,
102-
{ slotName: this.appService.getSlot() }, 'Jar', true);
103-
}
83+
await this.InvokeDeploymentMethod(zipDeploy, webPackage, 'Jar', isClean);
10484

10585
break;
10686

@@ -129,4 +109,15 @@ export class BuiltInLinuxWebAppDeploymentProvider extends AzureRmWebAppDeploymen
129109
}
130110
}
131111
}
112+
113+
private async InvokeDeploymentMethod(zipDeploy: boolean, packagePath: string, packageType: string, isClean: boolean){
114+
if (zipDeploy) {
115+
this.zipDeploymentID = await this.kuduServiceUtility.deployUsingZipDeploy(packagePath, this.taskParams.TakeAppOfflineFlag,
116+
{ slotName: this.appService.getSlot() }, true);
117+
}
118+
else {
119+
this.zipDeploymentID = await this.kuduServiceUtility.deployUsingOneDeploy(packagePath, isClean, this.taskParams.TakeAppOfflineFlag,
120+
{ slotName: this.appService.getSlot() }, packageType, true);
121+
}
122+
}
132123
}

_generated/AzureRmWebAppDeploymentV5/task.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,8 @@
687687
"JarPathNotPresent": "Java jar path is not present",
688688
"FailedToUpdateApplicationInsightsResource": "Failed to update Application Insights '%s' Resource. Error: %s",
689689
"RunFromZipPreventsFileInUseError": "Move from Web Deploy to RunFrom Package, which helps in avoiding FILE_IN_USE error. Note that Run From Package does not support msBuild package type. Please change your package format to use this deployment method.",
690-
"MSDeployNotSupportTokenAuth": "App Service is configured to not use basic authentication. This requires Web Deploy msdeploy.exe version 7.1.7225 or higher. You need a version of Visual Studio that includes an updated version of msdeploy.exe. For more information, visit https://aka.ms/azdo-webapp-msdeploy ."
690+
"MSDeployNotSupportTokenAuth": "App Service is configured to not use basic authentication. This requires Web Deploy msdeploy.exe version 7.1.7225 or higher. You need a version of Visual Studio that includes an updated version of msdeploy.exe. For more information, visit https://aka.ms/azdo-webapp-msdeploy .",
691+
"RunFromPackageAppsetting": "NOTE: Run From Package makes wwwroot read-only, so you will receive an error when writing files to this directory."
691692
},
692693
"_buildConfigMapping": {
693694
"Default": "5.251.0",

_generated/AzureRmWebAppDeploymentV5/task.loc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,8 @@
687687
"JarPathNotPresent": "ms-resource:loc.messages.JarPathNotPresent",
688688
"FailedToUpdateApplicationInsightsResource": "ms-resource:loc.messages.FailedToUpdateApplicationInsightsResource",
689689
"RunFromZipPreventsFileInUseError": "ms-resource:loc.messages.RunFromZipPreventsFileInUseError",
690-
"MSDeployNotSupportTokenAuth": "ms-resource:loc.messages.MSDeployNotSupportTokenAuth"
690+
"MSDeployNotSupportTokenAuth": "ms-resource:loc.messages.MSDeployNotSupportTokenAuth",
691+
"RunFromPackageAppsetting": "ms-resource:loc.messages.RunFromPackageAppsetting"
691692
},
692693
"_buildConfigMapping": {
693694
"Default": "5.251.0",

_generated/AzureRmWebAppDeploymentV5_Node20/Strings/resources.resjson/en-US/resources.resjson

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,5 +233,6 @@
233233
"loc.messages.JarPathNotPresent": "Java jar path is not present",
234234
"loc.messages.FailedToUpdateApplicationInsightsResource": "Failed to update Application Insights '%s' Resource. Error: %s",
235235
"loc.messages.RunFromZipPreventsFileInUseError": "Move from Web Deploy to RunFrom Package, which helps in avoiding FILE_IN_USE error. Note that Run From Package does not support msBuild package type. Please change your package format to use this deployment method.",
236-
"loc.messages.MSDeployNotSupportTokenAuth": "App Service is configured to not use basic authentication. This requires Web Deploy msdeploy.exe version 7.1.7225 or higher. You need a version of Visual Studio that includes an updated version of msdeploy.exe. For more information, visit https://aka.ms/azdo-webapp-msdeploy ."
236+
"loc.messages.MSDeployNotSupportTokenAuth": "App Service is configured to not use basic authentication. This requires Web Deploy msdeploy.exe version 7.1.7225 or higher. You need a version of Visual Studio that includes an updated version of msdeploy.exe. For more information, visit https://aka.ms/azdo-webapp-msdeploy .",
237+
"loc.messages.RunFromPackageAppsetting": "NOTE: Run From Package makes wwwroot read-only, so you will receive an error when writing files to this directory."
237238
}

_generated/AzureRmWebAppDeploymentV5_Node20/deploymentProvider/BuiltInLinuxWebAppDeploymentProvider.ts

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -65,25 +65,12 @@ export class BuiltInLinuxWebAppDeploymentProvider extends AzureRmWebAppDeploymen
6565
let tempPackagePath = deployUtility.generateTemporaryFolderOrZipPath(tl.getVariable('AGENT.TEMPDIRECTORY'), false);
6666
let archivedWebPackage = await zipUtility.archiveFolder(this.taskParams.Package.getPath(), "", tempPackagePath);
6767
tl.debug("Compressed folder into zip " + archivedWebPackage);
68-
if (zipDeploy) {
69-
this.zipDeploymentID = await this.kuduServiceUtility.deployUsingZipDeploy(archivedWebPackage, this.taskParams.TakeAppOfflineFlag,
70-
{ slotName: this.appService.getSlot() }, true);
71-
}
72-
else {
73-
this.zipDeploymentID = await this.kuduServiceUtility.deployUsingOneDeploy(archivedWebPackage, isClean, this.taskParams.TakeAppOfflineFlag,
74-
{ slotName: this.appService.getSlot() }, 'Zip', true);
75-
}
68+
await this.InvokeDeploymentMethod(zipDeploy, archivedWebPackage, 'Zip', isClean);
7669

7770
break;
71+
7872
case PackageType.zip:
79-
if (zipDeploy) {
80-
this.zipDeploymentID = await this.kuduServiceUtility.deployUsingZipDeploy(this.taskParams.Package.getPath(), this.taskParams.TakeAppOfflineFlag,
81-
{ slotName: this.appService.getSlot() }, true);
82-
}
83-
else {
84-
this.zipDeploymentID = await this.kuduServiceUtility.deployUsingOneDeploy(this.taskParams.Package.getPath(), isClean, this.taskParams.TakeAppOfflineFlag,
85-
{ slotName: this.appService.getSlot() }, 'Zip', true);
86-
}
73+
await this.InvokeDeploymentMethod(zipDeploy, this.taskParams.Package.getPath(), 'Zip', isClean);
8774

8875
break;
8976

@@ -93,14 +80,7 @@ export class BuiltInLinuxWebAppDeploymentProvider extends AzureRmWebAppDeploymen
9380
var output = await webCommonUtility.archiveFolderForDeployment(false, folderPath);
9481
var webPackage = output.webDeployPkg;
9582
tl.debug("Initiated deployment via kudu service for webapp jar package : "+ webPackage);
96-
if (zipDeploy) {
97-
this.zipDeploymentID = await this.kuduServiceUtility.deployUsingZipDeploy(webPackage, this.taskParams.TakeAppOfflineFlag,
98-
{ slotName: this.appService.getSlot() }, true);
99-
}
100-
else {
101-
this.zipDeploymentID = await this.kuduServiceUtility.deployUsingOneDeploy(webPackage, isClean, this.taskParams.TakeAppOfflineFlag,
102-
{ slotName: this.appService.getSlot() }, 'Jar', true);
103-
}
83+
await this.InvokeDeploymentMethod(zipDeploy, webPackage, 'Jar', isClean);
10484

10585
break;
10686

@@ -129,4 +109,15 @@ export class BuiltInLinuxWebAppDeploymentProvider extends AzureRmWebAppDeploymen
129109
}
130110
}
131111
}
112+
113+
private async InvokeDeploymentMethod(zipDeploy: boolean, packagePath: string, packageType: string, isClean: boolean){
114+
if (zipDeploy) {
115+
this.zipDeploymentID = await this.kuduServiceUtility.deployUsingZipDeploy(packagePath, this.taskParams.TakeAppOfflineFlag,
116+
{ slotName: this.appService.getSlot() }, true);
117+
}
118+
else {
119+
this.zipDeploymentID = await this.kuduServiceUtility.deployUsingOneDeploy(packagePath, isClean, this.taskParams.TakeAppOfflineFlag,
120+
{ slotName: this.appService.getSlot() }, packageType, true);
121+
}
122+
}
132123
}

_generated/AzureRmWebAppDeploymentV5_Node20/task.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,8 @@
691691
"JarPathNotPresent": "Java jar path is not present",
692692
"FailedToUpdateApplicationInsightsResource": "Failed to update Application Insights '%s' Resource. Error: %s",
693693
"RunFromZipPreventsFileInUseError": "Move from Web Deploy to RunFrom Package, which helps in avoiding FILE_IN_USE error. Note that Run From Package does not support msBuild package type. Please change your package format to use this deployment method.",
694-
"MSDeployNotSupportTokenAuth": "App Service is configured to not use basic authentication. This requires Web Deploy msdeploy.exe version 7.1.7225 or higher. You need a version of Visual Studio that includes an updated version of msdeploy.exe. For more information, visit https://aka.ms/azdo-webapp-msdeploy ."
694+
"MSDeployNotSupportTokenAuth": "App Service is configured to not use basic authentication. This requires Web Deploy msdeploy.exe version 7.1.7225 or higher. You need a version of Visual Studio that includes an updated version of msdeploy.exe. For more information, visit https://aka.ms/azdo-webapp-msdeploy .",
695+
"RunFromPackageAppsetting": "NOTE: Run From Package makes wwwroot read-only, so you will receive an error when writing files to this directory."
695696
},
696697
"_buildConfigMapping": {
697698
"Default": "5.251.0",

0 commit comments

Comments
 (0)