Level Up Your DevOps Skills With the Cloud Resume Challenge

Level Up Your DevOps Skills With the Cloud Resume Challenge

🌐 If you recently obtained professional-level certifications like Azure Solutions Architect Expert or DevOps Engineer Expert and aspire to transition smoothly to mid- or senior-level positions in the cloud domain, the Cloud Resume Challenge with DevOps mods is an ideal platform to showcase your skills. In this blog post, I'll share my experience with the Cloud Resume Challenge, focusing on DevOps challenges such as automation, Infrastructure as Code (IaaC), monitoring, end-to-end testing, and pre-deployment environments. 📝🌩️💼

Here is my resume site

What is Cloud Resume Challenge?

As Forrest Brazeal suggested in his website, CRC is a hands-on project designed to help you bridge the gap from cloud certification to cloud job. It incorporates many of the skills that real cloud and DevOps engineers use in their daily work.

A high level explanation of my resume site

No alt text provided for this image
resume site diagram

Let's start with a quick explanation of the above diagram.

My resume files (CSS, HTML, and JavaScript) are stored in Azure Blob Storage. Added a visitor counter using JavaScript to display the visitor count and utilized the Azure Cosmos DB Table API to store the counter information. Connected the resume files to the database using an Azure Function HTTP trigger, Azure Functions Core Tools, and the Azure SDK for Python. Finally, enabled HTTPS and set up the crctopcug subdomain for my static site using Azure CDN. Before deploying the backend, I performed updates using Unittest. During the deployment, I analyzed the Terraform files using Checkov. After deployment, I conducted tests on the database visitor counter logic, UI elements, and broken links using Cypress. I also sent reports to GitHub Pages and Slack. The infrastructure was deployed on a staging environment upon pull request and to production upon PR merge using GitHub Actions for CI/CD. 🌐🔄⚙️

Here are my repos:

backend

frontend

No alt text provided for this image
crc-resume site

Pause to reflect/notes/problems

I started the challenge using a template by Ceevee, making adjustments, and worked on the first three chunks simultaneously.

To automate the process, created a GitHub Actions workflow triggered on main branch pushes for building, deploying, and running UI regression tests on the frontend.

Wrote a Python Unittest to ensure successful query and update operations on the cloudres table. Additionally, used Cypress tests to load my resume site and verify the updated visitor count in the DOM. 🧪🔧

No alt text provided for this image
Ada's whiteboard

During the deployment of the static website using Terraform, I encountered an issue with incorrect content types (application-octet-stream) for all files. To solve this, I created a mime.json file to identify file extensions and replaced them using regex and the Terraform lookup function. For easier understanding, I provided the mime.json file in my project repository.

I also faced challenges in creating Cosmos bindings, resolved them by carefully matching definitions in:

* function.json,

* __init__.py,

* and the Cosmos table. 🚀🌍📦

No alt text provided for this image
matching definitions

Regarding Cors errors, I solved allowing all origins and then replacing with the CDN, custom domain, azure storage endpoints.

Monitoring: Metrics, Alerts, Action groups, Logic App & Slack integration

Monitoring the performance, availability, and health of your functions are crucial. You can utilize Azure Monitor to instrument the API and set up alerts based on the metrics you select.

Integrating with Slack using Logic App may remind you the Frattasio brother's story mixed by Erry. You have to think in reverse to understand the flow, make some trial and errors. But after understanding the flow, you can gain real-time visibility into the performance, availability, and health of your functions.

To implement monitoring:

  • Enable Application Insights.
  • Setup a connection (Slack in our case) since we need an action group to be notified when we get an alert.
  • Authorize slack connection.

On your first connection, you need to authorize slack manually:

No alt text provided for this image
authorizing slack connection
  • When you implement an Api connection, setup a logic app workflow to connect and post our alerts to Slack.
  • It's time to create an action group and specify the action type as our newly created logic app.
  • Finally, create the metric alert.
No alt text provided for this image
logic app workflow
No alt text provided for this image

Here is a sample JSON payload that you can use for metric alerts.

You can also convert these Devops mod resources into infrastructure-as-code using Terraform as shown in the below example  📊🤖:

resource "azurerm_resource_group_template_deployment" "slack" { 
  name                = "slack"
  resource_group_name = var.rg
  deployment_mode     = "Incremental"
  template_content    = file("${path.module}/json/apicon.json")
}

To connect PagerDuty to your Azure account to get service health alerts, you can follow this tutorial.

No alt text provided for this image
pager duty azure service health alerts

End-to-end tests

For end-to-end testing, you can utilize Cypress, an impressive tool for browser automation and API testing. Writing tests with Cypress is straightforward. For example, you can make a GET request to the API endpoint and assert that the response status code is 200 with a few lines of Javascript:

describe('GET request to API', () => 
    it('should response status code is equal to 200', () => {
      cy.request('GET', 'https://getresumecountercloudres').then(response => {
        expect(response.status).to.equal(200);  
  )});
});

 You can do various things such as the following:

  • Make a couple GET requests to the function API, parse the response body, assert that the visitor count value is updated
  • Verify the home page is loaded correctly, check if there are any broken links.
  • Implement mochawesome-reporter or allure to increase logging.
  • Publish cypress reports to github pages.
No alt text provided for this image
running cypress locally
No alt text provided for this image
using cypress with actions and publishing results-frontend
No alt text provided for this image
using cypress with actions and publishing results-backend

Automation, Infrastructure as Code, CI/CD, pre-production environments

You may introduce bugs that could immediately impact your live site if you have only production CI/CD pipeline. One way to lessen risks is introducing pre-production environments.

  • You can implement a multi-stage workflow that looks like the following:
  • Test build and upload the function on pull_request
  • Download the artifact and deploy to staging environment.
  • Deploy the same artifact to Prod on a PR merge and after a manual approval step.
  • Publish cypress results to pages and send a notification to slack.
No alt text provided for this image
stage environment workflow
No alt text provided for this image
prod workflow triggered on pr merge

You can also automate deployment of resource using terraform and actions.

  • Check, validate, security scan of the terraform code on push from Iaac folder
  • Deploy azure resources if unit tests are successful.
  • Make smoke tests after the function is deployed and send a notification to slack.
No alt text provided for this image
slack notifications

Lastly, for the frontend you can create a workflow as the following and implement pre-deployment environment like we did for the backend:

  • Update the Azure Storage blob and purge the Azure CDN endpoint on push to main branch.
  • Run UI regression test, publish the results to the pages.
  • Send a notification to slack.

Final words

In summary, the Cloud Resume Challenge with DevOps mods provides an excellent opportunity to demonstrate your skills in cloud. By leveraging automation, IaaC, monitoring, end-to-end testing, and multi-stage workflows, you can enhance your resume site and showcase your expertise in the cloud domain. 🌩️📄

Which mode are you currently working on? 🚀

No alt text provided for this image
She has challenges too!

References





To view or add a comment, sign in

Others also viewed

Explore topics