Skip to content

ConsumerGuide

github-actions edited this page Dec 30, 2023 · 6 revisions

Consumer Guide

Background

This repository has been created to help customers and partners to create, deploy and deliver landing zone Subscriptions into an Microsoft Entra Tenant utilizing Bicep as the Infrastructure-as-Code (IaC) tooling and language of choice.

Ways to Consume bicep-lz-vending

Recommended Way to Consume

The recommend way is to consume the module directly from the Bicep public registry

targetScope = 'managementGroup'

module sub001 'br/public:lz/sub-vending:1.5.1' = {
  name: 'sub001'
  params: {
    subscriptionAliasEnabled: true
    subscriptionBillingScope: '/providers/Microsoft.Billing/billingAccounts/1234567/enrollmentAccounts/123456'
    subscriptionAliasName: 'sub-test-001'
    subscriptionDisplayName: 'sub-test-001'
    subscriptionTags: {
      example: 'true'
    }
    subscriptionWorkload: 'Production'
    subscriptionManagementGroupAssociationEnabled: true
    subscriptionManagementGroupId: 'corp'
    // Other parameter inputs available, see docs
  }
}

Other Ways to Consume

There are a number of other ways to consume the Bicep modules included in bicep-lz-vending. The options are:

The option to use will be different per consumer based on their experience and skill levels with the various pieces of technology and their features.

Creating your own GitHub Repository & Utilizing the Invoke-GitHubReleaseFetcher.ps1 script & gh-release-checker.yml GitHub Action Workflow

We have created a GitHub Action Workflow (gh-release-checker.yml) and a supporting PowerShell script (Invoke-GitHubReleaseFetcher.ps1) that enables you to place only these 2 into a new GitHub repository and then either manually trigger the workflow or leave it to trigger on its schedule (every weekday at 00:00) and it will check for the latest releases available from this repository, Azure/bicep-lz-vending, and create a Pull Request into a ./releases/<VERSION> folder in your repository.

Steps to use this method, action & scripts

  1. Create a new GitHub repository
  2. Copy the Invoke-GitHubReleaseFetcher.ps1 script into the following location in your new GitHub repository: .github/scripts/
  3. Copy the gh-release-checker.yml GitHub Action into the following location in your new GitHub repository: .github/workflows/
  4. Commit these files into the main (default branch) in your GitHub repository
  5. Manually trigger the GitHub action called: Check & Pull Latest Upstream GitHub Release from the "Actions" blade in your GitHub repository
  6. A Pull Request should now exist on your GitHub Repository like shown below:

Pull Request Screenshot

  1. Review the Pull Request, approve and merge it into your main (default branch) into your GitHub repository
  2. You will now have the latest release from the Azure/bicep-lz-vending repository available in its own folder, based on the release version number, within the releases folder of your GitHub repository
  3. Create a landingZones folder in the root of your GitHub repository to contain your individual parameter files for each of the landing zone Subscriptions you wish to provision
  4. You can now build your own GitHub Actions to deploy your landing zone Subscriptions based on the main.bicep module being available from the ./releases/<VERSION> folder and then you are in full control of moving to newer release of the Bicep Landing Zone (aka Subscription) vending module, but the process checking and pulling in the latest release is automatically handled for you by the above mentioned GitHub Action and PowerShell script.