Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Users/snesterov/afa with wif #18066

Merged
merged 39 commits into from
Apr 25, 2023
Merged
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
455ef64
Migrated AzureFunctionAppV1 and V2 to arm-rest-v2 package
starkmsu Apr 4, 2023
b28a3c2
Updated tasks versions
starkmsu Apr 4, 2023
5c49a24
Fixed import statement
starkmsu Apr 4, 2023
85535ea
Migrated AzureFunctionAppV1 and V2 to arm-rest-v2 package
starkmsu Apr 4, 2023
db2dffa
Updated tasks versions
starkmsu Apr 4, 2023
dc547dd
Fixed import statement
starkmsu Apr 4, 2023
e0c50a8
Merge branch 'users/snesterov/afa-with-wif' of https://github.com/mic…
starkmsu Apr 5, 2023
22906ff
Removed elftovers for azurermdeploycommon package usage and updated v…
starkmsu Apr 5, 2023
5fbbd77
Merge branch 'master' into users/snesterov/afa-with-wif
starkmsu Apr 5, 2023
a6897c1
Added azure-pipelines-task-lib removal from 2nd level dependency node…
starkmsu Apr 5, 2023
60d2be4
Merge branch 'master' into users/snesterov/afa-with-wif
starkmsu Apr 5, 2023
8954eca
Merge branch 'master' into users/snesterov/afa-with-wif
starkmsu Apr 6, 2023
d5286ef
Merge branch 'master' into users/snesterov/afa-with-wif
starkmsu Apr 12, 2023
0b201ea
Updated arm-rest-v2 dependency
starkmsu Apr 12, 2023
78753f7
Fixed copy-paste bug
starkmsu Apr 12, 2023
0652616
Merge branch 'master' into users/snesterov/afa-with-wif
onetocny Apr 14, 2023
dd31978
Bum up to 100
onetocny Apr 14, 2023
f88810c
Migrated AzureFunctionAppV1 and V2 to arm-rest-v2 package
starkmsu Apr 4, 2023
8979252
Updated tasks versions
starkmsu Apr 4, 2023
d6a5103
Fixed import statement
starkmsu Apr 4, 2023
9d5c432
Migrated AzureFunctionAppV1 and V2 to arm-rest-v2 package
starkmsu Apr 4, 2023
cfa94d9
Removed elftovers for azurermdeploycommon package usage and updated v…
starkmsu Apr 5, 2023
2db7d84
Added azure-pipelines-task-lib removal from 2nd level dependency node…
starkmsu Apr 5, 2023
2f98323
Updated arm-rest-v2 dependency
starkmsu Apr 12, 2023
1ad44f8
Fixed copy-paste bug
starkmsu Apr 12, 2023
15fb3b4
Bum up to 100
onetocny Apr 14, 2023
188eb53
Merge branch 'users/snesterov/afa-with-wif' of https://github.com/mic…
onetocny Apr 24, 2023
e019c81
Merge branch 'master' into users/snesterov/afa-with-wif
onetocny Apr 24, 2023
70bba10
Update lock files and patch version
onetocny Apr 24, 2023
9860401
Merge branch 'master' into users/snesterov/afa-with-wif
onetocny Apr 24, 2023
768018d
Merge branch 'master' of https://github.com/microsoft/azure-pipelines…
onetocny Apr 24, 2023
4a5a027
Merge branch 'users/snesterov/afa-with-wif' of https://github.com/mic…
onetocny Apr 24, 2023
886f23f
Update arm rest
onetocny Apr 24, 2023
3231ab7
Merge branch 'master' into users/snesterov/afa-with-wif
onetocny Apr 24, 2023
74d8b27
Update azure-pipelines-task-lib
onetocny Apr 24, 2023
ccad515
Merge branch 'master' into users/snesterov/afa-with-wif
onetocny Apr 24, 2023
7adf6b0
Merge branch 'master' into users/snesterov/afa-with-wif
onetocny Apr 24, 2023
bcbe9d5
Merge branch 'master' into users/snesterov/afa-with-wif
onetocny Apr 24, 2023
32179c5
Merge branch 'master' into users/snesterov/afa-with-wif
onetocny Apr 25, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

824 changes: 0 additions & 824 deletions Tasks/AzureFunctionAppV1/azure-arm-rest/azure-arm-app-service.ts

This file was deleted.

