Remove-MgServicePrincipalTokenLifetimePolicyByRef is not using the correct underlying HTTP Graph endpoint
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
从 Remove-MgServicePrincipalTokenLifetimePolicyByRef cmdlet 的入口点开始,将其生成的 DELETE URI 与 issue 中链接的 Microsoft Graph token lifetime policy 文档进行比较。确认 policy ID 放置在路径中的 /$ref 之前,然后在可用时运行相关的 cmdlet 或请求生成测试;当命令发送到文档所述的 endpoint 时即表示完成。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
I am using Microsoft.Graph version 2.39.0 on PowerShell 7.
The commandlet Remove-MgServicePrincipalTokenLifetimePolicyByRef is not sending out the correct MS Graph endpoint leading to error
PS C:\Users\bachoang> Remove-MgServicePrincipalTokenLifetimePolicyByRef -ServicePrincipalId xyz -Id abc -Debug
DEBUG: [CmdletBeginProcessing]: - Remove-MgServicePrincipalTokenLifetimePolicyByRef begin processing with parameterSet 'Delete'.
DEBUG: [Authentication]: - AuthType: 'Delegated', TokenCredentialType: 'InteractiveBrowser', ContextScope: 'CurrentUser', AppName: 'Microsoft Graph Command Line Tools'.
DEBUG: [Authentication]: - Scopes: [Application.Read.All, Application.ReadWrite.All, AppRoleAssignment.ReadWrite.All, AuditLog.Read.All, DelegatedPermissionGrant.ReadWrite.All, Directory.AccessAsUser.All, Directory.Read.All, Directory.ReadWrite.All, GroupMember.Read.All, openid, Policy.Read.All, Policy.ReadWrite.ApplicationConfiguration, profile, User.Read, UserAuthenticationMethod.ReadWrite.All, email].
DEBUG: ============================ HTTP REQUEST ============================
HTTP Method:
DELETE
Absolute Uri:
https://graph.microsoft.com/v1.0/servicePrincipals/xyz/tokenLifetimePolicies/$ref?@id=abc
Headers:
FeatureFlag : 00000003
Cache-Control : no-store, no-cache
User-Agent : Mozilla/5.0,(Windows NT 10.0; Microsoft Windows 10.0.26200; en-US),PowerShell/7.6.5
SdkVersion : graph-powershell/2.38.0
client-request-id : 2671f48e-a8bf-4694-80a2-b3f3997eb73f
Accept-Encoding : gzip,deflate
Body:
DEBUG: ============================ HTTP RESPONSE ============================
Status Code:
BadRequest
Headers:
Date : Tue, 18 Aug 2026 22:53:04 GMT
Transfer-Encoding : chunked
Connection : keep-alive
Vary : Accept-Encoding
Strict-Transport-Security : max-age=31536000
request-id : 0981e110-77aa-4c52-8fba-8ad957a58dd2
client-request-id : 2671f48e-a8bf-4694-80a2-b3f3997eb73f
x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"South Central US","Slice":"E","Ring":"5","ScaleUnit":"005","RoleInstance":"SN4PEPF00000013"}}
The MS Graph URL the commandlet https://graph.microsoft.com/v1.0/servicePrincipals/xyz/tokenLifetimePolicies/$ref?@id=abc sends out is wrong.
The correct MS Graph URL is https://graph.microsoft.com/v1.0/servicePrincipals/xyz/tokenLifetimePolicies/abc/$ref per https://learn.microsoft.com/en-us/entra/identity-platform/configure-token-lifetimes?source=recommendations#create-a-policy-and-assign-it-to-a-service-principal (step 4)
Expected behavior
It should make this correct request:
DELETE https://graph.microsoft.com/v1.0/servicePrincipals/xyz/tokenLifetimePolicies/abc/$re
How to reproduce
see above
SDK Version
No response
Latest version known to work for scenario above?
No response
Known Workarounds
No response
Debug output
Click to expand log
```</details>
### Configuration
_No response_
### Other information
_No response_
- 主要语言
- C#
- 星标
- 901
- 派生
- 232
- 平均合并
- 1 天 9 小时
- 30 天内合并 PR
- 22
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoftgraph/msgraph-sdk-powershell 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
microsoftgraph/msgraph-sdk-powershell#3752 ·
维护者通常 1 天内回复
-
status:waiting-for-triage type:bug
难度 2/5 1-3 小时 新手友好度 78/100
microsoftgraph/msgraph-sdk-powershell#3751 ·
维护者通常 1 天内回复
-
status:waiting-for-triage type:feature
难度 4/5 3-5 天 新手友好度 45/100
microsoftgraph/msgraph-sdk-powershell#3806 · 2 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
status:waiting-for-triage type:bug
难度 4/5 3-5 天 新手友好度 25/100
microsoftgraph/msgraph-sdk-powershell#3805 · 2 条评论 ·
维护者通常 1 天内回复
-
status:waiting-for-triage type:bug
难度 3/5 1-2 天 新手友好度 72/100
microsoftgraph/msgraph-sdk-powershell#3772 ·
维护者通常 1 天内回复
查看 microsoftgraph/msgraph-sdk-powershell 的全部 Issue
相似的 Issue
-
copilot documentation
难度 1/5 1-3 小时 新手友好度 88/100
维护者通常 2 天内回复
-
[Rust][Flaky Test] multiple_deadlines_fire_in_order asserts a wall-clock gap instead of firing order未关闭CI/CD ⚒️ Flaky-tests 🐦
难度 2/5 1-3 小时 新手友好度 88/100
valkey-io/valkey-glide#7255 ·
维护者通常 3 天内回复
-
bug good first issue
难度 1/5 1 小时以内 新手友好度 92/100
unoplatform/Uno.Core#99 ·
-
难度 2/5 1-3 小时 新手友好度 84/100
-
难度 2/5 1-3 小时 新手友好度 86/100
aws/aws-dotnet-ai#75 ·