source/Private/AzureResourceConstants.ps1

# Azure Resource Deployment Constants

# Required Azure PowerShell modules (lazy-loaded; pinned to major.minor, any patch release >= the listed version is accepted)
New-Variable -Name "RequiredAzModules" -Value ([ordered]@{
    "Az.Accounts"   = "5.5.3"
    "Az.Resources"  = "10.2.1"
    "Az.Automation" = "1.12.1"
}) -Scope "Script" -Option ReadOnly

# Default DCR deployment flags
New-Variable -Name "DefaultDeployAuditLogsDCR" -Value $true -Scope "Script" -Option ReadOnly
New-Variable -Name "DefaultDeployRunbookLogsDCR" -Value $true -Scope "Script" -Option ReadOnly
New-Variable -Name "DefaultDeployOperationalLogsDCR" -Value $true -Scope "Script" -Option ReadOnly

# Service principal replication wait defaults
New-Variable -Name "ReplicationMaxAttempts" -Value 4 -Scope "Script" -Option ReadOnly
New-Variable -Name "ReplicationBaseDelaySeconds" -Value 8 -Scope "Script" -Option ReadOnly

# Polling interval (seconds) for live ARM deployment progress reporting
New-Variable -Name "ArmDeploymentPollIntervalSeconds" -Value 5 -Scope "Script" -Option ReadOnly

# RBAC role definition IDs (passed as parameters to Bicep templates at deploy time)
New-Variable -Name "LogAnalyticsReaderRoleId" -Value "73c42c96-874c-492b-b04d-ab87d138a893" -Scope "Script" -Option ReadOnly
New-Variable -Name "MonitoringMetricsPublisherRoleId" -Value "3913510d-42f4-4e42-8a64-420c390055eb" -Scope "Script" -Option ReadOnly
New-Variable -Name "ContributorRoleId" -Value "b24988ac-6180-42a0-ab88-20f7382dd24c" -Scope "Script" -Option ReadOnly
New-Variable -Name "StorageBlobDataContributorRoleId" -Value "ba92f5b4-2d11-453d-a403-e96b0029c9fe" -Scope "Script" -Option ReadOnly
New-Variable -Name "KeyVaultCertificatesOfficerRoleId" -Value "a4417e6f-fecd-4de8-b567-7b0420556985" -Scope "Script" -Option ReadOnly
New-Variable -Name "KeyVaultSecretsOfficerRoleId" -Value "b86a8fe4-44ce-4948-aee5-eccb2c155cd7" -Scope "Script" -Option ReadOnly
New-Variable -Name "KeyVaultCryptoUserRoleId" -Value "12338af0-0e69-4776-bea7-57ae8d297424" -Scope "Script" -Option ReadOnly

# Roles of the RealmJoin Client service principal on the LAPS Key Vault (display name = role definition ID)
New-Variable -Name "KeyVaultClientRoles" -Value ([ordered]@{
    "Key Vault Certificates Officer" = $KeyVaultCertificatesOfficerRoleId
    "Key Vault Secrets Officer"      = $KeyVaultSecretsOfficerRoleId
    "Key Vault Crypto User"          = $KeyVaultCryptoUserRoleId
}) -Scope "Script" -Option ReadOnly

# Default SKU of the Workplace Cloud Storage account
New-Variable -Name "DefaultWorkplaceCloudStorageSkuName" -Value "Standard_LRS" -Scope "Script" -Option ReadOnly

# Manifests of the Automation Account managed identity (API permissions, Entra ID directory roles), published by the runbooks repository ({0} = branch, {1} = file name)
New-Variable -Name "RunbookManifestUrlTemplate" -Value "https://raw.githubusercontent.com/realmjoin/realmjoin-runbooks/{0}/docs/other/json/{1}" -Scope "Script" -Option ReadOnly
New-Variable -Name "RunbookManifestFileNames" -Value @{
    Permissions    = "AllRealmJoinRunbooks_collected_permissions.json"
    DirectoryRoles = "AllRealmJoinRunbooks_collected_rbacroles.json"
} -Scope "Script" -Option ReadOnly
New-Variable -Name "DefaultRunbookBranch" -Value "production" -Scope "Script" -Option ReadOnly

# Microsoft Graph REST endpoint used for directory role assignments (not covered by Az cmdlets or the Graph Bicep extension)
New-Variable -Name "MSGraphApiBaseUrl" -Value "https://graph.microsoft.com/v1.0" -Scope "Script" -Option ReadOnly