Azure Citadel
  • Blogs

  • ARM
  • Azure Arc
    • Overview
    • Azure Arc-enabled Servers
      • Prereqs
      • Scenario
      • Hack Overview
      • Azure Landing Zone
      • Arc Pilot resource group
      • Azure Monitoring Agent
      • Additional policy assignments
      • Access your on prem VMs
      • Create onboarding scripts
      • Onboarding using scripts
      • Inventory
      • Monitoring
      • SSH
      • Windows Admin Center
      • Governance
      • Custom Script Extension
      • Key Vault Extension
      • Managed Identity
    • Azure Arc-enabled Kubernetes
      • Prereqs
      • Background
      • Deploy Cluster
      • Connect to Arc
      • Enable GitOps
      • Deploy Application
      • Enable Azure AD
      • Enforce Policy
      • Enable Monitoring
      • Enable Azure Defender
      • Enable Data Services
      • Enable Application Delivery
    • Useful Links
  • Azure CLI
    • Install
    • Get started
    • JMESPATH queries
    • Integrate with Bash
  • Azure Landing Zones
    • Prereqs
    • Day 1
      • Azure Baristas
      • Day 1 Challenge
    • Day 2
      • Example
      • Day 2 Challenge
    • Day 3
      • Day 3 Challenge
    • Useful Links
  • Azure Policy
    • Azure Policy Basics
      • Policy Basics in the Azure Portal
      • Creating Policy via the CLI
      • Deploy If Not Exists
      • Management Groups and Initiatives
    • Creating Custom Policies
      • Customer scenario
      • Policy Aliases
      • Determine the logic
      • Create the custom policy
      • Define, assign and test
  • Azure Stack HCI
    • Overview
    • Useful Links
    • Updates from Microsoft Ignite 2022
  • Marketplace
    • Introduction
      • Terminology
      • Offer Types
    • Partner Center
    • Offer Type
    • Publish a VM Offer HOL
      • Getting Started
      • Create VM Image
      • Test VM Image
      • VM Offer with SIG
      • VM Offer with SAS
      • Publish Offer
    • Other VM Resources
    • Publish a Solution Template HOL
      • Getting Started
      • Create ARM Template
      • Validate ARM Template
      • Create UI Definition
      • Package Assets
      • Publish Offer
    • Publish a Managed App HOL
      • Getting Started
      • Create ARM Template
      • Validate ARM Template
      • Create UI Definition
      • Package Assets
      • Publish Offer
    • Managed Apps with AKS HOL
    • Other Managed App Resources
    • SaaS Offer HOLs
    • SaaS Offer Video Series
      • Video 1 - SaaS Offer Overview
      • Video 2 - Purchasing a SaaS Offer
      • Video 3 - Purchasing a Private SaaS Plan
      • Video 4 - Publishing a SaaS Offer
      • Video 5 - Publishing a Private SaaS Plan
      • Video 6 - SaaS Offer Technical Overview
      • Video 7 - Azure AD Application Registrations
      • Video 8 - Using the SaaS Offer REST Fulfillment API
      • Video 9 - The SaaS Client Library for .NET
      • Video 10 - Building a Simple SaaS Landing Page in .NET
      • Video 11 - Building a Simple SaaS Publisher Portal in .NET
      • Video 12 - SaaS Webhook Overview
      • Video 13 - Implementing a Simple SaaS Webhook in .NET
      • Video 14 - Securing a Simple SaaS Webhook in .NET
      • Video 15 - SaaS Metered Billing Overview
      • Video 16 - The SaaS Metered Billing API with REST
  • Microsoft Fabric
    • Theory
    • Prereqs
    • Fabric Capacity
    • Set up a Remote State
    • Create a repo from a GitHub template
    • Configure an app reg for development
    • Initial Terraform workflow
    • Expanding your config
    • Configure a workload identity
    • GitHub Actions for Microsoft Fabric
    • GitLab pipeline for Microsoft Fabric
  • Packer & Ansible
    • Packer
    • Ansible
    • Dynamic Inventories
    • Playbooks & Roles
    • Custom Roles
    • Shared Image Gallery
  • Partner
    • Lighthouse and Partner Admin Link
      • Microsoft Cloud Partner Program
      • Combining Lighthouse and PAL
      • Minimal Lighthouse definition
      • Using service principals
      • Privileged Identity Management
    • Useful Links
  • REST API
    • REST API theory
    • Using az rest
  • Setup
  • Terraform
    • Fundamentals
      • Initialise
      • Format
      • Validate
      • Plan
      • Apply
      • Adding resources
      • Locals and outputs
      • Managing state
      • Importing resources
      • Destroy
    • Working Environments for Terraform
      • Cloud Shell
      • macOS
      • Windows with PowerShell
      • Windows with Ubuntu in WSL2
    • Using AzAPI
      • Using the REST API
      • azapi_resource
      • Removing azapi_resource
      • azapi_update_resource
      • Data sources and outputs
      • Removing azapi_update_resource
  • Virtual Machines
    • Azure Bastion with native tools & AAD
    • Managed Identities

  • About
  • Archive
  1. Home
  2. Azure Arc
  3. Azure Arc-enabled Servers
  4. Azure Landing Zone

