2

I am using Azure PaaS as an environment of Sitecore 9.2.0 (XP + XC) with one custom solution. Can anyone please tell me how to deploy that custom solution into Azure Paas, as there are 17 web apps. Which DLLs should be placed in which web app? Or all the custom DLLs should be placed in CD only?

Thanks in advance.

2
  • Can you please briefly describe what these 17 web apps are? Are you talking about App Services? Commented Nov 28, 2019 at 13:17
  • @Marcel these are different web apps created for sitecore(cd, cm, si, ma, ops, shops, etc. ). If you have ever created sitecore in Azure PaaS, you will get those 17 web apps for xc.
    – Arkadeep
    Commented Nov 29, 2019 at 13:36

2 Answers 2

4

The answer to this question depends on a few things, such as if you have customizations to experience editor and/or content editor or any custom jobs etc that need to run on the CA servers. It also depends on what approach and tools you are using for deployment.

However, I'll try and cover some options and typical approaches.

Custom Code Deployment Options

There are two options here really:

1) Direct deployment from Visual Studio (Web Deploy publish / FTP)

2) Deployment from a Continuous Integration platform (Web Deploy Package via MsDeploy, Sitecore Azure Toolkit or Azure DevOps)

1 is only really used for local deployments so I'm only going to talk about 2.

Azure DevOps / VSTS

Azure DevOps comes with built-in support for WebDeploy packages. There is an Azure App Service Deploy task which you can use. You first need to set up DevOps to build the project and create the artifacts to deploy. This is probably the easiest most integrated approach.

https://mrunaldaftari.wordpress.com/2019/07/05/setting-up-continuous-integration-in-azure-with-sitecore/ https://mrunaldaftari.wordpress.com/2019/07/05/setting-up-continuous-deployment-in-azure-with-sitecore/

Ms Deploy

You can create Web Deploy Packages with MS deploy and publish to Azure Paas. You can create PowerShell script which your CI tool can run to automate this:

https://blog.baslijten.com/zero-downtime-deployments-with-sitecore-on-azure/

https://docs.microsoft.com/en-us/aspnet/web-forms/overview/deployment/web-deployment-in-the-enterprise/deploying-web-packages

Sitecore Azure Toolkit

The Sitecore Azure Toolkit contains a bunch of tools and resources to assist with deploying Sitecore solutions to the Microsoft Azure App Services. So you could use these instead. Again the scripts could be run from your chosen CI tool. If you are not using Azure DevOps then this probably the best approach to take.

https://doc.sitecore.com/developers/sat/21/sitecore-azure-toolkit/en/getting-started-with-the-sitecore-azure-toolkit.html

https://www.koenheye.be/getting-started-with-powershell-sitecore-azure-toolkit/

https://blog.baslijten.com/sitecore-on-azure-create-custom-web-deploy-packages-using-the-sitecore-azure-toolkit/ https://www.koenheye.be/getting-started-with-powershell-sitecore-azure-toolkit/

Further reading:

This is a great series: http://onelittlespark.bartverdonck.be/sitecore-9-in-azure-paas-for-dummies-3/

Another great series by Pete: https://sitecorehacker.com/2018/01/18/sitecore-9-0-1-on-azure-paas-deployment-guide/

Lots of useful posts by Bas: https://blog.baslijten.com/category/azure/

0

A portion of your question appears to be implicitly asking how to build and package up your solution such that it can be deployed to your Azure App Services.

There are many methods of preparing your artifacts, however a typical approach is to produce one or more deploy artifacts (.zip files) with transformed configs specific to each App Service assigned with a specific role; namely: Standalone, Content Management, or Content Delivery.

Binaries are deployed on all CM and CD environments. Binaries (DLLs) are not "activated" until they are referenced by a config with a matching role definition, so I can't think of any reason not to deploy the same set across all CM and CD App Services. It will simplify your build / deploy process.

Assuming you have met those artifact prerequisites, there are various methods of getting your custom code onto your App Services; each of which may affect how you produce your deploy artifact(s) as well:

Octopus Deploy

Modern versions of Octopus support direct deploys to Azure App Services with some great configuration options. It can be a bit tricky to set up, but the key is to follow the documentation to a tee.

More reading:

https://octopus.com/docs/deployment-examples/azure-deployments

Kudu Deploy

Technically the Kudu API is part of the Azure Toolkit, but it's worth mentioning specifically as it's a simple and reliable method of deployment.

Kudu has great tooling interfaces and deploys can be triggered via PowerShell scripts with minimal setup on the Azure Portal side.

Here's a sample PowerShell script for deploying to an App Service:

$username = "`$dev-website-sc902-cm"

$password = "tw13qaolWlvihw9fSBxSzhhxcZsNNtz4Gfrxcn3QYCvxSWu80mfaqhDfT9if"

$apiUrl = "https://dev-website-sc902-cm.scm.azurewebsites.net/api/zipdeploy/"

$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $username, $password)))

$filePath = "$(System.DefaultWorkingDirectory)\$(SourceAlias)/sitecore_artifacts/website-dev-cm.0.0.1.zip"

Invoke-RestMethod -Uri $apiUrl -Headers @{Authorization=("Basic {0}" -f $base64AuthInfo)} -Method POST -InFile $filePath -ContentType "multipart/form-data"

Gotcha about DLL and config deployments

One key concept to remember about binaries is that they are paired with configs. Put some thought into how your deployment process handles file deletion (if at all).

For example, let's say you remove a binary and associated config in source control and you deploy. Does your deploy process delete those files? Should it?

In my experience, manual file deletions relating to binaries and configs can be quite tedious, particularly if you're deploying to many App Services.

Octopus has an option for automating file deletions. On the Kudu side, my current understanding is that it always auto deletes files.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.