assets / contentitems not appearing in azure build

2025/05/27 3:31 PM

I am using github workflow actions to deploy to my azure app. The assets/contentitems folder with physical images appear in github, but they are not being included in the artifact that is downloaded/deployed to my azure app. Any idea why?


Environment

Answers

2025/05/27 11:06 PM

CD configuration

It seems to me like you don't have a correctly configured package. I recommend running a script that will generate it for you locally so you can inspect it, iterate, and diagnose your configuration issues.

  1. How are you generating your CD deployment package? Is it generated in the GitHub workflow or are you creating it locally and committing it to your Git repo?
  2. What does your CD repository.config look like? It must be configured to include the content items that contain the assets. These items and their assets are copied from your CI Repository into your CD Repository before being .zip'd up. (Your CD Repository is a sub-set clone of your CI Repository).

CD deployment

Once you have your deployment package configured correctly you'll need to consider the following.

  1. When you restore your deployment package, where are you running the restore command?
  2. Are you storing your application's content assets in the App Service file system or in Azure Storage? In either case you need to transfer those assets to the storage location. Our recommendation is using Azure Storage and uploading the packaged assets to the storage container during the deployment (we do something similar in Xperience by Kentico SaaS).
2025/05/28 12:23 AM
Answer

It was unrelated to CI/CD. I don't know why it wasn't including the content item assets, but I added the following to my csproj and they images are appearing now, although I did have to delete all of the files added to the media library which was ok since we aren't using the media library in this project anymore

<ItemGroup> 
  <Content Include="assets\contentitems\**"> 
    <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> 
  </Content> 
</ItemGroup>
2025/06/05 11:43 PM

My above solution was a bad one. Every time I would deploy, the assets uploaded to the live site would be wiped and replaced with the ones from dev. I migrated all of the images to azure blob, which was easy, and just integrated with Azure to store the images in a container. This is the best solution, as recommended above by Sean.

To answer this question, you have to login first.