0

I'm building the JSS app from the dotnet nextjs template and it is working on my local with XP1 topology. However, I have difficulties deploying the app to our Sitecore installation which is deployed on Azure (with Sitecore CMS). I have set up one app service to run our rendering server: the primary app service will run the rendering server pointing to CD, and one slot to run the rendering server pointing to CM.

The question goes, how and when do I set the editing secret? From the container, it is set as environment variables. Do I set this on file App_Config/Sitecore/JavascriptServices/Sitecore.JavaScriptServices.ViewEngine.Http.config? This would mean sharing the same editing secret for all sites.

1 Answer 1

1

You can create a patch file called App.JssEditing.config and add editing secrets like this for all the environments.

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:role="http://www.sitecore.net/xmlconfig/role/" xmlns:env="http://www.sitecore.net/xmlconfig/env/" xmlns:security="http://www.sitecore.net/xmlconfig/security/">
    <sitecore role:require="Standalone or ContentManagement or XMCloud" security:require="Sitecore">
        <settings>
            <setting name="JavaScriptServices.ViewEngine.Http.JssEditingSecret" value="<your-value>"  env:require="Development" />
            <setting name="JavaScriptServices.ViewEngine.Http.JssEditingSecret" value="<your-value>"  env:require="Dev" />
            <setting name="JavaScriptServices.ViewEngine.Http.JssEditingSecret" value="<your-value>"  env:require="Qa" />
            <setting name="JavaScriptServices.ViewEngine.Http.JssEditingSecret" value="<your-value>"  env:require="Prod" />
        </settings>
    </sitecore>
</configuration>

While working with docker, you can keep this file in your docker deploy folder and it will be replaced in your Sitecore instance.

Hope this helps.

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.