-
Notifications
You must be signed in to change notification settings - Fork 4k
Description
Description
The following commit was added to support adding SshAuthScope to clouds that did not have urls hardcoded in the repo: c690c21
Unfortunate for clouds that are 'discovered or built-in' but do not have the SshAuthScope there is no way to add it due to the following line. We are currently encountering the error Cannot change built-in or discovered environment
when we try to run the Set-AzEnvironment -Name <EnvName> -SshAuthScope <url>
:
azure-powershell/src/Accounts/Accounts/Environment/SetAzureRMEnvironment.cs
Lines 214 to 218 in dd5c97b
if (AzureEnvironment.PublicEnvironments.Keys.Any((k) => string.Equals(k, Name, StringComparison.CurrentCultureIgnoreCase))) | |
{ | |
throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, | |
"Cannot change built-in or discovered environment {0}.", Name)); | |
} |
And when running the Enter-AzVM -ResourceGroupName <Rg-name> -Name <VM-name>
command we get:
Failed to generate AAD Certificate with exception: The scope of authenticating for SSH is not set. Please run "Set-AzEnvironment -Name <EnvName> -SshAuthScope ..." to set it first
Issue script & Debug output
N/A
Environment data
PSVersion 7.5.1
PSEdition Core
GitCommitId 7.5.1
Platform Win32NT
PSCompatibleVersion {1.0, 2.0, 3.0, 4.0...}
Module versions
Az.Accounts 5.1.1
Az.Compute 9.0.0
Az.Ssh 0.2.3
Error output
Message: Failed to generate AAD Certificate with exception: The scope of authenticating for SSH is not set. Please run "Set-AzEnvironment -Name <EnvName> -SshAuthScope ..." to set it first ...
Exception: Microsoft.Azure.Commands.Common.Exception.AzPSApplicationException
InvocationInfo: {Enter-AzVM}