From your first line of code to secure, repeatable Azure infrastructure. Practical lessons for cloud and network engineers, with explanations, examples and safe exercises.
Try it: Save as main.bicep. Run az bicep build --file main.bicep to compile locally. Review subscription-scope what-if before deployment. Resource groups may contain billable resources.
Git & CI/CD / BEGINNER
Validate before deployment
A pipeline should check formatting and syntax before infrastructure changes.
Try it: Run these in the directory containing Terraform configuration. A production pipeline should use pinned dependencies, federated identity, protected environments and approvals.
Exercise and troubleshooting: Expected False; try 10.0.1.0/24 to see True.
Python / PRACTICAL
Configuration validation
Validate configuration before using cloud APIs.
config = {'environment': 'dev'}
if config['environment'] not in {'dev', 'test', 'prod'}:
raise ValueError('Invalid environment')
print('Valid')
Exercise and troubleshooting: Change dev to invalid and observe the exception.
Python / PRACTICAL
Read Azure inventory
Install azure-identity and azure-mgmt-resource, authenticate and set the subscription environment variable.
from azure.identity import DefaultAzureCredential
from azure.mgmt.resource import ResourceManagementClient
import os
client = ResourceManagementClient(DefaultAzureCredential(), os.environ['AZURE_SUBSCRIPTION_ID'])
for group in client.resource_groups.list():
print(group.name)
Exercise and troubleshooting: Requires resource-group read permission; never hardcode credentials.
PowerShell / PRACTICAL
Filter resource groups
Filter structured objects rather than parsing text.
Exercise and troubleshooting: Compare results from inside and outside the network; inspect DNS zone links and forwarding.
Architecture / PRACTICAL
Change assurance
Treat automation as a controlled engineering change, not merely a script.
1. Capture current state
2. Validate proposed changes
3. Review blast radius
4. Approve deployment
5. Verify service health
6. Roll back if acceptance criteria fail
Exercise and troubleshooting: Define rollback and measurable acceptance criteria before deploying.