Welcome to my take on the Cloud Resume Challenge β a cloud-focused project designed to showcase cloud engineering skills using Microsoft Azure.
This project is a static resume website hosted on Microsoft Azure. It includes a visitor counter built with .NET and Azure Functions. The entire setup runs on Azureβs free tier, so the only cost is the custom domain, which is optional.
π View my resume here
- File Structure
- What I used
- Local Workspace Setup
- Local Frontend Setup
- Azure Portal Setup
- Local Backend Setup
- Deployment to Azure
- Unit Tests Setup
- CI/CD Setup
π azure-cloud-resume-project/
βββ π frontend/
β βββ index.html
β βββ π css/
β βββ π js/
β β βββ main.js
β βββ π img/
βββ π backend/
β βββ π api/
β β βββ π Models
β β βββ π Services
β β βββ VisitorCounter.cs
β β βββ local.settings.json
β βββ π tests/
β βββ VisitorCounterServiceTests.cs
βββ π .github/
βββ π workflows/
βββ azure-deploy-frontend.yml
βββ azure-deploy-backend.yml
Git was used to track code changes, while GitHub hosts the repository and enables collaboration. Additionally, GitHub Actions was used for CI/CD implementation.
Visual Studio Code served as the primary tool for writing, editing, debugging, and deploying the code.
The project was deployed using Azure Pay-As-You-Go Subscription - using only free services (All Azure Free Services)
Built the user interface using HTML, styled it with CSS, and added interactivity using JavaScript.
Developed the backend logic using C# for handling server-side functionality.
To begin the project, we need to ensure everything is working as expected locally before moving forward with the Azure implementation.
- Download Visual Studio Code
- Download Git
- Create a new repository on GitHub
- Clone the GitHub repo on your local machine
- Run
git clonein terminal
- Run
- Open the folder in VS Code via terminal
- Run
code .in terminal
- Run
After setting up the local workspace, we can start working on the frontend part of the project.
- Create a /frontend folder in the root directory
- Install Live Server or Live Preview extensions in VS Code
ritwickdey.LiveServer
ms-vscode.live-server - Initialize Frontend code
Create your HTML/CSS files in the repo. You can start with a simple template and customize it. - Enhance your website design
SVG Repo (Free SVG Vectors and Icons)
Typed.js (Typing Animations Library)
Before continuing to develop in VS Code, we'll need to setup our Azure account.
- Create an Azure subscription. (A free trial will work)
- Create a Zero-Spend-Budget and a Cost Alert (Optional)
- Create a Resource Group in the Azure Portal
β οΈ Select a Region that is also available in the Function App resource.β οΈ - Optionally, you can test the Azure Region Latency to see which region is the best choice for your Azure resources. (Azure Speed Test)
Next, we need to work on the backend side of the project. Here we will interchangeably develop in VS Code and create resources in Azure via the portal.
- Create a /backend/api folder in the root directory
- Install .NET SDK x64 LTS (Version 8.0.16 LTS)
- Run
dotnet --infoto verify installation β οΈ Make sure you have the newly installed .NET SDK in the Environment Variables or uninstall an older version with caution.β οΈ - Remember to reopen VS Code after .NET installation
- Run
- Install Azure Tools extension in VS Code
ms-vscode.vscode-node-azure-pack - Install the C# extension in VS Code
ms-dotnettools.csharp
ms-dotnettools.csdevkit - Install the Azure Functions Core Tools .MSI x64 (Version 4.0.7030)
- Run
func --versionto verify installation
- Run
- Create a Default C# Azure Function in VS Code
- Open the api folder in VS Code
- Develop a Function using VS Code
>Azure Functions: Create New Project... - Run
func host startto test the API locally
- Create a Cosmos DB Account for NoSQL
- Add Cosmos DB Output Binding in VS Code
- Workload Type: Learning | Capacity Mode: Serverless
- Create a Container - Create an Item in the Container: id = "visits" | count = 0
- Add Cosmos DB Output Binding in VS Code
- Modify the Default Function API and Create the Visitor Counter API
- Cosmos DB v2 Bindings
- Create separate files for the model and services used in the main VisitorCounter.cs file
- Install package:
dotnet add package Microsoft.Azure.Functions.Worker.Extensions.CosmosDBin VS Code - Add a "CosmosDBConnectionString" key with the PRIMARY CONNECTION STRING value from your Cosmos DB Account in Azure in local.settings.json file
Lastly, to make everything work locally, we need to integrate our Visitor Counter API into our website.
- Create a Fetch API in JavaScript
β οΈ Initially, use the local API url. However, remember to use the Function API URL after creating it in Azure.
- Enable CORS for Local Development
- Add
"Host": {"CORS": "*"}in local.settings.json file
- Add
After finishing our local frontend setup we can proceed with the deployment. (Know that many of the services we manually create can be done automatically using Azure Static Web Apps)
- Create a Storage Account in Azure (You should have a separate Storage Account for your backend and frontend)
- Name the Storage Account the way you want your Static Website to be named
- Primary service: Azure Blob Storage
- Enable Static Website Hosting to be able to deploy your frontend code to Azure via VS Code
- Deploy Website from VS Code to Azure
- >Azure Storage: Deploy to Static Website via Azure Storage...
- Create an Azure CDN Endpoint in your Storage Account
- Origin hostname: Static website | Pricing tier: Standard Microsoft | Query string caching behavior: Ignore Query String
- Purchase and Configure a Custom Domain (This is the only service in the project that is not free)
- I used Namecheap
- Create two Host Records in the Advanced DNS section
- Type: CNAME Record | Host: www | Value: <yourAzureCDNEndpoint>
- Type: URL Redirect Record | Host: @ | Value: http://<yourCustomDomain>/ Unmasked
- Add your Custom Domain in your Azure Endpoint
- Custom hostname: <yourCustomDomain>
- Enable Custom Domain HTTPS in your Azure Custom Domain
- The certificate will be automatically created
After finishing our local backend setup we can proceed to deploy our API from VS Code to Azure
- Create a Storage Account in Azure (You'll need this for the Function App)
- Name the Storage Account like your function
- Primary service: Azure Blob Storage
- V2 Storage Account
- Create a Function App in Azure (via Portal or VS Code)
- Make sure to use the Advanced option and choose the correct Resource Group, if you create the Function App via VS Code
- Register the Microsoft.ManagedIdentity Resource Provider in Azure
- Portal => Subscriptions => Settings => Resource providers => Microsoft.ManagedIdentiy => REGISTER
- Deploy API from VS Code to Azure
- >Azure Functions: Deploy to Function App...
- Add the Custom Domain in the Function App CORS Allowed Origins List
- This allows the VisitorCounter API to work with the Custom Domain
- Add the CosmosDBConnectionString value as an Environment Variable in the Function
We should implemented unit tests for the visitor counter feature. These tests focus specifically on the logic that increments the visitor count, isolating it from external dependencies like Cosmos DB.
- Create a backend/tests
- Unit Testing C# in .NET using dotnet test and xUnit
- Initialize Test Project
- Run
dotnet new xunitcommand in terminal
- Run
- Create the VisitorCounterServiceTests.cs file
- Add reference and packages
- Run
dotnet add reference ../api/api.csprojcommand in terminal - Run
dotnet add package NSubstitutecommand in terminal - Run
dotnet add package FluentAssertionscommand in terminal
- Run
- Test the code
- Run
dotnet testcommand in terminal
- Run
Next, we will use GitHub Actions to automatically deploy code changes to Azure.
- Create Repository Secrets for your Azure Credentials
- Settings => Secrets and variables => Actions => Repository secrets
- AZURE_CLIENT_ID | AZURE_SUBSCRIPTION_ID | AZURE_TENANT_ID
- Create Frontend Workflow
- Deploy a Static Website in Azure Storage with GitHub Actions using OpenID Connect
- Create an App Registration
- Configure a Federated Identity in the App Registration
- Assign the Contributor Role to the App at the Resource Group level
- Assign the Storage Blob Data Contributor Role to the App at the Resource Group level
- Deploy a Static Website in Azure Storage with GitHub Actions using OpenID Connect
- Create Backend Workflow
- Deploy an Azure Function to Azure with GitHub Actions
- Turn ON the SCM Basic Auth Publishing Credentials setting in your Function App
- Add GitHub Repository Secret with your Function Publish Profile Settings
- Deploy an Azure Function to Azure with GitHub Actions
π§ Coming Soon: Create IaC Files

