3

I'm a newbie on Sitecore.

I'm studying the "Get Started" tutorial from Sitecore e-learning website.

I have configured Sitecore 9 on Azure, from Azure marketplace, using extra-small sizing having 2 app service instance, 1 for the content delivery server and 1 for the content management server.

Creating a new layout item, Sitecore generates a file .cshtml on filesystem. The file is create on content management server but not on the content delivery server and the result is that when I try opening a web page I get a error page saying The layout for the requested document was not found.

My question is, what can I do to sync the two app or, there is another way (best practice) to create a layout and deploying over the cloud?

Thanks.

3 Answers 3

5

Welcome to Sitecore!

There are two important concepts:

  1. Publishing
  2. Deployment

Publishing always refer to Sitecore Items. This will PUBLISH items from your master DB to your web DB (standard config).

Deployment is the deployment of your file system. On Visual Studio when you publish a project you are actually performing what is called "deployment" on Sitecore world.

Now that you understand these two concepts you will realize the situation:

  • your CM uses your MASTER DB
  • your CD uses your WEB DB
  • Both CM and CD need to have the same file system(apart from SOME config files that will have specific configuration for each environment, ok?)

Performing a publish then you can transfer Sitecore items from master DB to web DB.

Now, you need to keep your file system in sync between your CM and CD.

To do this you need to perform a "deployment" and since you have not done this yet this is the reason you don`t see .cshtml files on your CD.

There are different strategies to keep these environments in sync.

Since you are using Azure, then you could use "continuous deployment to the Microsoft Azure App service". You could set a continuous deployment on your Visual Studio.

Please refer to this page: Deploying your Sitecore customizations with Microsoft Azure .

I believe this is a good starting point to clarify the solution being suggested.

Good luck and if you have any trouble please raise your hands and we will be here to help!

1

In ideal case you are creating Sitecore items and cshtml / js / css or any other files on your local machine.

You are then distributing those artifacts during deployment to CM or CD servers.

Sitecore items deployment:

You don't need to distribute package with Sitecore items to CD servers as they will be transferred there during publishing process.

You can use automated or manual deployment here.

Manual deployment consists of creating Sitecore package of your local Sitecore items and deploying them to CM server. Take a look here how to do it or also in this great article.

Use Package designer (Can be found in Sitecore Desktop under Development Tools) tool to create package on your local development environment:

enter image description here

Use Installation Wizard (Can be found in Sitecore Desktop under Development Tools) to install package on your CM server.

For automated deployment you should use Unicorn or TDS to serialize items that you create locally like layout from your question and then deserialize them during deployment using Sitecore Ship, Octopus Deploy or other choices.

As you are newbie I would suggest starting with manual deployment for now.

Other artifacts like cshtml, js, css, ... files deployment:

You can embed these files with similar approach to manual deployment of Sitecore items but instead of "Items statically" button, you will click on "Files statically" button in Package Designer.

enter image description here

Another approach would be using built in WebDeploy functionality in Visual Studio.

Best would be to have pipeline in VSTS, Jenkins or other build tools which will generate your package during build on server and then you can deploy it or pipeline will do it for you.

0

The easiest way I will suggest is to connect with FTP and copy file across the delivery server.

Best Practice

Ideally it supposed to be in your source control, as it is code base file and then you can use Visual studio to publish those files in your every app service instance.

Your Answer

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

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