Hi Gary,
Welcome to the Microsoft Q&A portal.
you need to ensure the correct account and permissions are in place. Follow these steps:
- Verify Subscription and Account:
- Log in to the Azure Portal with the account you're using for the deployment.
- Confirm that you are in the correct tenant and subscription. If you have multiple subscriptions, make sure the one you've specified for the deployment is the active one.
- Assign Required RBAC Roles:
- Navigate to the subscription in the Azure Portal.
- Go to Access control (IAM).
- Click + Add to add a role assignment.
- Assign the Contributor or Owner role to the account or service principal used for the deployment. The Owner role provides full control and is often necessary for registration. If you're using a service principal (the MSI), make sure to select it as the member.
- Also ensure that there are no older modules versions running
For this error message indicates: HCI Registration failed. This module requires Az.Accounts version 5.2.0. An earlier version of Az.Accounts is imported in the current PowerShell session. Please open a new session before importing this module. This suggests that despite having updated to version 5.2.0, your current PowerShell session is still loading an older version of Az.Accounts , likely due to module conflicts or session caching.
- Start a Fresh PowerShell Session\ Close all existing PowerShell windows and open a new session. This ensures no older modules are cached.
- Check Installed Versions\ Run the following command to list all installed versions of
Az.Accounts: Get-InstalledModule -Name Az.Accounts -AllVersions
- Uninstall Older Versions\ If multiple versions are listed, uninstall the older ones using:
Uninstall-Module -Name Az.Accounts -RequiredVersion <old_version>
- Force Import the Correct Version\ In your new session, explicitly import the correct version:
Import-Module Az.Accounts -RequiredVersion 5.2.0 -Force
- Verify Module Path Conflicts\ Sometimes, modules are loaded from unexpected paths. Use this command to check:
Get-Module -ListAvailable Az.Accounts
Review the paths to ensure no older versions are being picked up. - Use Remove-Module if Needed\ If an older version is already loaded in the session, remove it and re-import:
Remove-Module Az.Accounts
Import-Module Az.Accounts -RequiredVersion 5.2.0
4.Rerun the Deployment:
- After assigning the roles and confirming the subscription, try the deployment again from the beginning. The issue should be resolved, and the registration step should now be able to authenticate and register successfully.