Source: main (252c1cf) Excluded: live tenant exports, generated artifacts, and dev-only tooling.
6.2 KiB
ASTRAL Onboarding Runbook
This guide walks through deploying ASTRAL into a new Azure DevOps organization and Microsoft 365 tenant.
Prerequisites
- Azure DevOps organization and project created.
- Owner or Contributor access to the target Microsoft 365 tenant.
- Permission to create app registrations and grant admin consent in Entra ID.
- PowerShell 7+ or Windows PowerShell 5.1 with the
Microsoft.Graphmodule (for the bootstrap script).
Step 1: Import the repository
- In Azure DevOps, create a new Git repository in your project.
- Push the contents of this repository into it, or use Import repository from a public Git URL.
Step 2: Create the tenant variable group
-
In Azure DevOps, go to Pipelines > Library and create a new Variable Group.
-
Recommended name:
vg-astral-tenant(you can choose any name). -
Add the variables from
templates/variables-tenant.yml. Use your real tenant values:Variable Example value Notes TENANT_NAMEcontoso.onmicrosoft.comYour M365 tenant domain SERVICE_CONNECTION_NAMEsc-astral-backupName you will use for the service connection USER_NAMEASTRAL Backup ServiceGit committer name USER_EMAILastral-backup@contoso.comGit committer email AGENT_POOL_NAMEAzure PipelinesChange if using a self-hosted pool BACKUP_TIMEZONEEurope/PragueValid tz database name FULL_RUN_HOUR00Hour that triggers full export AUTO_REMEDIATE_RESTORE_PIPELINE_ID(leave empty) Filled in Step 8 -
If you plan to use Azure OpenAI summaries, also add:
ENABLE_PR_AI_SUMMARY=trueAZURE_OPENAI_ENDPOINTAZURE_OPENAI_DEPLOYMENTAZURE_OPENAI_API_KEY(mark as secret)
Step 3: Link the variable group to the pipelines
Open each pipeline YAML and uncomment the variable group line near the top:
variables:
- group: vg-astral-tenant # <-- uncomment this line
- template: templates/variables-common.yml
Do this for:
azure-pipelines.ymlazure-pipelines-review-sync.ymlazure-pipelines-restore.yml
Commit and push the changes.
Step 4: Run the tenant bootstrap script
Run deploy/bootstrap-tenant.ps1 in a PowerShell session authenticated to your target tenant.
# Example
.\deploy\bootstrap-tenant.ps1 -TenantName "contoso.onmicrosoft.com" -ServiceConnectionName "sc-astral-backup"
The script will:
- Create a single-tenant app registration.
- Add required Microsoft Graph application permissions.
- Grant admin consent.
- Create a workload federated credential for Azure DevOps.
- Print the App ID and instructions for creating the Azure DevOps service connection.
Step 5: Create the Azure DevOps service connection
- In Azure DevOps, go to Project settings > Service connections.
- Click New service connection > Azure Resource Manager > Workload identity federation (manual).
- Fill in:
- Subscription: leave blank or select if you also want ARM access (not required).
- Tenant ID: your Microsoft 365 tenant ID.
- Service Connection Name: the same value you set in
SERVICE_CONNECTION_NAME(e.g.sc-astral-backup). - App ID: from the bootstrap script output.
- Save the service connection.
Step 6: Import the pipelines
- Go to Pipelines > Create pipeline > Azure Repos Git.
- Select your repository.
- Choose Existing Azure Pipelines YAML file.
- Import each of the three YAMLs one by one:
azure-pipelines.yml(main backup)azure-pipelines-review-sync.yml(review sync)azure-pipelines-restore.yml(restore)
Step 7: Grant repository permissions to the build identity
-
Go to Project settings > Repositories.
-
Select your repository.
-
Under Security, grant the Build Service account:
- Contribute
- Create branch
- Force push
- Create pull request
- Edit pull request
- Tag creation (if you enable tagging)
-
Under Pipelines, grant the build service Queue builds permission on
azure-pipelines-restore.ymlif you plan to use auto-remediation.
Step 8: Set the restore pipeline definition ID
After importing azure-pipelines-restore.yml, find its definition ID:
- Open the restore pipeline in Azure DevOps.
- The URL contains
definitionId=XX. Note the number. - Go back to your variable group (
vg-astral-tenant) and set:AUTO_REMEDIATE_RESTORE_PIPELINE_ID=XX
Step 9: Validate the deployment
- Import
deploy/validate-deployment.ymlas a one-time pipeline. - Run it.
- Verify that all checks pass:
- Graph token acquisition
- Required roles present
- Test read from Graph
- Test PR creation and abandonment
Step 10: Run the first backup
- Queue a manual run of
azure-pipelines.yml. - Set
forceFullRun=trueto get a complete initial snapshot. - Verify that
tenant-state/is populated and a rolling PR is created.
Optional: progressive feature rollout
| Phase | What to enable |
|---|---|
| Backup-only | ENABLE_PR_REVIEW_SUMMARY=false, ENABLE_PR_REVIEWER_DECISIONS=false, AUTO_REMEDIATE_AFTER_MERGE=false |
| Review package | ENABLE_PR_REVIEW_SUMMARY=true, ENABLE_PR_REVIEWER_DECISIONS=true |
| Full package | Also enable restore and set AUTO_REMEDIATE_AFTER_MERGE=true if desired |
| AI summaries | ENABLE_PR_AI_SUMMARY=true plus Azure OpenAI variables |
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| Pipeline fails at "Get Graph Token" | Wrong service connection name or missing federated credential | Verify SERVICE_CONNECTION_NAME matches the service connection exactly |
| "Missing required Graph roles" | Admin consent not granted | Run bootstrap script again or grant consent manually in Entra ID |
| Rolling PR not created | Build identity lacks PR permissions | Add Create pull request and Edit pull request permissions |
| Restore pipeline queue fails | AUTO_REMEDIATE_RESTORE_PIPELINE_ID wrong or missing queue permission |
Verify the ID and grant Queue builds on the restore pipeline |
Empty tenant-state/ after run |
First run may have no data if Graph returns nothing; also check BACKUP_FOLDER path |
Verify Graph permissions and re-run |