Home

Unable to register new RDS Host via Powershell

%3CLINGO-SUB%20id%3D%22lingo-sub-846683%22%20slang%3D%22en-US%22%3EUnable%20to%20register%20new%20RDS%20Host%20via%20Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-846683%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20having%20trouble%20adding%20a%20custom%20Azure%20Image%20to%20an%20existing%20WVD%20Pool.%20I'm%20deploying%20the%20agents%20to%20a%20new%20RDS%20host%20via%20the%20following%20PowerShell%20commands%20(part%20of%20a%20larger%20script%20that%20builds%20the%20pool%20from%20scratch%20and%20adds%20the%20hosts)%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3EInvoke-Command%20-Session%20%24hostSessions%20-ScriptBlock%20%7BStart-Process%20-FilePath%20%22msiexec.exe%22%20-ArgumentList%20%22%2Fi%20C%3A%5CSupport%5CRDInfraAgentInstall%5CRDAgent.msi%22%2C%20%22%2Fquiet%22%2C%20%22%2Fqn%22%2C%20%22%2Fnorestart%22%2C%20%22%2Fpassive%22%2C%20%22REGISTRATIONTOKEN%3D%24token%22%2C%20%22%2Fl*%20C%3A%5CSupport%5CRDAgentInstall.txt%22%20-Wait%20-Passthru%7D%0A%0AInvoke-Command%20-Session%20%24hostSessions%20-ScriptBlock%20%7BStart-Process%20-FilePath%20%22msiexec.exe%22%20-ArgumentList%20%22%2Fi%20C%3A%5CSupport%5CRDAgentBootLoaderInstall%5CRDBootLoader.msi%22%2C%20%22%2Fquiet%22%2C%20%22%2Fqn%22%2C%20%22%2Fnorestart%22%2C%20%22%2Fpassive%22%2C%20%22%2Fl*%20C%3A%5CSupport%5CRDBootLoaderInstall.txt%22%20-Wait%20-Passthru%7D%0A%0AInvoke-Command%20-Session%20%24hostSessions%20-ScriptBlock%20%7BStart-Service%20RDAgentBootLoader%7D%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EChecking%20the%20install%20logs%20shows%20that%20both%20agents%20install%20fine.%20I%20can%20see%20all%20variables%20are%20correctly%20populated%20(including%20the%20registration%20token).%20However%20if%20I%20look%20at%20the%20WVD%20pool%20in%20the%20management%20console%20no%20RDS%20hosts%20are%20displayed.%20Rebooting%20the%20hosts%20doesn't%20help%20either.%20I%20can%20see%20a%20couple%20reoccurring%20errors%20in%20the%20event%20viewer%20but%20nothing%20particularly%20helpful%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3EBootLoader%20exception%3ASystem.AggregateException%3A%20One%20or%20more%20errors%20occurred.%20---%26gt%3B%20System.Exception%3A%20Could%20not%20resolve%20a%20service%20of%20type%20'Microsoft.RDInfra.ScheduledTasks.HostedServiceExecutor'%20for%20the%20parameter%20'hostedServiceExecutor'%20of%20method%20'Configure'%20on%20type%20'Microsoft.RDInfra.RDAgent.Service.Startup'.%20---%26gt%3B%20System.ArgumentException%3A%20IDX12741%3A%20JWT%3A%20'%5BPII%20is%20hidden%5D'%20must%20have%20three%20segments%20(JWS)%20or%20five%20segments%20(JWE).%0A%20%20%20at%20System.IdentityModel.Tokens.Jwt.JwtSecurityToken..ctor(String%20jwtEncodedString)%0A%20%20%20at%20Microsoft.RDInfra.RDAgent.Service.RDAgentBrokerConfiguration.GetDiagnosticsURI()%20in%20C%3A%5Cagent%5C_work%5C14%5Cs%5Csrc%5CRDAgent%5Csrc%5CService%5CAgentSettings.cs%3Aline%20875%0A%20%20%20at%20Microsoft.RDInfra.Diagnostics.Agent.AgentRestPipelineSinkOptions.Configure(RestPipelineSinkOptions%20options)%20in%20C%3A%5Cagent%5C_work%5C14%5Cs%5Csrc%5CShared%5CDiagnostics%5Csrc%5CMicrosoft.RDInfra.Diagnostics.Agent%5CAgentRestPipelineSinkOptions.cs%3Aline%2032%0A%20%20%20at%20Microsoft.Extensions.Options.OptionsFactory%601.Create(String%20name)%0A%20%20%20at%20System.Lazy%601.CreateValue()%0A%20%20%20at%20System.Lazy%601.LazyInitValue()%0A%20%20%20at%20Microsoft.RDInfra.Diagnostics.DataSink.RestPipelineSink..ctor(HttpClient%20httpClient%2C%20ILoggerFactory%20loggerFactory%2C%20IOptions%601%20restPipelineSinkOptions%2C%20ITokenRetriever%20tokenRetriever%2C%20IMonitoringService%20monitoringService)%20in%20C%3A%5Cagent%5C_work%5C14%5Cs%5Csrc%5CShared%5CDiagnostics%5Csrc%5CMicrosoft.RDInfra.Diagnostics%5CDataSink%5CRestPipelineSink.cs%3Aline%2060%0A---%20End%20of%20stack%20trace%20from%20previous%20location%20where%20exception%20was%20thrown%20---%0A%20%20%20at%20System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()%0A%20%20%20at%20Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite%20constructorCallSite%2C%20ServiceProviderEngineScope%20scope)%0A%20%20%20at%20Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite%20scopedCallSite%2C%20ServiceProviderEngineScope%20scope)%0A%20%20%20at%20Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite%20constructorCallSite%2C%20ServiceProviderEngineScope%20scope)%0A%20%20%20at%20Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite%20scopedCallSite%2C%20ServiceProviderEngineScope%20scope)%0A%20%20%20at%20Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite%20constructorCallSite%2C%20ServiceProviderEngineScope%20scope)%0A%20%20%20at%20Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite%20scopedCallSite%2C%20ServiceProviderEngineScope%20scope)%0A%20%20%20at%20Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite%20constructorCallSite%2C%20ServiceProviderEngineScope%20scope)%0A%20%20%20at%20Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite%20scopedCallSite%2C%20ServiceProviderEngineScope%20scope)%0A%20%20%20at%20Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite%20constructorCallSite%2C%20ServiceProviderEngineScope%20scope)%0A%20%20%20at%20Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite%20scopedCallSite%2C%20ServiceProviderEngineScope%20scope)%0A%20%20%20at%20Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite%20constructorCallSite%2C%20ServiceProviderEngineScope%20scope)%0A%20%20%20at%20Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite%20scopedCallSite%2C%20ServiceProviderEngineScope%20scope)%0A%20%20%20at%20Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitIEnumerable(IEnumerableCallSite%20enumerableCallSite%2C%20ServiceProviderEngineScope%20scope)%0A%20%20%20at%20Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite%20constructorCallSite%2C%20ServiceProviderEngineScope%20scope)%0A%20%20%20at%20Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite%20scopedCallSite%2C%20ServiceProviderEngineScope%20scope)%0A%20%20%20at%20Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.%26lt%3B%26gt%3Bc__DisplayClass1_0.b__0(ServiceProviderEngineScope%20scope)%0A%20%20%20at%20Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider%20provider%2C%20Type%20serviceType)%0A%20%20%20at%20Microsoft.AspNetCore.Hosting.Internal.ConfigureBuilder.Invoke(Object%20instance%2C%20IApplicationBuilder%20builder)%0A%20%20%20---%20End%20of%20inner%20exception%20stack%20trace%20---%0A%20%20%20at%20Microsoft.AspNetCore.Hosting.Internal.ConfigureBuilder.Invoke(Object%20instance%2C%20IApplicationBuilder%20builder)%0A%20%20%20at%20Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder%20app)%0A%20%20%20at%20Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()%0A%20%20%20at%20Microsoft.AspNetCore.Hosting.Internal.WebHost.d__26.MoveNext()%0A---%20End%20of%20stack%20trace%20from%20previous%20location%20where%20exception%20was%20thrown%20---%0A%20%20%20at%20System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()%0A%20%20%20at%20System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task%20task)%0A%20%20%20at%20Microsoft.AspNetCore.Hosting.WebHostExtensions.d__5.MoveNext()%0A---%20End%20of%20stack%20trace%20from%20previous%20location%20where%20exception%20was%20thrown%20---%0A%20%20%20at%20System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()%0A%20%20%20at%20System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task%20task)%0A%20%20%20at%20Microsoft.AspNetCore.Hosting.WebHostExtensions.d__4.MoveNext()%0A%20%20%20---%20End%20of%20inner%20exception%20stack%20trace%20---%0A%20%20%20at%20System.Threading.Tasks.Task.ThrowIfExceptional(Boolean%20includeTaskCanceledExceptions)%0A%20%20%20at%20System.Threading.Tasks.Task.Wait(Int32%20millisecondsTimeout%2C%20CancellationToken%20cancellationToken)%0A%20%20%20at%20Microsoft.RDInfra.RDAgent.Service.RDAgentMain.CreateRDAgentWebHost(String%20workingDirectory)%20in%20C%3A%5Cagent%5C_work%5C14%5Cs%5Csrc%5CRDAgent%5Csrc%5CService%5CRDAgentMain.cs%3Aline%2069%0A%20%20%20at%20System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid2%5BT0%2CT1%5D(CallSite%20site%2C%20T0%20arg0%2C%20T1%20arg1)%0A%20%20%20at%20RDAgentBootLoader.RDAgentBootLoader.d__9.MoveNext()%20in%20C%3A%5Cagent%5C_work%5C12%5Cs%5Csrc%5CRDAgent%5Csrc%5CRDAgentBootLoader%5CRDAgentBootLoader.cs%3Aline%2061%0A---%26gt%3B%20(Inner%20Exception%20%230)%20System.Exception%3A%20Could%20not%20resolve%20a%20service%20of%20type%20'Microsoft.RDInfra.ScheduledTasks.HostedServiceExecutor'%20for%20the%20parameter%20'hostedServiceExecutor'%20of%20method%20'Configure'%20on%20type%20'Microsoft.RDInfra.RDAgent.Service.Startup'.%20---%26gt%3B%20System.ArgumentException%3A%20IDX12741%3A%20JWT%3A%20'%5BPII%20is%20hidden%5D'%20must%20have%20three%20segments%20(JWS)%20or%20five%20segments%20(JWE).%0A%20%20%20at%20System.IdentityModel.Tokens.Jwt.JwtSecurityToken..ctor(String%20jwtEncodedString)%0A%20%20%20at%20Microsoft.RDInfra.RDAgent.Service.RDAgentBrokerConfiguration.GetDiagnosticsURI()%20in%20C%3A%5Cagent%5C_work%5C14%5Cs%5Csrc%5CRDAgent%5Csrc%5CService%5CAgentSettings.cs%3Aline%20875%0A%20%20%20at%20Microsoft.RDInfra.Diagnostics.Agent.AgentRestPipelineSinkOptions.Configure(RestPipelineSinkOptions%20options)%20in%20C%3A%5Cagent%5C_work%5C14%5Cs%5Csrc%5CShared%5CDiagnostics%5Csrc%5CMicrosoft.RDInfra.Diagnostics.Agent%5CAgentRestPipelineSinkOptions.cs%3Aline%2032%0A%20%20%20at%20Microsoft.Extensions.Options.OptionsFactory%601.Create(String%20name)%0A%20%20%20at%20System.Lazy%601.CreateValue()%0A%20%20%20at%20System.Lazy%601.LazyInitValue()%0A%20%20%20at%20Microsoft.RDInfra.Diagnostics.DataSink.RestPipelineSink..ctor(HttpClient%20httpClient%2C%20ILoggerFactory%20loggerFactory%2C%20IOptions%601%20restPipelineSinkOptions%2C%20ITokenRetriever%20tokenRetriever%2C%20IMonitoringService%20monitoringService)%20in%20C%3A%5Cagent%5C_work%5C14%5Cs%5Csrc%5CShared%5CDiagnostics%5Csrc%5CMicrosoft.RDInfra.Diagnostics%5CDataSink%5CRestPipelineSink.cs%3Aline%2060%0A---%20End%20of%20stack%20trace%20from%20previous%20location%20where%20exception%20was%20thrown%20---%0A%20%20%20at%20System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()%0A%20%20%20at%20Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite%20constructorCallSite%2C%20ServiceProviderEngineScope%20scope)%0A%20%20%20at%20Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite%20scopedCallSite%2C%20ServiceProviderEngineScope%20scope)%0A%20%20%20at%20Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite%20constructorCallSite%2C%20ServiceProviderEngineScope%20scope)%0A%20%20%20at%20Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite%20scopedCallSite%2C%20ServiceProviderEngineScope%20scope)%0A%20%20%20at%20Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite%20constructorCallSite%2C%20ServiceProviderEngineScope%20scope)%0A%20%20%20at%20Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite%20scopedCallSite%2C%20ServiceProviderEngineScope%20scope)%0A%20%20%20at%20Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite%20constructorCallSite%2C%20ServiceProviderEngineScope%20scope)%0A%20%20%20at%20Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite%20scopedCallSite%2C%20ServiceProviderEngineScope%20scope)%0A%20%20%20at%20Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite%20constructorCallSite%2C%20ServiceProviderEngineScope%20scope)%0A%20%20%20at%20Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite%20scopedCallSite%2C%20ServiceProviderEngineScope%20scope)%0A%20%20%20at%20Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite%20constructorCallSite%2C%20ServiceProviderEngineScope%20scope)%0A%20%20%20at%20Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite%20scopedCallSite%2C%20ServiceProviderEngineScope%20scope)%0A%20%20%20at%20Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitIEnumerable(IEnumerableCallSite%20enumerableCallSite%2C%20ServiceProviderEngineScope%20scope)%0A%20%20%20at%20Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite%20constructorCallSite%2C%20ServiceProviderEngineScope%20scope)%0A%20%20%20at%20Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite%20scopedCallSite%2C%20ServiceProviderEngineScope%20scope)%0A%20%20%20at%20Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.%26lt%3B%26gt%3Bc__DisplayClass1_0.b__0(ServiceProviderEngineScope%20scope)%0A%20%20%20at%20Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider%20provider%2C%20Type%20serviceType)%0A%20%20%20at%20Microsoft.AspNetCore.Hosting.Internal.ConfigureBuilder.Invoke(Object%20instance%2C%20IApplicationBuilder%20builder)%0A%20%20%20---%20End%20of%20inner%20exception%20stack%20trace%20---%0A%20%20%20at%20Microsoft.AspNetCore.Hosting.Internal.ConfigureBuilder.Invoke(Object%20instance%2C%20IApplicationBuilder%20builder)%0A%20%20%20at%20Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder%20app)%0A%20%20%20at%20Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()%0A%20%20%20at%20Microsoft.AspNetCore.Hosting.Internal.WebHost.d__26.MoveNext()%0A---%20End%20of%20stack%20trace%20from%20previous%20location%20where%20exception%20was%20thrown%20---%0A%20%20%20at%20System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()%0A%20%20%20at%20System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task%20task)%0A%20%20%20at%20Microsoft.AspNetCore.Hosting.WebHostExtensions.d__5.MoveNext()%0A---%20End%20of%20stack%20trace%20from%20previous%20location%20where%20exception%20was%20thrown%20---%0A%20%20%20at%20System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()%0A%20%20%20at%20System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task%20task)%0A%20%20%20at%20Microsoft.AspNetCore.Hosting.WebHostExtensions.d__4.MoveNext()%26lt%3B---%3C%2FCODE%3E%3C%2FPRE%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3ENo%20rollback%20agent%20provided!%3C%2FCODE%3E%3C%2FPRE%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3EResetting%20Agent%20to%20RDAgent_1.0.833.5%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EEven%20if%20I%20manually%20install%20the%20agents%20afterwards%20in%20an%20RDS%20host%20and%20reboot%20it%20still%20doesn't%20appear.%20However%20if%20I%20use%20Azure%20Portal%20to%20build%20the%20pool%20(with%20the%20same%20custom%20image)%20it%20works%20fine%20and%20builds%20a%20new%20pool%20with%20the%20hosts%20correctly%20added.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20can't%20see%20why%20installing%20the%20agents%20via%20Powershell%20is%20failing%20for%20my%20custom%20image.%20Anyone%20else%20come%20across%20this%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Deleted
Not applicable

