From 60ed95f10b3a996071ed58733917b4f6a44ddc68 Mon Sep 17 00:00:00 2001 From: John Erskine Date: Wed, 12 Nov 2025 18:53:56 +0000 Subject: [PATCH 1/6] Update uninstall commands for Az.Accounts --- ...SI-Does-Not-Have-Access-To-Subscription.md | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/TSG/EnvironmentValidator/Troubleshooting-MSI-Does-Not-Have-Access-To-Subscription.md b/TSG/EnvironmentValidator/Troubleshooting-MSI-Does-Not-Have-Access-To-Subscription.md index 0b95f2e..ad36a29 100644 --- a/TSG/EnvironmentValidator/Troubleshooting-MSI-Does-Not-Have-Access-To-Subscription.md +++ b/TSG/EnvironmentValidator/Troubleshooting-MSI-Does-Not-Have-Access-To-Subscription.md @@ -56,12 +56,24 @@ There are two possible issues that can cause this: 2) Role Assignment for Azure Stack HCI Device Management Role is not correct. ## If any other version of Az.Accounts apart from 4.0.2 is installed on the nodes follow the below steps: -*** -1. Uninstall all the versions of az.accounts on all nodes + ``` -Uninstall-Module az.accounts -allversions +$RequiredModuleName = 'Az.Accounts' +$RequiredModuleVersion = '4.0.2' + +# Get all versions of the +Get-InstalledModule -Name $RequiredModuleName -AllVersions + +#Uninstall all but the required version +Get-InstalledModule -Name $RequiredModuleName -AllVersions | Where-Object { $_.Version -ne $RequiredModuleVersion } | ForEach-Object { Uninstall-Module -Name $RequiredModuleName -RequiredVersion $_.Version -Force } + +# if the required version was not present in the first command's output, install it. +Install-Module -Name $RequiredModuleName -RequiredVersion $RequiredModuleVersion -Force + +# Verify only the required version is installed +Get-InstalledModule -Name $RequiredModuleName -AllVersions ``` -3. Retry update from portal + ## If the only version of Az.Accounts is 4.0.2 on the system, check access control *** From 0aca626a82fc1b7b0433f8a3c25b5f35f537c35a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 24 Nov 2025 07:00:27 +0000 Subject: [PATCH 2/6] Initial plan From 1613c71753c0624e5e3ab81300cd8436693294b6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 24 Nov 2025 07:00:36 +0000 Subject: [PATCH 3/6] Initial plan From a98d07bfbfb8c45016c0e5611d170320a935aaf3 Mon Sep 17 00:00:00 2001 From: John Erskine <50907780+erskinejohn@users.noreply.github.com> Date: Mon, 24 Nov 2025 07:00:41 +0000 Subject: [PATCH 4/6] Update TSG/EnvironmentValidator/Troubleshooting-MSI-Does-Not-Have-Access-To-Subscription.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../Troubleshooting-MSI-Does-Not-Have-Access-To-Subscription.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TSG/EnvironmentValidator/Troubleshooting-MSI-Does-Not-Have-Access-To-Subscription.md b/TSG/EnvironmentValidator/Troubleshooting-MSI-Does-Not-Have-Access-To-Subscription.md index ad36a29..1e35f95 100644 --- a/TSG/EnvironmentValidator/Troubleshooting-MSI-Does-Not-Have-Access-To-Subscription.md +++ b/TSG/EnvironmentValidator/Troubleshooting-MSI-Does-Not-Have-Access-To-Subscription.md @@ -67,7 +67,7 @@ Get-InstalledModule -Name $RequiredModuleName -AllVersions #Uninstall all but the required version Get-InstalledModule -Name $RequiredModuleName -AllVersions | Where-Object { $_.Version -ne $RequiredModuleVersion } | ForEach-Object { Uninstall-Module -Name $RequiredModuleName -RequiredVersion $_.Version -Force } -# if the required version was not present in the first command's output, install it. +# If the required version was not present in the first command's output, install it. Install-Module -Name $RequiredModuleName -RequiredVersion $RequiredModuleVersion -Force # Verify only the required version is installed From 5c2abf3b9de7ceb7967ea7e347a331d52f8af915 Mon Sep 17 00:00:00 2001 From: John Erskine <50907780+erskinejohn@users.noreply.github.com> Date: Mon, 24 Nov 2025 07:00:56 +0000 Subject: [PATCH 5/6] Update TSG/EnvironmentValidator/Troubleshooting-MSI-Does-Not-Have-Access-To-Subscription.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../Troubleshooting-MSI-Does-Not-Have-Access-To-Subscription.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TSG/EnvironmentValidator/Troubleshooting-MSI-Does-Not-Have-Access-To-Subscription.md b/TSG/EnvironmentValidator/Troubleshooting-MSI-Does-Not-Have-Access-To-Subscription.md index 1e35f95..419e725 100644 --- a/TSG/EnvironmentValidator/Troubleshooting-MSI-Does-Not-Have-Access-To-Subscription.md +++ b/TSG/EnvironmentValidator/Troubleshooting-MSI-Does-Not-Have-Access-To-Subscription.md @@ -61,7 +61,7 @@ There are two possible issues that can cause this: $RequiredModuleName = 'Az.Accounts' $RequiredModuleVersion = '4.0.2' -# Get all versions of the +# Get all versions of the module Get-InstalledModule -Name $RequiredModuleName -AllVersions #Uninstall all but the required version From 07c034e94b96bf2b1bcc72744677cfd32f5c4a7c Mon Sep 17 00:00:00 2001 From: John Erskine <50907780+erskinejohn@users.noreply.github.com> Date: Mon, 24 Nov 2025 07:01:13 +0000 Subject: [PATCH 6/6] Update TSG/EnvironmentValidator/Troubleshooting-MSI-Does-Not-Have-Access-To-Subscription.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../Troubleshooting-MSI-Does-Not-Have-Access-To-Subscription.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TSG/EnvironmentValidator/Troubleshooting-MSI-Does-Not-Have-Access-To-Subscription.md b/TSG/EnvironmentValidator/Troubleshooting-MSI-Does-Not-Have-Access-To-Subscription.md index 419e725..57451db 100644 --- a/TSG/EnvironmentValidator/Troubleshooting-MSI-Does-Not-Have-Access-To-Subscription.md +++ b/TSG/EnvironmentValidator/Troubleshooting-MSI-Does-Not-Have-Access-To-Subscription.md @@ -64,7 +64,7 @@ $RequiredModuleVersion = '4.0.2' # Get all versions of the module Get-InstalledModule -Name $RequiredModuleName -AllVersions -#Uninstall all but the required version +# Uninstall all but the required version. Get-InstalledModule -Name $RequiredModuleName -AllVersions | Where-Object { $_.Version -ne $RequiredModuleVersion } | ForEach-Object { Uninstall-Module -Name $RequiredModuleName -RequiredVersion $_.Version -Force } # If the required version was not present in the first command's output, install it.