DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Because the DevOps movement has redefined engineering responsibilities, SREs now have to become stewards of observability strategy.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Related

  • A Comparison of Current Kubernetes Distributions
  • Mastering Cloud Containerization: A Step-by-Step Guide to Deploying Containers in the Cloud
  • Keep Your Application Secrets Secret
  • Dynatrace Perform: Day Two

Trending

  • Implementing Explainable AI in CRM Using Stream Processing
  • Designing a Java Connector for Software Integrations
  • Cloud Security and Privacy: Best Practices to Mitigate the Risks
  • How to Build Real-Time BI Systems: Architecture, Code, and Best Practices
  1. DZone
  2. Software Design and Architecture
  3. Cloud Architecture
  4. Cloud Migration: Azure Blob Storage Static Website

Cloud Migration: Azure Blob Storage Static Website

In this article, we will look at how on-perm front-end applications migrate to the cloud using static website hosting Azure blob storage.

By 
Vadivel Chandran user avatar
Vadivel Chandran
·
Feb. 15, 24 · Tutorial
Likes (1)
Comment
Save
Tweet
Share
10.9K Views

Join the DZone community and get the full member experience.

Join For Free

Problem Statement: Legacy Front-End Applications On-Premises Architecture

Currently, a lot of front-end applications are built and deployed using on-prem Docker Kubernetes container images, which are hosted on web servers (Apache/NGINX/IIS, etc.)

The problem with this approach is that the workload container cluster must run constantly, which increases the compute and replication cost, infrastructure maintenance, and lack of recovery.

Solution: Modern Front End Applications Azure Cloud Blob Storage Architecture

Modern static front-end applications are migrating to the cloud, and where here, the Azure blob storage is cheaper in computing and infrastructure(hardware + Networking) costs. 

 We performed a cost estimation assessment of Azure Blob vs. on-prem container for around 300+ front-end applications. As a business result, 40% cost savings on infrastructure in Azure blob cloud storage. This approach does not need virtual machine containers/clusters, web servers, and cost per usage.

Azure Storage Account Creation

A storage account is an Azure Resource Manager resource. Resource Manager is the deployment and management service for Azure. For more information, see Azure Resource Manager overview.

Every Resource Manager resource, including an Azure storage account, must belong to an Azure resource group. A resource group is a logical container for grouping your Azure services. When you create a storage account, you have the option to either create a new resource group or use an existing resource group. This how-to shows how to create a new resource group.

To create an Azure storage account with the Azure portal, follow these steps:

1. From the left portal menu, select Storage Accounts to display a list of your storage accounts. If the portal menu isn't visible, select the menu button to toggle it on.

storage accounts

2. On the Storage accounts page, select Create.

create

3. On the Basics tab, provide the essential information for your storage account. After you complete the Basics tab, you can choose to customize your new storage account further by setting options on the other tabs, or you can select Review + Create to accept the default options and proceed to validate and create the account.

create a storage account

Host Static Website in Azure Blob Storage

Azure storage static websites are a feature that allows you to host static website content (HTML, CSS, JavaScript, and image files) directly from a storage container named $web. This is a great option for scenarios for client-side rendering websites where you don't need a web server to render content.

Let's do a walkthrough to enable the static website and upload the static website in $web container blob storage.

Enable Static Website Hosting

Static website hosting is a feature that you must enable on the storage account.

  1. Sign in to the Azure portal to get started.
  2. Locate your storage account and select it to display the account's Overview pane.
  3. In the Overview pane, select the Capabilities tab. Next, select Static Website to display the configuration page for the static website.

static website

4. Select Enabled to enable static website hosting for the storage account.

5. In the Index document name field, specify a default index page (For example: index.html). The default index page is displayed when a user navigates to the root of your static website.

6. In the Error document path field, specify a default error page (For example, 404.html). The default error page is displayed when a user attempts to navigate to a page that does not exist in your static website.

7. Click Save to finish the static site configuration.

Save

8. A confirmation message is displayed. Your static website endpoints and other configuration information are shown within the Overview pane.

overview

Upload Static Website

The following instructions show you how to upload files by using the Azure portal. You could also use AzCopy, PowerShell, CLI, or any custom applications, such as the Jenkin pipeline, that can upload files to the $web container of your account. For a step-by-step tutorial that uploads files by using Visual Studio code, see Tutorial: Host a static website on Blob Storage.

  1. In the Azure portal, navigate to the storage account containing your static website. Select Containers in the left navigation pane to display the list of containers.
  2. In the Containers pane, select the $web container to open the container's Overview pane.

overview portal

3. In the Overview pane, select the Upload icon to open the Upload blob pane. Next, select the Files field within the Upload blob pane to open the file browser. Navigate to the file you want to upload, select it, and then select Open to populate the Files field. Optionally, select the Overwrite checkbox if files already exist.

Here, you can upload as files or an entire static website folder.

static folder

4. If you intend for the browser to display the contents of the file, make sure that the content type of that file is set to text/html. To verify this, select the name of the blob you uploaded in the previous step to open its Overview pane. Ensure that the value is set within the CONTENT-TYPE property field.

new web page

Find the Website URL

You can view the pages of your site from a browser by using the public URL of the website. 

To Enhance security, you can apply the Private link to the public URL of the website to secure the network connection.

In the pane that appears beside the account overview page of your storage account, select Static Website. The URL of your site appears in the Primary endpoint field.

Find the Website URL

Ideally, we can’t expose the Azure primary endpoint as a public website URL; using the company domain web server can configure the rewrite logic to access the Azure primary/private endpoint URL.

** We can’t configure the http/https headers through Azure blob storage. Azure CDN/Front door helps this case.

Azure Front Door

To configure the web server headers' capability, such as preflight CORS, setting cache-expiry, content-type, access-control-origin, and security headers through the Azure front door. 

  1. In the Azure portal, choose a storage account, select the type “Azure Front Door,” and create a profile.

front door

2. Add route to the front door profile.

add a route

3. Add security policy to the front door domain

add security policy

4. To deploy the Azure Front Door profile, select Review + Create and then Create. The configurations propagate to all edge locations in a few minutes.

Conclusion

In conclusion, this is an in-depth guide to help create storage accounts and static websites using the $web blob container and access static through Azure Front door (CDN) services. If you like this guide and want to know more about Azure blob storage through static website and Azure front door services, you can visit the official documentation pages below.

Azure Storage Account

Azure blob static website 

Azure Front Door

Kubernetes azure Cloud Docker (software)

Opinions expressed by DZone contributors are their own.

Related

  • A Comparison of Current Kubernetes Distributions
  • Mastering Cloud Containerization: A Step-by-Step Guide to Deploying Containers in the Cloud
  • Keep Your Application Secrets Secret
  • Dynatrace Perform: Day Two

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!