환경 구성을 돕기 위해 Powershell을 통해 Traffic Manager 끝점을 사용하거나 사용하지 않도록 설정하려고합니다. 리소스 그룹 중 하나에서 cmdlet은 정상적으로 작동했지만 다른 사람들에게는 이상한 동작이 나타납니다. 직접 (파이프 라인 또는 매개 변수를 통해)하면 cmdlet에 TrafficManagerEndpoint
에 통과 한 경우TrafficManagerEndpoint cmdlets : 잘못된 요청 (400) 및 NullReferenceExceptions 받기
는 400을 반환하고 전체 HTML 구토 : Enable-AzureRmTrafficManagerEndpoint
및 Set-AzureRmTrafficManagerEndpoint
를 사용할 때 같은 일이 발생
> $tm = Get-AzureRmTrafficManagerProfile -Name <tm-name> -ResourceGroupname <rg-name>
> $tm.Endpoints[0] | Disable-AzureRmTrafficManagerEndpoint
Confirm
Are you sure you want to disable endpoint '<tm-endpoint-name>' of Profile '<tm-name>'?
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): y
Disable-AzureRmTrafficManagerEndpoint : <?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Request Error</title>
<style>BODY { color: #000000; background-color: white; font-family: Verdana; margin-left: 0px; margin-top: 0px; } #content { margin-left: 30px; font-size: .70em; padding-bottom: 2em; } A:link { color: #336699;
font-weight: bold; text-decoration: underline; } A:visited { color: #6699cc; font-weight: bold; text-decoration: underline; } A:active { color: #336699; font-weight: bold; text-decoration: underline; } .heading1 {
background-color: #003366; border-bottom: #336699 6px solid; color: #ffffff; font-family: Tahoma; font-size: 26px; font-weight: normal;margin: 0em 0em 10px -20px; padding-bottom: 8px; padding-left:
30px;padding-top: 16px;} pre { font-size:small; background-color: #e5e5cc; padding: 5px; font-family: Courier New; margin-top: 0px; border: 1px #f0f0e0 solid; white-space: pre-wrap; white-space: -pre-wrap;
word-wrap: break-word; } table { border-collapse: collapse; border-spacing: 0px; font-family: Verdana;} table th { border-right: 2px white solid; border-bottom: 2px white solid; font-weight: bold;
background-color: #cecf9c;} table td { border-right: 2px white solid; border-bottom: 2px white solid; background-color: #e5e5cc;}</style>
</head>
<body>
<div id="content">
<p class="heading1">Request Error</p>
<p>The server encountered an error processing the request. See server logs for more details.</p>
</div>
</body>
</html>
At line:1 char:20
+ $tm.Endpoints[0] | Disable-AzureRmTrafficManagerEndpoint
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Disable-AzureRmTrafficManagerEndpoint], CloudException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.TrafficManager.DisableAzureTrafficManagerEndpoint
합니다.
자원 이름을 사용하여 cmdlet을 호출
이Diable-AzureRmTrafficManagerEndpoint
잘 작동하지만,이 방법
Enable-AzureRmTrafficManagerEndpoint
를 호출 할 때 내가 얻을
NullReferenceException
:
> Disable-AzureRmTrafficManagerEndpoint -Name <tm-endpoint-name> -ProfileName <tm-name> -ResourceGroupName <rg-name> -Type AzureEndpoints
Confirm
Are you sure you want to disable endpoint '<tm-endpoint-name>' of Profile '<tm-name>'?
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): y
False
> Enable-AzureRmTrafficManagerEndpoint -Name <tm-endpoint-name> -ProfileName <tm-name> -ResourceGroup <rg-name> -Type AzureEndpoints
Enable-AzureRmTrafficManagerEndpoint : Object reference not set to an instance of an object.
At line:1 char:1
+ Enable-AzureRmTrafficManagerEndpoint -Name $tmEndpoint.Name -ProfileN ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Enable-AzureRmTrafficManagerEndpoint], NullReferenceException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.TrafficManager.EnableAzureTrafficManagerEndpoint
나는 이름이 올바른지 확신합니다. 이것에 대한 통찰력? 내 AzureRM.TrafficManager 모듈이 Azure와 동기화되지 않은 것처럼 보이지만 Web Platform Installer에서 사용할 수있는 모든 것을 설치하려고 시도했지만 아무 것도받지 못했습니다. (모듈 버전은 3.0.0입니다.) 감사!
편집 :
.NET 푸른 SDK 버전 : 2.9
파워 쉘 버전 : 나는 잊었다 일부 추가 정보를
Name Value
---- -----
PSVersion 5.1.14393.953
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14393.953
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
답변 해 주셔서 감사합니다! 내가 왜 당신이 대답했다는 통지를받지 않았는지 모르겠다. 이전에 Set- * 명령을 시도했지만 400 오류도 표시되었지만 몇 가지 이유로 지금 작동합니다! – mrshanahan