Skip to content

[Az.Bootstrapper] Install-AzProfile fails to resolve 'azureprofile.azureedge.net' #171

@cblackuk

Description

@cblackuk

Similar to @bganapa's #170

Image

Install-AzProfile -Profile 2020-09-01-hybrid -Force

 Install-AzProfile -Profile 2020-09-01-hybrid -Force
Invoke-CommandWithRetry : The remote name could not be resolved: 'azureprofile.azureedge.net'
At C:\Program Files\WindowsPowerShell\Modules\Az.BootStrapper\1.0.1\Az.Bootstrapper.psm1:94 char:18
+   $WebResponse = Invoke-CommandWithRetry -ScriptBlock $ScriptBlock
+                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-CommandWithRetry], WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Invoke-CommandWithRetry

Cannot index into a null array.
At C:\Program Files\WindowsPowerShell\Modules\Az.BootStrapper\1.0.1\Az.Bootstrapper.psm1:108 char:3
+   $OnlineProfileMapETag = $WebResponse.Headers["ETag"]
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                                                                                                                         + CategoryInfo          : InvalidOperation: (:) [], RuntimeException                                                                                                                                                                         + FullyQualifiedErrorId : NullArray                                                                                                                                                                                                                                                                                                                                                                                                                                                   ConvertFrom-Json : Cannot bind argument to parameter 'InputObject' because it is null.                                                                                                                                                       At C:\Program Files\WindowsPowerShell\Modules\Az.BootStrapper\1.0.1\Az.Bootstrapper.psm1:162 char:38                                                                                                                                         +   $OnlineProfileMap = $WebResponse | ConvertFrom-Json                                                                                                                                                                                      +                                      ~~~~~~~~~~~~~~~~                                                                                                                                                                                          + CategoryInfo          : InvalidData: (:) [ConvertFrom-Json], ParameterBindingValidationException                                                                                                                                           + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.ConvertFromJsonCommand                                                                                                                                                                                                                                                                                                                                                         Get-Member : You must specify an object for the Get-Member cmdlet.                                                                                                                                                                           At C:\Program Files\WindowsPowerShell\Modules\Az.BootStrapper\1.0.1\Az.Bootstrapper.psm1:808 char:33
+ ... llProfiles = ($ProfileMap | Get-Member -MemberType NoteProperty).Name
+                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Get-Member], InvalidOperationException
    + FullyQualifiedErrorId : NoObjectInGetMember,Microsoft.PowerShell.Commands.GetMemberCommand

New-Object : A constructor was not found. Cannot find an appropriate constructor for type System.Management.Automation.ValidateSetAttribute.
At C:\Program Files\WindowsPowerShell\Modules\Az.BootStrapper\1.0.1\Az.Bootstrapper.psm1:814 char:31
+ ... Attribute = New-Object -Type System.Management.Automation.ValidateSet ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (:) [New-Object], PSArgumentException
    + FullyQualifiedErrorId : CannotFindAppropriateCtor,Microsoft.PowerShell.Commands.NewObjectCommand

Invoke-CommandWithRetry : The remote name could not be resolved: 'azureprofile.azureedge.net'
At C:\Program Files\WindowsPowerShell\Modules\Az.BootStrapper\1.0.1\Az.Bootstrapper.psm1:94 char:18
+   $WebResponse = Invoke-CommandWithRetry -ScriptBlock $ScriptBlock
+                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-CommandWithRetry], WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Invoke-CommandWithRetry

Cannot index into a null array.
At C:\Program Files\WindowsPowerShell\Modules\Az.BootStrapper\1.0.1\Az.Bootstrapper.psm1:108 char:3
+   $OnlineProfileMapETag = $WebResponse.Headers["ETag"]
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : NullArray

ConvertFrom-Json : Cannot bind argument to parameter 'InputObject' because it is null.
At C:\Program Files\WindowsPowerShell\Modules\Az.BootStrapper\1.0.1\Az.Bootstrapper.psm1:162 char:38
+   $OnlineProfileMap = $WebResponse | ConvertFrom-Json
+                                      ~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [ConvertFrom-Json], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.ConvertFromJsonCommand

Get-Member : You must specify an object for the Get-Member cmdlet.
At C:\Program Files\WindowsPowerShell\Modules\Az.BootStrapper\1.0.1\Az.Bootstrapper.psm1:808 char:33
+ ... llProfiles = ($ProfileMap | Get-Member -MemberType NoteProperty).Name
+                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Get-Member], InvalidOperationException
    + FullyQualifiedErrorId : NoObjectInGetMember,Microsoft.PowerShell.Commands.GetMemberCommand

New-Object : A constructor was not found. Cannot find an appropriate constructor for type System.Management.Automation.ValidateSetAttribute.
At C:\Program Files\WindowsPowerShell\Modules\Az.BootStrapper\1.0.1\Az.Bootstrapper.psm1:814 char:31
+ ... Attribute = New-Object -Type System.Management.Automation.ValidateSet ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (:) [New-Object], PSArgumentException
    + FullyQualifiedErrorId : CannotFindAppropriateCtor,Microsoft.PowerShell.Commands.NewObjectCommand

Install-Module : A parameter cannot be found that matches parameter name 'AllowPrerelease'.
At C:\Program Files\WindowsPowerShell\Modules\Az.BootStrapper\1.0.1\Az.Bootstrapper.psm1:568 char:104
+ ... sion -AllowClobber -Repository $script:BootStrapRepo -AllowPrerelease
+                                                          ~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Install-Module], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Install-Module

Image

This breaks Azure Stack Hub installation of modules as per https://learn.microsoft.com/en-us/azure-stack/operator/powershell-install-az-module?view=azs-2501#connected-install-with-internet-connectivity

Also breaks getting the module versions:
Get-AzModule -Profile "2020-09-01-hybrid" -Module "Az.Storage"

$VerbosePreference = "continue"
PS C:\Users\cblack>  Get-AzModule -Profile "2020-09-01-hybrid" -Module "Az.Storage"
VERBOSE: Updating profiles
VERBOSE: Requested HTTP/1.1 GET with 0-byte payload
VERBOSE: Waiting 3 second(s) before attempting again
VERBOSE: Requested HTTP/1.1 GET with 0-byte payload
VERBOSE: Waiting 3 second(s) before attempting again
VERBOSE: Requested HTTP/1.1 GET with 0-byte payload
Invoke-CommandWithRetry: No such host is known.
InvalidOperation: Cannot index into a null array.
ConvertFrom-Json: Cannot bind argument to parameter 'InputObject' because it is null.
Get-Member: You must specify an object for the Get-Member cmdlet.
New-Object: A constructor was not found. Cannot find an appropriate constructor for type System.Management.Automation.ValidateSetAttribute.
VERBOSE: Getting the version of Az.Storage from 2020-09-01-hybrid
VERBOSE: Populating RepositorySourceLocation property for module Az.Storage.
2.6.2

Image

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions