Azure / Azure/azurestack-powershell

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

Đang mở
#171 5 bình luận 0 reaction 1 người được giao Được @TheOnlyWei nhận Xem trên GitHub
Ngôn ngữ chính
PowerShell
Star
16
Fork
37
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Similar to @bganapa's https://github.com/Azure/azurestack-powershell/issues/170

![Image](https://github.com/user-attachments/assets/6c7101b9-200a-49e2-aa30-49a95bc91a21)

```Install-AzProfile -Profile 2020-09-01-hybrid -Force```
```powershell
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](https://github.com/user-attachments/assets/118b9f61-5aff-45f1-b672-f53f873ee2b4)

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"```

```powershell
$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](https://github.com/user-attachments/assets/767d4f57-19d2-4de1-8cb4-1dd47f341cae)

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.