Table of Contents

  • Introduction
  • Overview
  • Management Groups
    • Elevate your AAD permission
    • Assign Owner role at root
    • Clone the ALZ-Bicep repo
    • Create the management groups
  • Custom Policy Definitions
  • Custom Role Definitions
  • Logging and Security
  • Subscription Placement
  • Built-In and Custom Policy Assignments
  • Policy Definitions
  • Policy Assignments
  • Success criteria
  • Next Steps

Azure Landing Zone

Deploy a default Azure Landing Zone using the Bicep repo.

Introduction

When you are onboarding VMs at scale then it makes sense to prepare the target environment first. The customer, Wide World Importers, has requested that Azure Landing Zones (ALZ) is used as they are keen to be aligned to the Microsoft best practice recommendations and leverage the IP baked into the official repos. This will be the first step in the target environment preparation.

The aka.ms/adopt/hybrid microsite has a full set of Cloud Adoption Framework documentation specifically for hybrid and multi-cloud landing zone scenarios.

This is a small POC and you have only been provided with a single subscription but it is still possible to apply ALZ. The expectation is that multiple subscriptions would be used in production as per the Azure Landing Zones documentation.

There are three recommended Microsoft repos for Azure Landing Zones:

  • Bicep (Wiki)
  • Terraform (Wiki)
  • ARM

The first two are recommended approaches for partners and customers deploying via infrastructure as code. The ARM repo underpins the Deploy to Azure options.

In this lab we will use the Bicep repo.

Overview

Wide World Importers would like a vanilla deployment of Azure Landing Zones applied to the POC environment to understand how that impacts the virtual machine onboarding.

Use the Bicep modules. The deployment follows the order in the Deployment Flow.

High-Level Deployment

⚠️ There is no need here for Azure networking services or for custom role assignments, so steps 5, 6 and 9 will be skipped.

Management Groups

You need to have the ability to create a custom management group below the root. Elevate your permissions and assign Owner at the root level.

Elevate your AAD permission

  1. Log in to the Azure Portal as an ID with Global Administrator role

  2. Navigate to the Azure Active Directory properties page

  3. Toggle Access management for Azure resources to Yes and click Save

    Elevate the permissions for Global Admin

Assign Owner role at root

  1. Open the Cloud Shell

  2. Get your AAD object ID

    id=$(az ad signed-in-user show --query id --output tsv)
    
  3. Add the Owner role at root

    az role assignment create --scope / --role Owner --assignee $id
    

    For information, the root (/) is above the Tenant Root Group (/<tenant_id>) management group that is automatically created if you were to enable Management Groups in the portal.

Clone the ALZ-Bicep repo

  1. Clone the repo

    In Cloud Shell:

    git clone https://github.com/Azure/ALZ-Bicep
    
  2. Change directory

    cd ~/ALZ-Bicep
    
  3. Update bicep

    az bicep upgrade
    

Create the management groups

  1. Deploy the Management Groups Module

    az deployment tenant create \
      --template-file infra-as-code/bicep/modules/managementGroups/managementGroups.bicep \
      --parameters @infra-as-code/bicep/modules/managementGroups/parameters/managementGroups.parameters.all.json \
      --location westeurope
    

Custom Policy Definitions

  1. Deploy the Custom Policy Definitions Module

    az deployment mg create \
      --template-file infra-as-code/bicep/modules/policy/definitions/customPolicyDefinitions.bicep \
      --parameters @infra-as-code/bicep/modules/policy/definitions/parameters/customPolicyDefinitions.parameters.all.json \
      --location westeurope \
      --management-group-id alz
    
  2. Display the custom policies

    The custom roles are are defined at the Azure Landing Zones (alz) management group.

    Select the management group, then click on Policy and then Definitions.

    Custom policy definitions created by Azure Landing Zones.

    Note that the set of in-built and custom policies are always being updated, so expect this list to change as more are contributed.

Custom Role Definitions

  1. Deploy the Custom Role Definitions Module

    az deployment mg create \
      --template-file infra-as-code/bicep/modules/customRoleDefinitions/customRoleDefinitions.bicep \
      --parameters @infra-as-code/bicep/modules/customRoleDefinitions/parameters/customRoleDefinitions.parameters.all.json \
      --location westeurope \
      --management-group-id alz
    

Logging and Security

Create a resource group (alz-logging) and deploy the default log analytics workspace and solutions.

  1. Create a resource group

    az group create --name alz-logging --location westeurope
    
  2. Deploy the Logging & Security Module

    az deployment group create \
      --template-file infra-as-code/bicep/modules/logging/logging.bicep \
      --parameters @infra-as-code/bicep/modules/logging/parameters/logging.parameters.all.json \
      --parameters parLogAnalyticsWorkspaceLocation=westeurope \
      --parameters parAutomationAccountLocation=westeurope \
      --resource-group alz-logging
    
  3. Display the resources

    Show the resources in the alz-logging resource group.

    Logging resources in alz-logging

    The various solutions work with the automation account to log diagnostics data to the ‘alz-log-analytics’ Log Analytics workspace.

