Week 6 - Cloud and Azure Essentials

Introduction to Cloud and Azure

Azure CLI and the Portal

Azure Blob Storage

Azure PostgreSQL Databases

Azure Container Apps Jobs

Cost Awareness

History of Cloud Computing

Week 6 Gotchas & Pitfalls

Practice

Week 6 Assignment: Deploy Your Pipeline to Azure

Week 6 Lesson Plan

๐ŸŽ’ Week 6 Assignment: Deploy Your Pipeline to Azure

This week you will run your containerized pipeline in Azure and store its outputs in blob storage and Postgres. The result should be a cloud-native data pipeline that produces stored outputs you can verify.

Task 1: Upload Raw Data to Blob Storage

Write a Python script that uploads your pipeline's raw output (JSON or CSV) to the shared Azure Blob Storage account. Verify the blob appeared using the CLI or portal.

<aside> ๐Ÿ’ก Get the connection string from your teacher or retrieve it from Key Vault (Chapter 5). Follow the naming convention: raw/<source>/<date>.json.

</aside>

Task 2: Connect to Azure Postgres

Connect to the shared Postgres server your teacher provided. Create a table for your pipeline output and verify you can insert and query rows from Python.

<aside> ๐Ÿ’ก Get the connection string from your teacher or retrieve it from Key Vault (Chapter 5). Do not use the admin account for your pipeline.

</aside>

Task 3: Update Your Pipeline for Cloud Storage

Update your pipeline to write to both blob storage and Postgres. Your pipeline should:

<aside> โš ๏ธ Do not commit connection strings or passwords. Use environment variables.

</aside>

Task 4: Deploy as a Container App Job

Rebuild your Docker image with the cloud storage changes from Task 3 and push it to ACR (either with docker push or through CI). Verify the image is in the registry with az acr repository show-tags.

Create a Container App Job in the shared environment and resource group your teacher provided. Remember to include:

Confirm the job starts and logs are visible.

Task 5: Run and Verify

Start the job and confirm it writes to both storage targets:

  1. Check the job execution history for a successful run.
  2. Verify a blob appeared in storage.
  3. Query Postgres and verify the row count matches your log output.

<aside> โŒจ๏ธ Hands on: Add a log line that prints the row count written and the blob name uploaded.

</aside>

Task 6: Clean Up

Delete your Container App Job when you are done:

az containerapp job delete --name <your-job-name> --resource-group <rg> --yes

Do not leave jobs running after the assignment. See Chapter 5 and Chapter 6 for why this matters.

Task 7: AI Assist Report

Create AI_ASSIST.md and describe:

Deliverables

You must submit:

Technical Requirements

week6-azure-assignment/
โ”œโ”€โ”€ src/
โ”‚   โ””โ”€โ”€ pipeline.py
โ”œโ”€โ”€ Dockerfile
โ”œโ”€โ”€ requirements.txt
โ”œโ”€โ”€ README.md
โ””โ”€โ”€ AI_ASSIST.md

Evaluation Criteria

Your assignment will be evaluated on:

Extra reading

Submission

  1. Create a git branch week6/your-name.
  2. Commit your work with a clear message.
  3. Push the branch and open a Pull Request.

The HackYourFuture curriculum is licensed underย CC BY-NC-SA 4.0 *https://hackyourfuture.net/*

CC BY-NC-SA 4.0 Icons

Built with โค๏ธ by the HackYourFuture community ยท Thank you, contributors

Found a mistake or have a suggestion? Let us know in the feedback form.