umbraco azure devops ci cd on premises

03 Mar, 2023 19:04

Share this news:

Deploying Umbraco 10 with CI/CD Using Azure DevOps Release Pipeline

We recently had the opportunity to work with a large national client in the public sector. This client had an on-premises infrastructure and required a solution for deploying Umbraco 10 with continuous integration and continuous deployment (CI/CD). Due to various reasons, we could not use cloud-based services, so we decided to use Azure DevOps Server, an on-premises version of Azure DevOps, to set up the CI/CD pipeline.

The Challenge

Deploying Umbraco 10 in a very restricted environment where every detail is essential and could be a significant security concern is not a straightforward task. It requires several steps, including copying files from a build directory to the website root folder, creating an app_offline file, deleting unnecessary files and folders, and granting permissions to the IIS_IUSRS and IIS APPPOOL accounts.  

The Solution

To simplify the deployment process, we created a PowerShell script that automates all of the necessary steps. The script uses the following parameters:

  • $source: the source folder that contains the build files
  • $ApplicationPath: the destination folder for the Umbraco application
  • $ApplicationPoolName: the name of the IIS application pool
  • $FoldersToExclude: an array of folders to exclude from the deployment process

The script contains several functions, including:

  • Invoke-WithRetry: a function that invokes a command with retry logic
  • Copy-WebsiteFiles: a function that copies files from the build directory to the website root folder
  • Create-AppOfflineFile: a function that creates an app_offline file to take the site offline during maintenance
  • Grant-FileAccess: a function that grants permissions to a folder or file
  • Grant-FolderAccess: a function that grants permissions to a folder and its contents
  • Delete-FilesAndFolders: a function that deletes unnecessary files and folders
  • Delete-TempFolders: a function that deletes the Umbraco temp folders
  • Delete-UmbracoFolder: a function that deletes the Umbraco folder and its contents
  • Delete-AppOfflineFile: a function that deletes the app_offline file to bring the site back online

We tested the PowerShell script thoroughly and were able to successfully deploy Umbraco 10 with it.

The Benefits

By automating the deployment process, we were able to save time and reduce the risk of errors. The PowerShell script can be easily integrated into an Azure DevOps Release Pipeline, providing a seamless CI/CD experience.

Would you like to get the automation script? 

We're excited to share our PowerShell script with the community. If you're interested in deploying Umbraco 10 with CI/CD using Azure DevOps Release Pipeline, please visit our contact page to download the script and learn more about how we can help you achieve your goals.

In conclusion, we hope this blog post has provided valuable insights into deploying Umbraco 10 with CI/CD using Azure DevOps Release Pipeline. We're always looking for ways to improve our processes and provide the best possible solutions to our clients. If you have any questions or feedback, please don't hesitate to contact us.

comments powered by Disqus