microsoftgraph / microsoftgraph/msgraph-metadata

No method match route template when executing Remove-MgBetaDeviceManagementScriptGroupAssignment

Open
#504 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

ToTriage
Dominant language
XSLT
Stars
166
Forks
55
Avg merge
16h 12m
Merged PRs (30d)
14

Description

Issue Summary
When executing the Remove-MgBetaDeviceManagementScriptGroupAssignment a status 400 (BadRequest) is received. I receive the same response in Graph Explorer.

Referenced Graph documentation: https://learn.microsoft.com/en-us/graph/api/intune-devices-devicemanagementscriptgroupassignment-delete?view=graph-rest-beta

To Reproduce

  1. Execute the following ($IntuneScript and $IntuneScriptAssignments return results in my tenant):
$ScriptName = "Escrow Bitlocker Recovery Keys"
$IntuneScript = Get-MgBetaDeviceManagementScript -Filter "displayName eq '$ScriptName'"
$URI = "https://graph.microsoft.com/beta/deviceManagement/deviceManagementScripts/$($IntuneScript.Id)/groupAssignments"
$IntuneScriptAssignments = Invoke-MgGraphRequest -Uri $URI -Method GET
$Assignment.id = $IntuneScriptAssignments.value.targetGroupId[0]
Remove-MgBetaDeviceManagementScriptGroupAssignment -DeviceManagementScriptId $IntuneScript.Id -DeviceManagementScriptGroupAssignmentId $Assignment.id
  1. Execute a DELETE against https://graph.microsoft.com/beta/deviceManagement/deviceManagementScripts/{deviceManagementScriptId}/groupAssignments/{deviceManagementScriptGroupAssignmentId} in Graph Explorer

Debug Output
In PowerShell:

DEBUG: [CmdletEndProcessing]: - Remove-MgBetaDeviceManagementScriptGroupAssignment end processing.
> $ScriptName = "Escrow Bitlocker Recovery Keys"
$IntuneScript = Get-MgBetaDeviceManagementScript -Filter "displayName eq '$ScriptName'"
# Management Scripts Assignments URI
$URI = "https://graph.microsoft.com/beta/deviceManagement/deviceManagementScripts/$($IntuneScript.Id)/groupAssignments"
$IntuneScriptAssignments = Invoke-MgGraphRequest -Uri $URI -Method GET
$intunescriptassignments.value.targetgroupid[0]| foreach {
    Remove-MgBetaDeviceManagementScriptGroupAssignment -DeviceManagementScriptId $IntuneScript.Id -DeviceManagementScriptGroupAssignmentId $_ -Debug
}

DEBUG: [CmdletBeginProcessing]: - Remove-MgBetaDeviceManagementScriptGroupAssignment 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, AppRoleAssignment.ReadWrite.All, AuditLog.Read.All, DeviceManagementConfiguration.ReadWrite.All, DeviceManagementManagedDevices.PrivilegedOperations.All, DeviceManagementManagedDevices.Read.All, DeviceManagementManagedDevices.ReadWrite.All, DeviceManagementServiceConfig.Read.All, DeviceManagementServiceConfig.ReadWrite.All, Directory.Read.All, Group.Read.All, Group.ReadWrite.All, openid, profile, User.Read, User.Read.All, email, DeviceManagementApps.ReadWrite.All].

Confirm
Are you sure you want to perform this action?
Performing the operation "Remove-MgBetaDeviceManagementScriptGroupAssignment_Delete" on target "Call remote 'DELETE
/deviceManagement/deviceManagementScripts/{deviceManagementScript-id}/groupAssignments/{deviceManagementScriptGroupAssignment-id}' operation".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): y
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
DELETE

Absolute Uri:
https://graph.microsoft.com/beta/deviceManagement/deviceManagementScripts/d830db3c-d2ec-476c-8fd6-a6b0b107f812/groupAssignments/1

