Skip to main content

SPA on Azure

Single-page applications (SPAs) or Static websites are applications/websites which don't need any Client-Server model to serve requests from the pages or simply, are just HTML pages hosted on file servers.

In the current world, we have a lot of hosting providers or cloud capabilities by many big players but what will be best that suits your budget and needs.

For example:

we have an 'index.html' page, but to host it, Do we really need to spend around $10-15 per month for the cheapest server? Let's directly jump on to a solution that is much efficient, reliable, and highly available worldwide.

I am talking about Azure Static Websites which consists of the following components:

* Azure storage,
* Azure CDN - Premium Microsoft CDN,
* Domain

Let say, you purchase a server from any hosting provider or deploy your website on any cloud that will end up at a higher cost even in case of no visitors.

But don't you worry about that, with Azure static websites, we only need to create Azure storage in which all your static files will reside and on top of the storage, we will have a CDN that has POPs available in almost every metro city in all countries.

Pre-requisite:

Azure subscription
Domain Name

Steps:

Step 1: Create an Azure storage account, enable a static website which will end up creating a container named $web

Step 2: Dump all your static files in this container, make sure this will be public and not contains any other files that are confidential in this container.

Step 3: Create a CDN with a provider like Microsoft Azure CDN, Premium SKU instead of Akamai or Verizon as this is the only tier on which we have custom routing rules and lowest pricing which we will need in later steps,

Step 4: Create an Endpoint and chose custom host instead of service in the dropdown and give the primary URL of the storage account containing the zone info like (z1-z7) in the hostname,

Step 5: Add Custom domain on it after adding a @ mapping to CDN hostname.


Hurray! All done.

Wait, some rewards here, check the endpoint, and see Enable HTTPS with Azure provisioned certificate for Free, yes Free no need to buy from any DNS provider.

Now a caveat here, Storage didn't allow HTTP traffic as it's layered on HTTPS, so what will happen to your users serving your website by just typing contoso.com they will get no DNS host. Okay, remember we have Azure CDN here which will help us here.

Finally, 2 steps to add beauty to your website:


* Create a custom rule with CDN to transfer your HTTP traffic to HTTPS if the same protocol is missing,
* Users will always use secured website which will enhance the trust for many of them,
* For all naked domain traffic like contoso.com, we need to forward to www.contoso.com then create a redirect method in DNS provider for the specific domain used in the CDN endpoint.

Hold on, What is the cost for this?

At max ~$0.07-$0.1/day and save your bucks and enjoy!

Comments

Popular posts from this blog

It's all about Apache Kafka

You might have heard about Apache Kafka, let's dig into it & explore why you should be aware of this and what it brings to the table.  Let's start with 'ABC' of it, "you can take a sip of coffee" and roll it. In a typical application, we have a source system & target system and data to be transferred among them. So we need to do some integrations b/w them, all well!         but we may have one source and multiple targets then the problem arises, for image 2, we have to maintain 2*4 integrations. And  you have to care about  the protocols, data schema, data format, etc    for individual integrations, integrating as many targets come along with a load on source. There should be a distributed messaging system needed to solve this and there comes Apache Kafka, and all source & target are decoupled. Apache Kafka is developed by LinkedIn and later they donated it to Apache Software Foundation, it's written in Scala &am

Overview of Azure Sentinal

On 26th Sept, Microsoft announced 'Azure Sentinal' cloud-born SIEM in GA. Here below some of the key facts, you must be aware of, related to security. Azure Sentinal is a cloud-based SIEM build with AI & ML which analyzes the TBs of data in minutes and prompt you about any security-related inconsistency followed by defining actions. No matter your applications, users, servers, and devices are on the hybrid, on-prem and any cloud other than Azure, all can be integrated using built-in connectors. It enables you to bring your own insights, tailored detection, machine learning models, and threat intelligence. You can configure alerts, playbook, logic app flows as your actions on detected threats. Use cases In case, you have clients who have more interaction with government officials through their applications may have a threat of stealing data from malicious users. Accounts may be brute-forced for such tenants to gain privileged access. Using SIEM as a servic