AWS CodePipeline Deployment to include files such as png, js, and css for .NET Web App

RedBirdOBX 21 Reputation points
2022-07-15T15:43:49.163+00:00

I would think that what I am trying to do is very common and can only assume I am just doing something wrong here. I've been experimenting for the past few weeks with using AWS CodePipleline to "CICD" my sample .NET 5 RazorPages app.

Everything runs fine locally. Static files such as css and js files load into page. In fact, can publish to my RazorPages app directly to a ElasticBeanstalk instance using my AWS Toolkit in VS 2022. Again no problems.

221137-direct-publish.png

However, things seems to go sideways when I use AWS CodePipeline. Despite all my efforts, it seems the deploy process will not transfer over some of the files from my code repo (GitHub). More specifically, things located in the wwwroot folder.

http://jsplayground2021web-prod.us-east-1.elasticbeanstalk.com/

221108-cicd-test.png

No errors from the source, build or deploy events in the pipeline. Nothing.

I keep circling back to my buildspec.yml file (buildspec.yml) but can't seem to get anything to be picked up in the files list. (Disclaimer: very inexperienced with yml).

Clearly I'm doing something wrong. Pointers or assistance would be appreciated!

Developer technologies ASP.NET ASP.NET Core
{count} votes

Accepted answer
  1. Anonymous
    2022-07-22T02:50:36.193+00:00

    Hi @RedBirdOBX

    For this issue I have some suggestions for you, hope it helps.

    Please log in to AWS service to check whether these static resources exist and are in the correct path. I guess not, so we recommend to modify the .csproj file to include these static resources when the program is compiled and distributed.

    Useful Link: .NET Core include folder in publish

    After you included this folder which contains static resources, your issue will be fixed.


    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best Regards,
    Jason

    0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Anonymous
    2022-07-18T08:25:22.427+00:00

    Hi @RedBirdOBX ,
    I think the issue is mainly concerned with AWS,It's more possible to get an answer if you could ask amazon supporters for help.

    ----------

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best Regards,
    RuikaiFeng

    0 comments No comments

  2. Takahito Iwasa 4,851 Reputation points MVP Volunteer Moderator
    2022-07-21T00:45:48.827+00:00

    Hi, @RedBirdOBX

    From your information I know I'm publishing dotnet with CodeBuild, but I'm not sure how I'm deploying to Elastic Beanstalk.

    If the same dotnet command works, then you probably have a problem with the deploy process, not the build process.
    How do you set the deploy part in CodePipeline?

    0 comments No comments

  3. RedBirdOBX 21 Reputation points
    2022-07-22T10:47:25.257+00:00

    Thanks for the help. For what ever reason.. ( still don't know), it ended up being the folder name itself. The folder name had periods it in and the pipeline just couldn't pick those up as part of the source. After I looked at the source artifact and realized the min.css wasn't there, I began a series of experiments. I eventually realized it was the folder name (even though it's supposed to be an acceptable name in Linux).

    Worked....
    /assets/css/bootstrap5/bootswatch/simplex/theme.min.css
    /assets/css/test1/test2/test3/theme.min.css

    Did NOT work:
    /assets/css/bootstrap5.1.3/bootswatch/simplex/theme.min.css

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.