I have been playing around with .NET Core and Blazor recently to create a client side application. When it came to deploying the site I thought I would try using something different, in this case it was [Amazon’s Amplify] (https://aws.amazon.com/amplify/) which appears to be Amazon’s answer to Netlify.
Because the app I was creating was entirely client side I thought that it might be possible to do this with Amplify. Unfortunatley I could not get this to work and there was not much information out there about it, so I am creating this post with the work I have done so far in case someone else can move it on a bit further in the future.
The Problem
The main problem is that Blazor client side apps need to run - dotnet publish -c Release
in order to generate the output to be hosted and this command is not available by default.
I thought I might be able to edit the file amplify.yml
to install dotnet using the yum package manager as part of the pre build like I do in other manual AWS builds
phases:
preBuild:
commands:
- yum install rh-dotnet22 -y
but I get the error
No package rh-dotnet22 available
Solution
Not sure this will ever be added to Amplify as it is aimed heavily at front end users and dotnet core is aimed more at backend, it’s unfortunate that Blazor client side sits between the two. For now I have gone back to my manual method of hosting a static site on S3 and using CodeCommit and CodeBuild with a custom yml buildfile, you can see it here if you are interested.