4

I'm doing some testing using Unicorn, working with the Helixbase NuGet project. I set up a CI build/release pipeline, and it pushed the code and content as expected, including the Unicorn serialization folder into App_Data/unicorn. When I hit the site, however, I get this error: "Access to the path 'C:\projects\Helixbase\src\Foundation\Serialization\serialization' is denied." Which makes sense since this is the local path, not the path out on the server, but what path would I use on Azure since there's no drive path in this case?

2 Answers 2

3

If the Unicorn folder is in your App_Data folder, you should be able to set the target datastore to $(dataFolder)\unicorn.

Depending on how you configure and deploy it, it could be $(dataFolder)\unicorn\$(layer)\$(module) or something of the sort. You may have to experiment with the path a little bit, but as long as it's under the App_Data folder, the $(dataFolder) token will get the job done.

1
  • That was it...in my particular case it ended up being $(dataFolder)\unicorn\$(layer)\$(module)\serialization. Thanks much! Commented Feb 3, 2020 at 21:59
2

The target datastore uses the $(sourceFolder) variable as prefix in the value used in the different Unicorn configurations. Instead of changing the target datastore value directly, you should patch the sourceFolder variable value as follows using the appropriate value for each of your environments:

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
  <sitecore>
    <sc.variable name="sourceFolder" value="$(dataFolder)\unicorn" />
  </sitecore>
</configuration>

In this way, you are able to keep decoupled the dataFolder location and the Unicorn serialization folder location. While on deployed instances these two folders are usually nested (the Unicorn serialization folder under the Data folder), they are not always nested in a local environment setup where your local repository code and your deployed solution might be in different locations (for example if you deploy your compiled code in a separate folder on your computer, or in a Virtual Machine, or in a Docker container).

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.