Kentico SaaS: First Contact
Tags: kentico, saas, azure, devops
Published: 2023-09-19 10:45:08

In this article, we will take a first look :eyes: into the exciting new world of Kentico SaaS. Kentico SaaS offers customers a worry-free way to host their Xperience by Kentico websites. It provides a cloud environment equipped with all the essential components needed to run your platform smoothly. Furthermore, I will also walk you through setting up a new Xperience by Kentico project from scratch, preparing it for SaaS deployment, integrating it with a CI/CD pipeline via Azure DevOps, and automatically rolling it out to various environments within Kentico SaaS. Finally I will also touch on the topic of Continuous Deployment, a much-anticipated new feature in Xperience by Kentico.

## Exploring hosting options: Engage
In today's world :earth_americas:, customers expect to operate their websites seamlessly, whether it's to meet performance and scalability demands during peak moments or to ensure the security of sensitive data. Meeting these expectations is no longer an option but a fundamental requirement. Fortunately, services like Microsoft's Azure cloud :cloud: address many of these concerns when used as a platform-as-a-service. This is an area where we have been diligently working on and making improvements for years.

There are situations where it can be difficult to keep up with all the technological changes. If your agency lacks the resources to tackle this, such as providing education :mortar_board: for Certified DevOps Engineers, offering independent hosting services can be challenging. Organizations are increasingly looking for SaaS solutions with straightforward service levels.

This is where Kentico SaaS can offer an appealing alternative :muscle:. Kentico SaaS offers secure, scalable, and cost-effective hosting for your platform. This service is specifically designed for Xperience by Kentico, ensuring that only essential components are deployed to run your platform. Furthermore, the platform undergoes continuous improvement, reducing the necessity for ongoing knowledge investments. If a new cloud :alien: technology becomes available, there's a good chance that it will be adopted and made available, ensuring your platform remains up-to-date.

However, it's important to note that there are a few considerations, especially if you're accustomed to taking matters into your own hands and conducting thorough analyses :brain:. In such situations, you may find it necessary to enlist additional support to address any challenges in understanding platform errors, as obtaining comprehensive diagnostic info can be demanding, even though monitoring tools are available. On the other hand, you can also leverage this to your advantage :wink:.

## Creating Kentico SaaS projects: Make it so
Getting your application ready for Kentico SaaS was easier than I had anticipated. By running a few commands, you can make your Xperience by Kentico SaaS-ready :100:. 

> _Add the **--cloud** parameter when creating your Xperience by Kentico project. This parameter installs a boilerplate project suitable for SaaS deployments._

The next steps involve building and configuring your application, and then preparing it for deployment. Kentico offers a PowerShell script for [generating the Kentico SaaS deployment package](https://docs.xperience.io/xp/developers-and-admins/deployment/deploy-to-the-saas-environment#DeploytotheSaaSenvironment-DeploytotheSaaSenvironmentdeploy). This package can be uploaded via the Xperience Portal, and then rolled out to different environments. This process can also be automated, as we'll discuss shortly.

![Xperience Portal](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lpaxy8uu1bmavujlr10v.png)

Of course, the prerequisite is to [subscribe to Kentico SaaS](https://www.kentico.com/platforms/xperience-by-kentico/xap). There are several editions with various functionalities and features to consider. In this example, I'll be using the medium tier, which provides QA, UAT, and PROD environments, as I prefer a robust DTAP approach.

## Streamlined Deployment: The Final Frontier
Release pipelines have become essential building blocks for DevOps engineers. We typically use pipelines for two purposes: 

1. Compiling and automatically testing the application with each commit. 
2. Automatically building and deploying release-ready code.

Kentico has thoughtfully integrated these aspects into the Kentico SaaS service, offering APIs to deliver deployment packages, making it remarkably straightforward to seamlessly integrate into your own release pipeline.

> _Send the package via a POST request to the deployment API endpoint: https://xperience-portal.com/api/deployment/upload/PROJECT_GUID._

Once a deployment package is received, Kentico immediately starts deploying :rocket: it to the target environment. This process takes a few minutes, and the environment is updated. Error handling is also built in, should the package encounter deployment issues.

![Ongoing deployment](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/urh7i3lxao3mm4a4w7tn.png)

Once tests are successful and you have the green light :white_check_mark: for the release, you can proceed to the next environment via the Xperience Portal. The portal provides all the necessary information to manage this process effectively, including an audit trail to ensure only authorized personnel can push releases.

## The past is written, but the future is left for us to write
Xperience by Kentico introduces a new feature called [Continuous Deployment](https://docs.xperience.io/xp/developers-and-admins/ci-cd/continuous-deployment). The purpose of Continuous Deployment is to facilitate incremental deployments. It shares similarities with Kentico's Continuous Integration but has some significant distinctions. The Continuous Integration feature serializes content and objects into XML files to maintain synchronization :arrows_counterclockwise: across developer environments. While this approach is effective for version control, it was not suitable for deploying to other environments. Typically, additional tools like the [BizStream Toolkit](https://www.toolkitforkentico.com/), Content Staging, or custom deployment tools were used :wink:.

The workflow for Continuous Deployment is as follows: First, you need to generate the Continuous Deployment configuration file. The configuration file enables you to specify the restore mode (Create/CreateUpdate/Full) for each object, which determines the operations required in the target database during repository restoration. The next step is to generate the Continuous Deployment files. This can be achieved by using the following command: 

> _dotnet run --no-build -- --kxp-cd-store_

When a release is submitted to the Xperience Portal, the Continuous Deployment files will be processed automatically. Once the release is completed, you will notice that the changes are available. This automation is an additional advantage when you use Kentico SaaS :heart_eyes:.

## To Boldly Go :sparkles:
So far, you've been able to read about my initial experiences with Kentico SaaS. I've demonstrated how simple it is to make a project SaaS-ready. I've also covered the generation of a deployment package and how to submit it to the Xperience Portal. What has pleasantly surprised :gift: me, in particular, is the straightforwardness of the deployment process. You can see that Kentico has put considerable thought into keeping this process as simple as possible. Additionally, I find the new Continuous Deployment feature personally very appealing. It will be very interesting to see how it performs in upcoming Xperience by Kentico projects. To be continued!