Headers:
FeatureFlag                   : 00000043
Cache-Control                 : no-store, no-cache
User-Agent                    : Mozilla/5.0,(Windows NT 10.0; Microsoft Windows 10.0.22000; en-US),PowerShell/2023.8.0
Accept-Encoding               : gzip
SdkVersion                    : graph-powershell-beta/2.9.0
client-request-id             : 16151d3f-070b-433a-b0f6-c1ef5c593ccd

Body:



DEBUG: ============================ HTTP RESPONSE ============================

Status Code:
BadRequest

Headers:
Transfer-Encoding             : chunked
Vary                          : Accept-Encoding
Strict-Transport-Security     : max-age=31536000
request-id                    : 87fe623b-7707-4c96-832e-315b51685d65
client-request-id             : 16151d3f-070b-433a-b0f6-c1ef5c593ccd
x-ms-ags-diagnostic           : {"ServerInfo":{"DataCenter":"North Central US","Slice":"E","Ring":"3","ScaleUnit":"005","RoleInstance":"CH01EPF000196F0"}}
Date                          : Fri, 17 Nov 2023 05:47:22 GMT

Body:
{
  "error": {
    "code": "No method match route template",
    "message": "No OData route exists that match template ~/singleton/navigation/key/navigation/key with http verb DELETE for request /DeviceFE/StatelessDeviceFEService/deviceManagement/deviceManagementScripts('d830db3c-d2ec-476c-8fd6-a6b0b107f812')/groupAssignments('1').",
    "innerError": {
      "date": "2023-11-17T05:47:23",
      "request-id": "87fe623b-7707-4c96-832e-315b51685d65",
      "client-request-id": "16151d3f-070b-433a-b0f6-c1ef5c593ccd"
    }
  }
}


Remove-MgBetaDeviceManagementScriptGroupAssignment_Delete: 
Line |
   7 |      Remove-MgBetaDeviceManagementScriptGroupAssignment -DeviceManagem …
     |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | No OData route exists that match template ~/singleton/navigation/key/navigation/key with http verb DELETE for request /DeviceFE/StatelessDeviceFEService/deviceManagement/deviceManagementScripts('d830db3c-d2ec-476c-8fd6-a6b0b107f812')/groupAssignments('1').

Status: 400 (BadRequest)
ErrorCode: No method match route template
Date: 2023-11-17T05:47:23

Headers:
Transfer-Encoding             : chunked
Vary                          : Accept-Encoding
Strict-Transport-Security     : max-age=31536000
request-id                    : 87fe623b-7707-4c96-832e-315b51685d65
client-request-id             : 16151d3f-070b-433a-b0f6-c1ef5c593ccd
x-ms-ags-diagnostic           : {"ServerInfo":{"DataCenter":"North Central US","Slice":"E","Ring":"3","ScaleUnit":"005","RoleInstance":"CH01EPF000196F0"}}
Date                          : Fri, 17 Nov 2023 05:47:22 GMT

DEBUG: [CmdletEndProcessing]: - Remove-MgBetaDeviceManagementScriptGroupAssignment end processing.

In Graph Explorer:
{ "error": { "code": "No method match route template", "message": "No OData route exists that match template ~/singleton/navigation/key/navigation/key with http verb DELETE for request /DeviceFE/StatelessDeviceFEService/deviceManagement/deviceManagementScripts('d830db3c-d2ec-476c-8fd6-a6b0b107f812')/groupAssignments('2bc6e016-1059-436f-8c24-4cdccc5628ca').", "innerError": { "date": "2023-11-17T05:39:31", "request-id": "631534c3-b75d-4786-8123-72a247bfabf0", "client-request-id": "c4253cfc-81dc-3de9-54db-8f926066ba77" } } }

image

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the failing Remove-MgBetaDeviceManagementScriptGroupAssignment command and compare its DELETE request with the referenced Microsoft Graph endpoint and the Graph Explorer result. Verify whether the route accepts the supplied device management script and group assignment IDs; done means the documented DELETE request returns success rather than "No method match route template."

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.