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
Cloud Shell runs in your browser inside the Azure Portal and is pre-authenticated — no az login required.
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
Validates your tenant ID and management subscription
Registers the Microsoft.Storage and Microsoft.CostManagementExports resource providers
Creates the Archera custom RBAC role at tenant scope (skips if it already exists)
Presents a checklist of eligible subscriptions — select the ones to onboard
Assigns the custom role to each selected subscription
Creates a resource group and storage account in the management subscription to receive Azure Cost Management exports
Assigns the required built-in roles to the Archera Enterprise Application
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:
Management subscription ID — the subscription to host the storage account
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