I'm having trouble adding a custom Azure Image to an existing WVD Pool. I'm deploying the agents to a new RDS host via the following PowerShell commands (part of a larger script that builds the pool from scratch and adds the hosts):

 

Invoke-Command -Session $hostSessions -ScriptBlock {Start-Process -FilePath "msiexec.exe" -ArgumentList "/i C:\Support\RDInfraAgentInstall\RDAgent.msi", "/quiet", "/qn", "/norestart", "/passive", "REGISTRATIONTOKEN=$token", "/l* C:\Support\RDAgentInstall.txt" -Wait -Passthru}

Invoke-Command -Session $hostSessions -ScriptBlock {Start-Process -FilePath "msiexec.exe" -ArgumentList "/i C:\Support\RDAgentBootLoaderInstall\RDBootLoader.msi", "/quiet", "/qn", "/norestart", "/passive", "/l* C:\Support\RDBootLoaderInstall.txt" -Wait -Passthru}

Invoke-Command -Session $hostSessions -ScriptBlock {Start-Service RDAgentBootLoader}

 

Checking the install logs shows that both agents install fine. I can see all variables are correctly populated (including the registration token). However if I look at the WVD pool in the management console no RDS hosts are displayed. Rebooting the hosts doesn't help either. I can see a couple reoccurring errors in the event viewer but nothing particularly helpful:

 

