DEV Community

Cover image for Azure Static Web Apps are Awesome

Azure Static Web Apps are Awesome

David Whitney on July 29, 2020

Over the last 3 months or so, I’ve been building a lot of experimental software on the web. Silly things, fun things. And throughout, I’ve wrangled...
Collapse
 
jedjohan profile image
Johan Eriksson

Good article, thanks ! Question though: I´m a fan of multirepos. I normally place frontend in one repo, and each micro service (API) in separate repos. Makes the CI/CD easier and the structure nicer. But this looks like one big pile of code, is it possible to separate frontend/api ?

Collapse
 
david_whitney profile image
David Whitney

This kind of API would more be for your "backend for frontend" - I'd suggest that you put any actual microservices in Azure Web Apps, or Azure Functions apps, and called them by Url as usual.

Collapse
 
jedjohan profile image
Johan Eriksson

Thanks, and agree, seems like a good solution. Even though I cant vision what I would put in the "BFF". Sounds more like som helper/utility-stuff. Hmmm.

Thread Thread
 
david_whitney profile image
David Whitney

Think of a BFF as the "backend logic" of a traditional web application :)

Collapse
 
toddmorey profile image
Todd Morey

Just a note that Netlify also has support for serverless functions, deployed right from any folder you specify in your repo. Deploying updates to static content together with your API all versioned together is a super powerful workflow!

Collapse
 
david_whitney profile image
David Whitney

That's excellent 🖤

Collapse
 
randalvance profile image
Randal Vance Cunanan

Pretty sure that's where Microsoft got this idea.

Collapse
 
shadow1349 profile image
shadow1349

This is a nice article, I'd be interested in checking it out. However, have you tried Firebase Web Hosting? If you really want a seamless experience packed full of functionality I would definitely recommend checking that out.

Collapse
 
david_whitney profile image
David Whitney

I have indeed :)

I have varied, but mostly positive opinions and experiences of GCP.

Collapse
 
jwp profile image
John Peters

Excellent rundown David, Thanks for posting this!

Collapse
 
david_whitney profile image
David Whitney

Thanks John :)

Collapse
 
kanebarton profile image
Kane Barton

Great post. I'm really looking forward to seeing the Azure Static Web Apps evolve.

Collapse
 
david_whitney profile image
David Whitney

Thanks Kane - I'm excited that if they bring some default storage into the package that it's super competitive with Netlify and Firebase, along with all the other cool stuff Azure can do.

Collapse
 
kanebarton profile image
Kane Barton

I'd really like to see some form of Cosmos DB integration, whereby you specify the Json schema (e.g. /cosmos-schema/orders.json) and then the service provision the Cosmos account & setup each container. That would be awesome.

Collapse
 
juniordevforlife profile image
Jason F

Great explanation of how to use Azure Static Web Apps and combine them with Azure Functions!! Super cool!

Collapse
 
david_whitney profile image
David Whitney

Thanks Jason :)

Collapse
 
intermundos profile image
intermundos • Edited

Netlify does all that and in more concise way.

Collapse
 
david_whitney profile image
David Whitney

Netlify is awesome, but doesn't have the breadth of supporting products the Azure ecosystem has.
Great product.

Collapse
 
mathieuhuot profile image
Mathieu Huot

Thank you, I do didn't know about this. It looks like a direct alternative to Netlify.

Collapse
 
david_whitney profile image
David Whitney

Absolutely - I think the cool thing that azure static web apps have over services like netlify, is that all the rest of the Azure ecosystem is directly accessible from them, and that's pretty cool.

Which in no way undervalues the work Netlify has done, which I totally also love :)

Collapse
 
marcpiechura profile image
Marc Piechura

Are you sure that it works with a C# api too? I’ve tried it once but the GitHub action failed to build the C# function, the docs also say JavaScript is required.

Collapse
 
david_whitney profile image
David Whitney

The C# stuff works locally, but you need to do some more work in the GHAction to cajole it to work during deployment. I'll put together something more detailed here.

I think it's definitely currently a grey area :)

Collapse
 
marcpiechura profile image
Marc Piechura

Would love to see a example! I tried already to provide a package.json file that builds the function, but that wasn’t enough. Haven’t spend much time digging deeper, though.

Collapse
 
amsmart profile image
Emmanuel Oluwagbemiga Adebiyi (Smart)

C# is absolutely supported, not only that, but it's first-class. You're probably using a wrong Github Action workflow. The '.NET Core' workflow is what you're looking for.

Collapse
 
jmarbutt profile image
Jonathan Marbutt

I would love to see an example of the ‘.NET Core’ version working with the Azure Static Sites. The official docs say it isn’t supported yet from what i can tell.