Subscription Placement

The on prem virtual machines are internal facing systems and will be onboarded to a subscription within the Corp management group.

  1. Get the subscription ID

    subscription_id=$(az account show --query id --output tsv)
    
  2. Deploy the Subscription Placement Module

    Move the subscription under the Corp management group. The id for this management group is alz-landingzones-corp.

    az deployment mg create \
      --template-file infra-as-code/bicep/modules/subscriptionPlacement/subscriptionPlacement.bicep \
      --parameters '{"parTargetManagementGroupId": {"value": "alz-landingzones-corp"}, "parSubscriptionIds": {"value": ["'$subscription_id'"]}}' \
      --location westeurope --management-group-id alz
    

    The subscription will inherit any policy assignments at

    • Azure Landing Zones

    • Landing Zones

    • Corp

      As well as anything assigned at the subscription scope itself.

    Subscription placed under Corp management group

Built-In and Custom Policy Assignments

The policy assignment module allows you to customise the policy assignment of both built-in and custom policy definitions.

The main Policy Assignment readme includes examples and info as this is one of the more complex modules and facilitates a lot of customisation.

You will deploy the module using the Azure Landing Zone default policy assignments.

  1. Get the workspace id

    alz_logging_workspace_id=$(az monitor log-analytics workspace show --resource-group alz-logging --workspace-name alz-log-analytics --query id --output tsv)
    
  2. Set the email for Defender for Cloud

    email_security_contact=first.last@domain.com
    
  3. Deploy the default policy assignments

    az deployment mg create \
      --template-file infra-as-code/bicep/modules/policy/assignments/alzDefaults/alzDefaultPolicyAssignments.bicep \
      --parameters @infra-as-code/bicep/modules/policy/assignments/alzDefaults/parameters/alzDefaultPolicyAssignments.parameters.min.json \
      --parameters parLogAnalyticsWorkSpaceAndAutomationAccountLocation=westeurope \
      --parameters parLogAnalyticsWorkspaceResourceId=$alz_logging_workspace_id \
      --parameters parMsDefenderForCloudEmailSecurityContact=$email_security_contact \
      --location westeurope \
      --management-group-id alz
    

    Note that there is also an alzDefaultPolicyAssignments.parameters.all.json parameters file. The min version ensures the parDdosProtectionPlanId and parPrivateDnsResourceGroupId parameter values remain empty, as we don’t have a Connectivity subscription and will avoid DDOS Standard to keep costs down.. .

  4. View the policy assignments

    Select the subscription in the portal, click on Policies and then Assignments

    Policy assignments inherited by the subscription

  5. View the Enable Azure Monitor for VMs policy initiative

    Click on Enable Azure Monitor for VMs. Note that the logAnalytics_1 parameter has been set to the workspace ID.

    Click on View definition to see the set of policies within the initiative. Sort on Policy.

    Policy assignments inherited by the subscription

    The Enable Azure Monitor for VMs policy initiative includes deploy if not exists policies that will add the MMA Log Analytics extension and the Dependency agent and extensions to onboarded Azure Arc-enabled VMs.

Policy Definitions

The Azure Landing Zones creates a useful set of default platform resources, policies and RBAC role assignments. There are a number of custom and built-in policies that are applicable to Azure Arc-enabled Servers. Some are already assigned, and some are unassigned.

  1. Select the Azure Landing Zones management group

  2. Select Policy | Definitions

  3. Filter Categories to

    • Azure Arc
    • Monitoring
    • Security Center
  4. Search on “Arc”

    The screenshot below shows a selection of the Azure Arc related policies and policy initiatives.

    Additional policies applicable to Azure Arc-enabled Servers

    In addition, the policies in the Guest Configuration category can be used with Azure Arc-enabled Servers as well as Azure servers. You will explore this in the later Governance lab.

    Note that searching on *arc" will also bring up policies containing search etc. Ignore these.

Policy Assignments

Before we move on, let’s quickly cover some of the key components involved in Policy assignments:

  • assignment info (name, display name, description)

  • policy or policy initiative id (or name)

  • scope

  • parameters

  • managed identity (system or user assigned, identity scope, role and location)

    The managed identity definition is only needed by the template deployments in deploy if not exist policies.

The Azure documentation has a maintained index of the built-in policies and policy initiatives, which then links to the definitions in the Azure Policy GitHub repo. Alternatively, you can search the Policy definitions using the CLIs or the portal.

Success criteria

Show your proctor:

  • Management group structure with your subscription under Corp
  • The policy assignments inherited by the subscription
  • The parameter values for the Enable Azure Monitor for VMs policy initiative assignment

Next Steps

The proof of concept environment has the default ALZ management groups, custom policy definitions, custom role definitions, standard set of policy assignments and the subscription is now under the correct management group to inherit the policy assignments.

Note that whilst the Bicep modules have been deployed individually, it is also possible to use an orchestration template such as the one for hub and spoke deployments. The Bicep file shows the individual module deployments and the explicit dependencies between them.

In the next lab we’ll configure a target resource group and service principal for onboarding.

Hack Overview Azure Landing Zone Arc Pilot resource group