BootLoader exception:System.AggregateException: One or more errors occurred. ---> System.Exception: Could not resolve a service of type 'Microsoft.RDInfra.ScheduledTasks.HostedServiceExecutor' for the parameter 'hostedServiceExecutor' of method 'Configure' on type 'Microsoft.RDInfra.RDAgent.Service.Startup'. ---> System.ArgumentException: IDX12741: JWT: '[PII is hidden]' must have three segments (JWS) or five segments (JWE).
   at System.IdentityModel.Tokens.Jwt.JwtSecurityToken..ctor(String jwtEncodedString)
   at Microsoft.RDInfra.RDAgent.Service.RDAgentBrokerConfiguration.GetDiagnosticsURI() in C:\agent\_work\14\s\src\RDAgent\src\Service\AgentSettings.cs:line 875
   at Microsoft.RDInfra.Diagnostics.Agent.AgentRestPipelineSinkOptions.Configure(RestPipelineSinkOptions options) in C:\agent\_work\14\s\src\Shared\Diagnostics\src\Microsoft.RDInfra.Diagnostics.Agent\AgentRestPipelineSinkOptions.cs:line 32
   at Microsoft.Extensions.Options.OptionsFactory`1.Create(String name)
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at Microsoft.RDInfra.Diagnostics.DataSink.RestPipelineSink..ctor(HttpClient httpClient, ILoggerFactory loggerFactory, IOptions`1 restPipelineSinkOptions, ITokenRetriever tokenRetriever, IMonitoringService monitoringService) in C:\agent\_work\14\s\src\Shared\Diagnostics\src\Microsoft.RDInfra.Diagnostics\DataSink\RestPipelineSink.cs:line 60
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitIEnumerable(IEnumerableCallSite enumerableCallSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass1_0.b__0(ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
   at Microsoft.AspNetCore.Hosting.Internal.ConfigureBuilder.Invoke(Object instance, IApplicationBuilder builder)
   --- End of inner exception stack trace ---
   at Microsoft.AspNetCore.Hosting.Internal.ConfigureBuilder.Invoke(Object instance, IApplicationBuilder builder)
   at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app)
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.d__26.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Hosting.WebHostExtensions.d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Hosting.WebHostExtensions.d__4.MoveNext()
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at Microsoft.RDInfra.RDAgent.Service.RDAgentMain.CreateRDAgentWebHost(String workingDirectory) in C:\agent\_work\14\s\src\RDAgent\src\Service\RDAgentMain.cs:line 69
   at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid2[T0,T1](CallSite site, T0 arg0, T1 arg1)
   at RDAgentBootLoader.RDAgentBootLoader.d__9.MoveNext() in C:\agent\_work\12\s\src\RDAgent\src\RDAgentBootLoader\RDAgentBootLoader.cs:line 61
---> (Inner Exception #0) System.Exception: Could not resolve a service of type 'Microsoft.RDInfra.ScheduledTasks.HostedServiceExecutor' for the parameter 'hostedServiceExecutor' of method 'Configure' on type 'Microsoft.RDInfra.RDAgent.Service.Startup'. ---> System.ArgumentException: IDX12741: JWT: '[PII is hidden]' must have three segments (JWS) or five segments (JWE).
   at System.IdentityModel.Tokens.Jwt.JwtSecurityToken..ctor(String jwtEncodedString)
   at Microsoft.RDInfra.RDAgent.Service.RDAgentBrokerConfiguration.GetDiagnosticsURI() in C:\agent\_work\14\s\src\RDAgent\src\Service\AgentSettings.cs:line 875
   at Microsoft.RDInfra.Diagnostics.Agent.AgentRestPipelineSinkOptions.Configure(RestPipelineSinkOptions options) in C:\agent\_work\14\s\src\Shared\Diagnostics\src\Microsoft.RDInfra.Diagnostics.Agent\AgentRestPipelineSinkOptions.cs:line 32
   at Microsoft.Extensions.Options.OptionsFactory`1.Create(String name)
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at Microsoft.RDInfra.Diagnostics.DataSink.RestPipelineSink..ctor(HttpClient httpClient, ILoggerFactory loggerFactory, IOptions`1 restPipelineSinkOptions, ITokenRetriever tokenRetriever, IMonitoringService monitoringService) in C:\agent\_work\14\s\src\Shared\Diagnostics\src\Microsoft.RDInfra.Diagnostics\DataSink\RestPipelineSink.cs:line 60
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitIEnumerable(IEnumerableCallSite enumerableCallSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass1_0.b__0(ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
   at Microsoft.AspNetCore.Hosting.Internal.ConfigureBuilder.Invoke(Object instance, IApplicationBuilder builder)
   --- End of inner exception stack trace ---
   at Microsoft.AspNetCore.Hosting.Internal.ConfigureBuilder.Invoke(Object instance, IApplicationBuilder builder)
   at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app)
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.d__26.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Hosting.WebHostExtensions.d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Hosting.WebHostExtensions.d__4.MoveNext()<---
No rollback agent provided!
Resetting Agent to RDAgent_1.0.833.5

 

Even if I manually install the agents afterwards in an RDS host and reboot it still doesn't appear. However if I use Azure Portal to build the pool (with the same custom image) it works fine and builds a new pool with the hosts correctly added.

 

I can't see why installing the agents via Powershell is failing for my custom image. Anyone else come across this?

 

Related Conversations
Extentions Synchronization
Deleted in Discussions on
3 Replies
Tabs and Dark Mode
cjc2112 in Discussions on
35 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
29 Replies