For the complete documentation index, see llms.txt. This page is also available as Markdown.

Moving Azure Resources to Another Subscription

Recommendations for moving the Azure resources connected to RealmJoin — Key Vault, Log Analytics workspace, Automation Account and Workplace Cloud Storage — to another Azure subscription.

Overview

Use the Azure Move → Move to another subscription function for every resource instead of creating new ones. A move keeps names, endpoints and data, so most connections to RealmJoin keep working as they are.

Resource
Used by RealmJoin for
What to do after the move

LAPS passwords

Nothing in RealmJoin — verify only

Audit log, operational and runbook logs

Run Set-RJLogAnalyticsWorkspace again with the new target

Runbooks

Run Set-RJAutomationAccount again with the new target

Workplace Cloud Storage

Nothing in RealmJoin — verify only

General Considerations

  • Same Entra ID tenant. This page assumes that the old and the new subscription belong to the same Microsoft Entra ID tenant. Moving resources to another tenant is a different scenario and is not covered here.

  • Move, don't recreate. A new resource gets new names, keys or certificates. For the Key Vault this means that existing LAPS passwords can no longer be decrypted (see below).

  • Same region. A move never changes the region of a resource. Create the target resource group in the same region as the resources you move — for the Automation Account this is required (see below).

  • Role assignments do not move. Azure role assignments made directly on a moved resource are orphaned and must be created again. The RealmJoin setup commands do this for you.

  • Blockers. Remove resource locks temporarily and check the Azure Policies of the target subscription before you start. Azure validates every move and reports what blocks it.

  • Timing. Plan the move of the Log Analytics workspace and the Automation Account in a quiet period and reconnect them right afterwards (see the respective sections).

See also Microsoft's move guidance and the list of resource types that support moves.

Key Vault (LAPS)

RealmJoin only stores the DNS name of the Key Vault. The name stays the same during a move, so RealmJoin LAPS keeps working without any change in RealmJoin.

  1. Move the vault: Key Vault → Overview → Move → Move to another subscription. The access policies (see KeyVault) move with the vault, so there is nothing to reconfigure. A vault used for VM disk encryption cannot be moved.

  2. Verify: the certificate realmjoin-master still exists, and LAPS passwords can still be displayed in RealmJoin Portal for a few devices.

During the move, Azure only blocks management operations. Reading and writing secrets keeps working.

Log Analytics Workspace

The workspace ID, your logs and the retention settings stay the same. However, the Data Collection Rules that RealmJoin writes through cannot be moved: they stay in the old subscription and no longer point to the workspace. The role assignments for RealmJoin on the workspace are lost as well.

  1. Before the move, remove solutions or a linked Automation Account from the workspace, if there are any — Azure does not move a workspace with linked services.

  2. Move the workspace: Log Analytics workspace → Overview → Subscription: change. Do not select the Data Collection Rules (dcr-rj-*). The move can take a while.

  3. Generate a script token in RealmJoin Portal under Organization → Features (https://portal.realmjoin.com/organization/features) with Generate script token. This requires permission to edit organization features, and the token is only valid for a limited time.

  4. Run the following command in a freshly opened, local PowerShell session — not in Azure Cloud Shell. Use the new subscription ID and resource group and the existing workspace name; without the workspace name, a new workspace would be created.

    The command leaves the existing workspace and its data untouched, creates new Data Collection Rules in the workspace's region, assigns the required roles and registers the new values with RealmJoin. The Azure and PowerShell prerequisites are the same as for the initial setup, see Connecting Azure Log Analytics Workspace.

  5. In Settings → Log Analytics, select Refresh and Check for configuration problems. Then check that new entries appear in the Audit Log.

  6. Delete the old Data Collection Rules in the old subscription.

Still using the workspace ID and shared key? Azure regenerates the workspace keys during a move, so logging stops immediately. Run the setup command as described above — it also switches your tenant to the Log Ingestion API (see Migrating to the Log Ingestion API).

Automation Account (Runbooks)

Runbooks, schedules, variables and credentials as well as the managed identity move with the Automation Account. RealmJoin, however, stores the subscription and resource group of the account and loses its role assignment on it, so the account must be reconnected.

  1. Note the object ID of the managed identity (Automation Account → Account Settings → Identity).

  2. If the Automation Account is linked to a Log Analytics workspace (for example for Update Management or Change Tracking), remove these features and unlink the workspace first, as described by Microsoft.

  3. Move the Automation Account to the target resource group.

  4. Generate a script token as described for the Log Analytics workspace (step 3).

  5. Run the following command in a freshly opened, local PowerShell session. Use the new subscription ID and resource group and the existing Automation Account name.

    The command assigns the role for RealmJoin on the account again and registers the new values with RealmJoin. The Azure and PowerShell prerequisites are the same as for the initial setup, see Connecting Azure Automation.

  6. Verify:

    • The object ID of the managed identity is unchanged. If it has changed, grant its roles and permissions again.

    • Settings → Runbooks → Refresh shows the new values and the runbook sync completes.

    • A test runbook runs successfully.

    • If you use Hybrid Runbook Workers, they still connect.

Workplace Cloud Storage

RealmJoin connects to the storage account with its connection string, which contains the account name and access key. Both stay the same during a move, so the public URLs of your favorites, backgrounds, files and signatures keep working.

  1. Move the storage account to the target resource group.

  2. Verify: upload a test file in RealmJoin Portal under Organization → Other Files. If an error occurs, copy the connection string again from Storage account → Access keys and save it under Settings → Workplace cloud storage (see Workplace Cloud Storage).

Last updated

Was this helpful?