Landing Zone
Fundemantals
Rainer Stropek | time cockpit
General Comments
General Comments
- DevOps is hard
- Time consuming because processes take a while - and usually fail at the end π
- Struggling with permissions - especially if you try follow least-privilege approach
- Lack of/errors in documentation - particularly meaningful/correct examples
- AI assistants are of limited value
- Bash or PowerShell?
- Both are fine
- More people know bash
- Advantages of PowerShell in some Azure services (e.g. Azure Automation, Azure Functions)

This Workshop
- We are notΒ building a landing zone
- We are learning the fundamentals to build one
- This is notΒ a workshop about software or cloud architecture
- Would be too project-specific
- This is notΒ a workshop about software development
- Focus on IaC, not regular app code
- We want to gather foundational knowledge about Azure
Management Groups
Management Groups
- Way to efficiently manage access, policies, and compliance for subscriptions
- E.g. apply policy to group of subscriptions
- E.g. provide a user access to multiple subscriptions
- Hierarchical structure
- Restructuring is possible (except Root MG)
- Warning: MG hierarchy is cached for up to 30 minutes
- Limits apply π
- Root MG: Single top-level management group
- Roles on MGs π
Exercise: MG Hierarchy
- Group exercise (recommendation: pairs)
- Think about how the MG hierarchy for your org could look like
- Consider Microsoft's samples; e.g. π:
β
- Consider Microsoft's samples; e.g. π:
- Document and present your ideas

Bicep
What is Bicep?
- Domain-specific language to deploy Azure resources
- Aka Infrastructure as CodeΒ (IaC)
- Declarative, type-safe, modular language
- Always up-to-date
- Supports GA and preview versions of Azure resources
- Good authoring experience in VSCode (and forks)
- Works well with Azure CLI πΒ and Azure PowerShell π
- Uses Azure Resource ManagerΒ behind the scenes
- Preview changes with what-ifΒ operation π
- Getting started
Exercise
- Create a Bicep file to generate a resource groupΒ (example π)
- Create a Bicep module that generates an Azure Storage Account
- Compile to ARM template πΒ with az bicep build
- Take a moment to compare Bicep with JSON ARM Template
- Note that multiple Bicep modules (including loaded JSON files) are compiled into a single ARM Template file
- Deploy everythingΒ (az deploymentΒ π, example π)
- Verify in portal
Private Module Registry
- Used to share Bicep modules with other users
- Similar to Docker Registry (including versioning)
- Uses Azure Container RegistryΒ (ACR)
- Supports Private EndpointsΒ for network isolation
- Publish
- az bicep publish [...] --target br:myreg.azurecr.io/...
- With or without source code and documentation link
Exercise
Azure Verified Modules π
- Library of IaC modules verified and supported by MS
- Bicep, Terraform (additional languages might be added in the future)
- referenced with br/public:avm/...
- Intellisense in VSCode
- Resource Modules
- Verified modules for creating various (hierarchies of) resources
- Pattern Modules
- βApplication tier
- Specification published by MS π
- Can be basis for custom Bicep modules
- β οΈ Do not over-complicate things
Exercise
- Use the AVM for Resource Groups πΒ to create a new RG
- Take some time to look at the implementation and sample on GitHub
- Use the AVM for Storage Account πΒ to create a new storage account
- Blob storage
- Take a look at the implementation
Takeaway: Bicep modules can be quite large and compilicated
- Deploy everything
- Verify in portal
Template Specs
- Resource type for storing ARM templates (including Bicep)
- Used to share templates with other users
- Can be used to deploy resources later (scripted, portal)
- RBAC applies
- Differences to Module Registries
- TS can be deployed without writing a Bicep file
- TS do not need to be Bicep, can also be ARM templates
- No support for embedded artifacts like scripts
- Details see π
- Optional exercise π
Deployment Stacks
Deployment Stacks
- Manage group of Azure resources as a single unit
- Can span MGs, subscriptions, RGs
- Simplifies cleanup significantly
- Delete or detach
- Protected
- RBAC applies
- deny-settings-mode
- Control access by carefully choosing deployment scope
- Possible to exclude actions and principals
- Detailed documentation see π
Exercise
- Groups of 2 or 3 people
- Discuss possible applications of deployment stacks
- For two applications:
- Describe how you would use deployments stacks
- Which scope would you use?
- Which action on unmanageΒ would you use and why?
- Would protection of resources be necessary? If yes, how?
Azure Policies
What is a "Policy"?
Structure of a Policy
Structure of a Policy
- Parameters
- Parameters to make policies more flexible
- Name
- Will be used to reference param. value with parameters('myparam')
- Type
- string, array, object, boolean, integer, float, dateTime
- Metadata
- Default value
- Allowed values
- Schema (for object-type parameters)
- For details see docs π
Structure of a Policy
"parameters": {
"allowedLocations": {
"type": "array",
"metadata": {
"description": "The list of allowed locations for resources.",
"displayName": "Allowed locations",
"strongType": "location"
},
"defaultValue": [
"westus2"
],
"allowedValues": [
"eastus2",
"westus2",
"westus"
]
}
}
Example:
Policy Rules
Learn by Example
Exercise
- Choose two Azure Policies you would like to apply
- Create a Policy Setβ from the two policies
- Bicep or portal
- Β Assign the Policy Set to a MG or Subscription
- Bicep or portal
- Try to deploy a resource that is not compliant
- See if your policy worked
Exercise
- Choose an Azure Policy with effect Audit
- Assign the policyΒ (any scope)
- Bicep or portalΒ (Bicep preferred)
- Create a corresponding resource that violates the policy
- Bicep
- Verify non-compliance in portal
- Create a policy exemption
- Bicep or portal
- Wait a while (some hours) and check compliance again
CI/CD
GitOps
- IaC is in Git
- Benefit from branches, code reviews, automated workflows, etc.
- GitHub is the "Hero" git server for Azure
- Best support for federated authentication
- Docs π
Landing Zone Fundamentals
By Rainer Stropek
Landing Zone Fundamentals
- 130