Manual CLI Setup

This article walks through running Archera's onboarding script manually via the Azure CLI. Use this when the in-app automated onboarding flow cannot be used — for example, if your organisation requires pre-approved scripts or has restrictions on OAuth-based provisioning.

The script is interactive: it prompts for your Tenant ID and a management subscription, lets you pick which subscriptions to onboard from a checklist, asks for confirmation before creating any resources, and prints a summary when complete.

Choosing Your Environment

Prerequisites

  • A management subscription ID — the subscription where Archera's resource group and storage account will be created. This is typically a shared services or production subscription.

    • You will be able to choose additional subscriptions to onboard into Archera later in this script.

  • The onboarding user must have:

    • Owner (or equivalent) on the management subscription

    • Access management for Azure resources enabled in Microsoft Entra ID (required to create custom roles at tenant scope — see Prerequisite Checklist)

  • whiptail installed (pre-installed in Azure Cloud Shell and most Linux distributions)

What the Script Does

  1. Validates your tenant ID and management subscription

  2. Registers the Microsoft.Storage and Microsoft.CostManagementExports resource providers

  3. Creates the Archera custom RBAC role at tenant scope (skips if it already exists)

  4. Presents a checklist of eligible subscriptions — select the ones to onboard

  5. Assigns the custom role to each selected subscription

  6. Creates a resource group and storage account in the management subscription to receive Azure Cost Management exports

  7. Assigns the required built-in roles to the Archera Enterprise Application

  8. Prints a completion summary with all resource names and IDs

Supported Subscription Types

The script only shows subscriptions eligible for FOCUS cost exports:

Quota ID
Plan

PayAsYouGo_2014-09-01

Pay-As-You-Go

EnterpriseAgreement_2014-09-01

Enterprise Agreement

CSP_2015-05-01

Cloud Solution Provider

CSP_MG_2017-12-01

CSP (Management Group)

MSDNDevTest_2014-09-01

MSDN / Dev-Test

Free Trial, Sponsored, Student, and other plan types do not support cost exports and will not appear in the checklist.

Run the Script

Download the script or copy it below, save it as azure-cli.sh, and run it:

file-download
12KB

The script will prompt you for:

  1. Tenant ID — your Azure Tenant ID (UUID format)

  2. Management subscription ID — the subscription to host the storage account

  3. Azure region — where the resource group and storage account will be created (defaults to eastus)

It then validates your active az session matches the tenant, fetches eligible subscriptions, and presents the whiptail checklist. Use SPACE to toggle subscriptions, TAB to move to OK/Cancel, and ENTER to confirm.

You will be asked to confirm before any resources are created.

Role Summary

Role
Scope
Purpose

Archera Custom Role (read)

Each selected subscription

Billing, cost management, resource reads

Reader and Data Access

Storage account

SAS token generation for cost export reads

Storage Blob Data Reader

Storage account

Direct blob read access

User Access Administrator

Storage account

Grant write access to Cost Management export managed identity

Reservation Reader

/providers/Microsoft.Capacity

Read existing Reserved Instances

Reservation Purchaser

/providers/Microsoft.Capacity + management subscription

Purchase Reserved Instances

Savings Plan Reader

/providers/Microsoft.BillingBenefits

Read existing Savings Plans

Savings Plan Purchaser

/providers/Microsoft.BillingBenefits + management subscription

Purchase Savings Plans

Advisor Recommendations Contributor

/providers/Microsoft.Advisor

Read Advisor recommendations

Last updated

Was this helpful?