So I just updated to 2026.3.5, and some of our dashboards are failing, with this toast-message:

Looking into the logs, it pinpoints the issue at a line of code where I use Grant-PSUAppToken for further API-calls. I note that the release notes have the following improvement listed, maybe this is related to my issue?
Improved app token revocation across servers, protection of token values, and permissions for creating tokens
Can you advise me if this is a bug, or if I need to use Grant-PSUAppToken in a different manner, I will also note that SecurityModel is "Permissive" as has been the case for quite a while, as authenticating with gRPC was very difficult/buggy at the time it was introduced (as far as I recall)
Below are all my findings, plus a quick repro-dashboard that fails on my system.
The following error is logged in <PSU Root>\User\Logs:
[10:00:49 ERR][App][TestDash] Status(StatusCode="Unknown", Detail="Exception was thrown by handler. InvalidOperationException: HttpContext is not available.", DebugException="Grpc.Core.Internal.CoreErrorDetailException: {"created":"@1794906049.462000000","description":"Error received from peer ipv4:127.0.0.1:49749","file":"..\..\..\src\core\lib\surface\call.cc","file_line":953,"grpc_message":"Exception was thrown by handler. InvalidOperationException: HttpContext is not available.","grpc_status":2}")
[File]: TestPage.ps1
[Endpoint]: 71af327e-d83e-4b23-bcf4-4c1092df1cd5
[Page]:
[1]
~~> [2] $Token = (Grant-PSUAppToken).Token
[3] 'Hello, token {0}' -f $Token
[4] AppSettings.json:
{
"Api": {
"SecurityModel": "Permissive",
"TrustCertificate": true,
"Url": "https://<removed for privacy>:443"
},
"Kestrel": {
"Endpoints": {
"HTTPS": {
"Url": "https://*:443",
"Certificate": {
"Subject": "<removed for privacy>",
"Store": "My",
"Location": "LocalMachine",
"AllowInvalid": "true"
}
}
}
},
"Plugins": ["SQL"],
"Data": {
"RepositoryPath": "<repo path>\\Repository",
"ConnectionString": "Server=<removed for privacy>;Database=<removed for privacy>;Integrated Security=true;Encrypt=True;TrustServerCertificate=True"
},
"Mode": "Server",
"PSUTelemetry": false
}
Repro dashboard:
.universal\dashboards.ps1:
New-PSUApp -Name 'TestDash' -FilePath 'dashboards\TestDash\TestDash.ps1' -BaseUrl '/TestDash' -Authenticated -AutoDeploy dashboards\TestDash\TestDash.ps1:
New-UDAppdashboards\TestDash\pages\TestPage.ps1:
New-UDPage -Url '/TestPage' -Name 'TestPage' -Content {
$Token = (Grant-PSUAppToken).Token
'Hello, token {0}' -f $Token
} -AutoIncludeEnvironment:
Powershell Universal: 2026.3.5
Windows Server 2022Hi Thomas,
Thank you for the repro dashboard. It let us run your own app in our lab.
This is a bug, and you are calling Grant-PSUAppToken the right way. It is not caused by 2026.3.5 or by the app token change you found in its release notes. We ran your TestDash app as you sent it, with SecurityModel set to Permissive, on several versions. On 2026.2.5 the page shows "Hello, token" followed by a token. On 2026.3.3, 2026.3.4 and 2026.3.5 it fails with the same "HttpContext is not available." error at line 2, so the problem started in the 2026.3 versions, before 2026.3.5.
In the meantime, naming the signed-in user and their roles worked on 2026.3.5 in the same app.
$Token = (Grant-PSUAppToken -IdentityName $User -Role $Roles).Token
This returned a token when the signed-in user was an administrator. For a user with only the Reader role it was refused with "Permission denied. The role specified does not have access to this resource.", so we have confirmed it only for administrators.
I am passing your repro to our QA team and will let you know what comes of it.
Best regards,
Michel
Michel Audi
Sorry, you're right, I doublechecked my logs and I was running 2026.3.2 (Though I could've sworn that I had updated to 2026.3.4 during our Service window last week)
Your suggested workaround did the trick, so I'll use that until the fix. Thanks for the quick help :)
Just an update, not so much on the bug itself, just wanted to add that I ended up moving some dashboards over to -AutoGrantToken (and $PSUAppToken) so that it worked for non-admins as well.