4 changes: 2 additions & 2 deletions Tasks/AzureFunctionAppV1/azurermwebappdeployment.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import tl = require('azure-pipelines-task-lib/task');
import path = require('path');
import * as Endpoint from 'azure-pipelines-tasks-azure-arm-rest-v2/azure-arm-endpoint';
import { TaskParameters, TaskParametersUtility } from './taskparameters';
import { DeploymentFactory } from './deploymentProvider/DeploymentFactory';
import * as Endpoint from 'azure-pipelines-tasks-azurermdeploycommon/azure-arm-rest/azure-arm-endpoint';

async function main() {
let isDeploymentSuccess: boolean = true;

try {
tl.setResourcePath(path.join( __dirname, 'task.json'));
tl.setResourcePath(path.join( __dirname, 'node_modules/azure-pipelines-tasks-azurermdeploycommon/module.json'));
tl.setResourcePath(path.join( __dirname, 'node_modules/azure-pipelines-tasks-azure-arm-rest-v2/module.json'));
var taskParams: TaskParameters = await TaskParametersUtility.getParameters();
var deploymentFactory: DeploymentFactory = new DeploymentFactory(taskParams);
var deploymentProvider = await deploymentFactory.GetDeploymentProvider();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
import { IWebAppDeploymentProvider } from './IWebAppDeploymentProvider';
import tl = require('azure-pipelines-task-lib/task');
import { AzureAppService } from 'azure-pipelines-tasks-azure-arm-rest-v2/azure-arm-app-service';
import { Kudu } from 'azure-pipelines-tasks-azure-arm-rest-v2/azure-arm-app-service-kudu';
import { AzureDeployPackageArtifactAlias } from 'azure-pipelines-tasks-azure-arm-rest-v2/constants';
import { AzureAppServiceUtility } from 'azure-pipelines-tasks-azure-arm-rest-v2/azureAppServiceUtility';
import { PackageUtility } from 'azure-pipelines-tasks-webdeployment-common/packageUtility';
import * as ParameterParser from 'azure-pipelines-tasks-webdeployment-common/ParameterParserUtility'
import { TaskParameters } from '../taskparameters';
import { AzureAppServiceUtilityExt } from '../operations/AzureAppServiceUtilityExt';
import { KuduServiceUtility } from '../operations/KuduServiceUtility';
import { AzureAppService } from '../azure-arm-rest/azure-arm-app-service';
import { Kudu } from '../azure-arm-rest/azure-arm-app-service-kudu';
import { AzureAppServiceUtility } from '../operations/AzureAppServiceUtility';
import tl = require('azure-pipelines-task-lib/task');
import * as ParameterParser from 'azure-pipelines-tasks-azurermdeploycommon/operations/ParameterParserUtility'
import { addReleaseAnnotation } from '../operations/ReleaseAnnotationUtility';
import { PackageUtility } from 'azure-pipelines-tasks-azurermdeploycommon/webdeployment-common/packageUtility';
import { AzureDeployPackageArtifactAlias } from 'azure-pipelines-tasks-azurermdeploycommon/Constants';
import { IWebAppDeploymentProvider } from './IWebAppDeploymentProvider';

export class AzureRmWebAppDeploymentProvider implements IWebAppDeploymentProvider {
protected taskParams:TaskParameters;
protected appService: AzureAppService;
protected kuduService: Kudu;
protected appServiceUtility: AzureAppServiceUtility;
protected appServiceUtilityExt: AzureAppServiceUtilityExt;
protected kuduServiceUtility: KuduServiceUtility;
protected virtualApplicationPath: string = "";
protected activeDeploymentID;
Expand All @@ -26,14 +28,15 @@ export class AzureRmWebAppDeploymentProvider implements IWebAppDeploymentProvide
}

public async PreDeploymentStep() {
this.appService = new AzureAppService(this.taskParams.azureEndpoint, this.taskParams.ResourceGroupName, this.taskParams.WebAppName,
this.appService = new AzureAppService(this.taskParams.azureEndpoint, this.taskParams.ResourceGroupName, this.taskParams.WebAppName,
this.taskParams.SlotName, this.taskParams.WebAppKind);
this.appServiceUtility = new AzureAppServiceUtility(this.appService);
this.appServiceUtilityExt = new AzureAppServiceUtilityExt(this.appService);

this.kuduService = await this.appServiceUtility.getKuduService();
this.kuduServiceUtility = new KuduServiceUtility(this.kuduService);

await this.appServiceUtility.getFuntionAppNetworkingCheck(this.taskParams.isLinuxApp);
await this.appServiceUtilityExt.getFuntionAppNetworkingCheck(this.taskParams.isLinuxApp);
}

public async DeployWebAppStep() {}
Expand All @@ -58,9 +61,9 @@ export class AzureRmWebAppDeploymentProvider implements IWebAppDeploymentProvide

if(this.taskParams.ConfigurationSettings) {
var customApplicationSettings = ParameterParser.parse(this.taskParams.ConfigurationSettings);
await this.appServiceUtility.updateConfigurationSettings(customApplicationSettings);
await this.appService.updateConfigurationSettings(customApplicationSettings);
}

await this.appServiceUtility.updateScmTypeAndConfigurationDetails();
await this.appServiceUtilityExt.updateScmTypeAndConfigurationDetails();
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { AzureRmWebAppDeploymentProvider } from './AzureRmWebAppDeploymentProvider';
import tl = require('azure-pipelines-task-lib/task');
import { PackageType } from 'azure-pipelines-tasks-azurermdeploycommon/webdeployment-common/packageUtility';
import path = require('path');
import * as ParameterParser from 'azure-pipelines-tasks-azurermdeploycommon/operations/ParameterParserUtility'

var webCommonUtility = require('azure-pipelines-tasks-azurermdeploycommon/webdeployment-common/utility.js');
var zipUtility = require('azure-pipelines-tasks-azurermdeploycommon/webdeployment-common/ziputility.js');
var webCommonUtility = require('azure-pipelines-tasks-webdeployment-common/utility');
var zipUtility = require('azure-pipelines-tasks-webdeployment-common/ziputility');
import { PackageType } from 'azure-pipelines-tasks-webdeployment-common/packageUtility';
import * as ParameterParser from 'azure-pipelines-tasks-webdeployment-common/ParameterParserUtility'
import { AzureRmWebAppDeploymentProvider } from './AzureRmWebAppDeploymentProvider';

const linuxFunctionStorageSetting: string = '-WEBSITES_ENABLE_APP_SERVICE_STORAGE true';
const linuxFunctionRuntimeSettingName: string = '-FUNCTIONS_WORKER_RUNTIME ';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import { AzureRmWebAppDeploymentProvider } from './AzureRmWebAppDeploymentProvider';
import tl = require('azure-pipelines-task-lib/task');
import { AzureAppService } from '../azure-arm-rest/azure-arm-app-service';
import { AzureAppServiceUtility } from '../operations/AzureAppServiceUtility';
import { PackageType } from 'azure-pipelines-tasks-azurermdeploycommon/webdeployment-common/packageUtility';
import { sleepFor } from 'azure-pipelines-tasks-azurermdeploycommon/azure-arm-rest/webClient';
import Q = require('q');
var webCommonUtility = require('azure-pipelines-tasks-azurermdeploycommon/webdeployment-common/utility.js');
var zipUtility = require('azure-pipelines-tasks-azurermdeploycommon/webdeployment-common/ziputility.js');
var webCommonUtility = require('azure-pipelines-tasks-webdeployment-common/utility');
var zipUtility = require('azure-pipelines-tasks-webdeployment-common/ziputility');
var azureStorage = require('azure-storage');
import * as ParameterParser from 'azure-pipelines-tasks-azurermdeploycommon/operations/ParameterParserUtility';
import { AzureAppService } from 'azure-pipelines-tasks-azure-arm-rest-v2/azure-arm-app-service';
import { sleepFor } from 'azure-pipelines-tasks-azure-arm-rest-v2/webClient';
import { PackageType } from 'azure-pipelines-tasks-webdeployment-common/packageUtility';
import * as ParameterParser from 'azure-pipelines-tasks-webdeployment-common/ParameterParserUtility';
import { AzureAppServiceUtilityExt } from '../operations/AzureAppServiceUtilityExt';
import { AzureRmWebAppDeploymentProvider } from './AzureRmWebAppDeploymentProvider';

export class ConsumptionWebAppDeploymentProvider extends AzureRmWebAppDeploymentProvider {

public async PreDeploymentStep() {
this.appService = new AzureAppService(this.taskParams.azureEndpoint, this.taskParams.ResourceGroupName, this.taskParams.WebAppName,
this.appService = new AzureAppService(this.taskParams.azureEndpoint, this.taskParams.ResourceGroupName, this.taskParams.WebAppName,
this.taskParams.SlotName, this.taskParams.WebAppKind, true);
this.appServiceUtility = new AzureAppServiceUtility(this.appService);
this.appServiceUtilityExt = new AzureAppServiceUtilityExt(this.appService);
}

public async DeployWebAppStep() {
let storageDetails = await this.findStorageAccount();
let sasUrl = await this.uploadPackage(storageDetails, this.taskParams.Package);
Expand Down Expand Up @@ -128,10 +128,10 @@ export class ConsumptionWebAppDeploymentProvider extends AzureRmWebAppDeployment
protected async PostDeploymentStep() {
if(this.taskParams.ConfigurationSettings) {
var customApplicationSettings = ParameterParser.parse(this.taskParams.ConfigurationSettings);
await this.appServiceUtility.updateConfigurationSettings(customApplicationSettings);
await this.appService.updateConfigurationSettings(customApplicationSettings);
}

await this.appServiceUtility.updateScmTypeAndConfigurationDetails();
await this.appServiceUtilityExt.updateScmTypeAndConfigurationDetails();
}

private _getUserDefinedAppSettings() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import tl = require('azure-pipelines-task-lib/task');
import { PackageType } from 'azure-pipelines-tasks-webdeployment-common/packageUtility';
import { TaskParameters, DeploymentType } from '../taskparameters';
import { BuiltInLinuxWebAppDeploymentProvider } from './BuiltInLinuxWebAppDeploymentProvider';
import { ConsumptionWebAppDeploymentProvider } from './ConsumptionWebAppDeploymentProvider';
import { IWebAppDeploymentProvider } from './IWebAppDeploymentProvider';
import { WindowsWebAppZipDeployProvider } from './WindowsWebAppZipDeployProvider';
import { WindowsWebAppRunFromZipProvider } from './WindowsWebAppRunFromZipProvider';
import { ConsumptionWebAppDeploymentProvider } from './ConsumptionWebAppDeploymentProvider';
import tl = require('azure-pipelines-task-lib/task');
import { PackageType } from 'azure-pipelines-tasks-azurermdeploycommon/webdeployment-common/packageUtility';
import { WindowsWebAppWarDeployProvider } from './WindowsWebAppWarDeployProvider';

export class DeploymentFactory {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import { AzureRmWebAppDeploymentProvider } from './AzureRmWebAppDeploymentProvider';
import tl = require('azure-pipelines-task-lib/task');
import * as ParameterParser from 'azure-pipelines-tasks-azurermdeploycommon/operations/ParameterParserUtility'
var deployUtility = require('azure-pipelines-tasks-webdeployment-common/utility');
var zipUtility = require('azure-pipelines-tasks-webdeployment-common/ziputility');
import { PackageType } from 'azure-pipelines-tasks-webdeployment-common/packageUtility';
import * as ParameterParser from 'azure-pipelines-tasks-webdeployment-common/ParameterParserUtility'
import { DeploymentType } from '../taskparameters';
import { PackageType } from 'azure-pipelines-tasks-azurermdeploycommon/webdeployment-common/packageUtility';
import { FileTransformsUtility } from '../operations/FileTransformsUtility';
import { addReleaseAnnotation } from '../operations/ReleaseAnnotationUtility';
import { FileTransformsUtility } from 'azure-pipelines-tasks-azurermdeploycommon/operations/FileTransformsUtility.js';
import { AzureRmWebAppDeploymentProvider } from './AzureRmWebAppDeploymentProvider';

const oldRunFromZipAppSetting: string = '-WEBSITE_RUN_FROM_ZIP';
const runFromZipAppSetting: string = '-WEBSITE_RUN_FROM_PACKAGE 1';
var deployUtility = require('azure-pipelines-tasks-azurermdeploycommon/webdeployment-common/utility.js');
var zipUtility = require('azure-pipelines-tasks-azurermdeploycommon/webdeployment-common/ziputility.js');

export class WindowsWebAppRunFromZipProvider extends AzureRmWebAppDeploymentProvider {

public async DeployWebAppStep() {
let deploymentMethodtelemetry = '{"deploymentMethod":"Run from Package"}';
console.log("##vso[telemetry.publish area=TaskDeploymentMethod;feature=AzureWebAppDeployment]" + deploymentMethodtelemetry);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
import { AzureRmWebAppDeploymentProvider } from './AzureRmWebAppDeploymentProvider';
import tl = require('azure-pipelines-task-lib/task');
var webCommonUtility = require('azure-pipelines-tasks-azurermdeploycommon/webdeployment-common/utility.js');

var webCommonUtility = require('azure-pipelines-tasks-webdeployment-common/utility');
import { AzureRmWebAppDeploymentProvider } from './AzureRmWebAppDeploymentProvider';

export class WindowsWebAppWarDeployProvider extends AzureRmWebAppDeploymentProvider {

private zipDeploymentID: string;

public async DeployWebAppStep() {

tl.debug("Initiated deployment via kudu service for webapp war package : "+ this.taskParams.Package.getPath());

let deploymentMethodtelemetry = '{"deploymentMethod":"War Deploy"}';
console.log("##vso[telemetry.publish area=TaskDeploymentMethod;feature=AzureWebAppDeployment]" + deploymentMethodtelemetry);

await this.kuduServiceUtility.warmpUp();

var warName = webCommonUtility.getFileNameFromPath(this.taskParams.Package.getPath(), ".war");

this.zipDeploymentID = await this.kuduServiceUtility.deployUsingWarDeploy(this.taskParams.Package.getPath(),
this.zipDeploymentID = await this.kuduServiceUtility.deployUsingWarDeploy(this.taskParams.Package.getPath(),
{ slotName: this.appService.getSlot() }, warName);

await this.PostDeploymentStep();
}

public async UpdateDeploymentStatus(isDeploymentSuccess: boolean) {
if(this.kuduServiceUtility) {
await super.UpdateDeploymentStatus(isDeploymentSuccess);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
import { AzureRmWebAppDeploymentProvider } from './AzureRmWebAppDeploymentProvider';
import tl = require('azure-pipelines-task-lib/task');
import * as ParameterParser from 'azure-pipelines-tasks-azurermdeploycommon/operations/ParameterParserUtility'
var deployUtility = require('azure-pipelines-tasks-webdeployment-common/utility');
var zipUtility = require('azure-pipelines-tasks-webdeployment-common/ziputility');
import { PackageType } from 'azure-pipelines-tasks-webdeployment-common/packageUtility';
import * as ParameterParser from 'azure-pipelines-tasks-webdeployment-common/ParameterParserUtility'
import { DeploymentType } from '../taskparameters';
import { PackageType } from 'azure-pipelines-tasks-azurermdeploycommon/webdeployment-common/packageUtility';
import { FileTransformsUtility } from 'azure-pipelines-tasks-azurermdeploycommon/operations/FileTransformsUtility.js';
import { FileTransformsUtility } from '../operations/FileTransformsUtility';
import { AzureRmWebAppDeploymentProvider } from './AzureRmWebAppDeploymentProvider';

const removeRunFromZipAppSetting: string = '-WEBSITE_RUN_FROM_ZIP -WEBSITE_RUN_FROM_PACKAGE';
var deployUtility = require('azure-pipelines-tasks-azurermdeploycommon/webdeployment-common/utility.js');
var zipUtility = require('azure-pipelines-tasks-azurermdeploycommon/webdeployment-common/ziputility.js');

export class WindowsWebAppZipDeployProvider extends AzureRmWebAppDeploymentProvider {

private zipDeploymentID: string;

public async DeployWebAppStep() {
let deploymentMethodtelemetry = '{"deploymentMethod":"Zip Deploy"}';
console.log("##vso[telemetry.publish area=TaskDeploymentMethod;feature=AzureWebAppDeployment]" + deploymentMethodtelemetry);

var webPackage = await FileTransformsUtility.applyTransformations(this.taskParams.Package.getPath(), this.taskParams.WebConfigParameters, this.taskParams.Package.getPackageType());

if(this.taskParams.DeploymentType === DeploymentType.zipDeploy) {
Expand Down
8 changes: 8 additions & 0 deletions Tasks/AzureFunctionAppV1/make.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
{
"rm": [
{
"items": [
"node_modules/azure-pipelines-tasks-azure-arm-rest-v2/node_modules/azure-pipelines-task-lib"
],
"options": "-Rf"
}
],
"externals": {
"archivePackages": [
{
Expand Down
Loading