This task is used to upload the partial or full Web App deployment package on Azure Web App through Kudu Rest API.
The default Azure Web App Deploy task provides the ability to deploy and replace the entire package from the application's directory on the Azure Web App. But in the Micro Frontend architecture applications, different teams/developers might be working on different independent Micro Frontend apps and deploying the entire application requires a complete regression testing cycle.
To avoid this, we need a way to deploy individual applications to App Service so that there is no impact on other applications.
This task allows users to specify one more apps that need to be deployed to the App Services.
This extension also provides the functionality to the backup of the existing wwwroot directory if Azure storage settings are configured.
Note: This extension with set the website application setting variable WEBSITE_RUN_FROM_PACKAGE to 0, so that KUDU can replace the files/folders.
-
Install the task in your AzureDevops account by navigating to the marketplace and click install. Select the AzureDevops account where the task will be deployed to.
-
Add the task to your Build/Release pipeline by clicking in your Build/Release to add a task. Click the Add button on the task.
- Using the task is easy: fill in the following parameters:
Azure subscription - Select the Azure Resource Manager subscription for the deployment. Please see below screenshot for reference.
App Service name - Enter or Select the name of an existing Azure App Service. Please see below screenshot for reference.
Package or Folder - File path to the package or a folder containing app service contents generated by MSBuild or a compressed zip. Please see below screenshot for reference.
Folders to Publish - For partial package deployment, enter the comma-separated list of directories path relative to wwwroot folder of your deployment package. You can also provide the path as '/' if you want to upload and replace the full package. In following example – Two module folders namely Module1 and Module2 inside Modules folder will be replaced in the wwwroot directory folder.
Optionally add the following parameters -
Alternative Kudu URL - value of SCM endpoint if it is not website.scm.azurewebsites.net. (fill in only last part starting with scm)
Slot - value of slot name if deploying an app to a slot.(provide value only if deploying the application to a slot)
RM Storage Account - Specify a pre-existing ARM storage account for uploading the backup of the current wwwroot folder. Note: The selected azure resource manager should have access to this storage resource. Please see below screenshot for reference.
Container Name - Name of the Container for uploading the backup files. Container with the given name must exist in the specified storage account. Note: The selected azure resource manager should have access to this storage resource. Please see below screenshot for reference.
- When you run the pipeline, the selected application folder will be deployed to Azure. If above values are provided – Utility will perform following steps -
A. Take the back up of existing wwwroot directory contents into container BackupContainer in coreappstorage RM storage account
B. Replace the Modules/Module1 and Modules/Module2 folder inside the wwwroot directory with the content present in the a.zip publish artifact file.
https://github.com/emtecinc/AzureDevOps-Partial-AppService-Deployment