Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GCCH] Get-MgDeviceManagementDeviceCompliancePolicyScheduledActionForRule Calls incorrect API endpoint #2177

Closed
tbisque opened this issue Jul 20, 2023 · 5 comments

Comments

@tbisque
Copy link

tbisque commented Jul 20, 2023

Describe the bug

Note: This may be gov/gcch-specific. Get-MgDeviceManagementDeviceCompliancePolicyScheduledActionForRule & Get-MgBetaDeviceManagementDeviceCompliancePolicyScheduledActionForRule both call deviceManagement/deviceCompliancePolicies/{{compliancepolicyid}}/schedule**_d_**ActionsForRule. When viewing network calls in brower / Intune portal, the endpoint is scheduleActionsForRule, not schedule**_d_**ActionsForRule.

To Reproduce
Steps to reproduce the behavior:

  1. Connect to Graph (Az Gov / GCCH tenant)
  2. Run Get-MgDeviceManagementDeviceCompliancePolicy to obtain an ID
  3. Run Get-MgDeviceManagementDeviceCompliancePolicyScheduledActionForRule -DeviceCompliancePolicyId {{ID from step 2}}

Expected behavior

should returned scheduledActionForRule

Debug Output

DEBUG: [CmdletBeginProcessing]: - Get-MgDeviceManagementDeviceCompliancePolicyScheduledActionForRule begin processing with parameterSet 'List'.
DEBUG: [Authentication]: - AuthType: 'EnvironmentVariable', TokenCredentialType: 'EnvironmentVariable', ContextScope: 'Process', AppName: 'Steel Root Configuration Service'.
DEBUG: [Authentication]: - Scopes: [Policy.ReadWrite.ConditionalAccess, User.ReadWrite.All, Policy.ReadWrite.AuthenticationFlows, Domain.ReadWrite.All, RoleManagementPolicy.ReadWrite.Directory, Application.ReadWrite.All, Directory.ReadWrite.All, Group.ReadWrite.All, DeviceManagementServiceConfig.ReadWrite.All, Organization.ReadWrite.All, DeviceManagementManagedDevices.ReadWrite.All, PrivilegedAccess.ReadWrite.AzureAD, InformationProtectionPolicy.Read.All, RoleManagement.ReadWrite.Directory, AuditLog.Read.All, Policy.Read.All, DeviceManagementConfiguration.ReadWrite.All, Application.Read.All, Policy.ReadWrite.Authorization, DeviceManagementApps.ReadWrite.All].
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
GET

Absolute Uri:
https://graph.microsoft.us/v1.0/deviceManagement/deviceCompliancePolicies/{{REMOVED}}/scheduledActionsForRule

Headers:
FeatureFlag : 00000043
Cache-Control : no-store, no-cache
User-Agent : Mozilla/5.0,(Windows NT 10.0; Microsoft Windows 10.0.19045; en-US),PowerShell/7.3.4
Accept-Encoding : gzip
SdkVersion : graph-powershell/2.1.0
client-request-id : {{REMOVED}}

Body:

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

Status Code:
BadRequest

Headers:
Transfer-Encoding : chunked
Vary : Accept-Encoding
Strict-Transport-Security : max-age=31536000
request-id : {{REMOVED}}
client-request-id : {{REMOVED}}
x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"USGov Arizona","Slice":"E","Ring":"5","ScaleUnit":"001","RoleInstance":"PH1NEPF00008CC9"}}
Date : Thu, 20 Jul 2023 19:56:16 GMT

Body:
{
"error": {
"code": "No method match route template",
"message": "No OData route exists that match template ~/singleton/navigation/key/navigation with http verb GET for request /DeviceConfiguration/StatelessDeviceConfigurationFEService/deviceManagement/deviceCompliancePolicies('{{REMOVED}}')/scheduledActionsForRule.",
"innerError": {
"date": "2023-07-20T19:56:17",
"request-id": "{{REMOVED}}",
"client-request-id": "{{REMOVED}}"
}
}
}

Get-MgDeviceManagementDeviceCompliancePolicyScheduledActionForRule_List: No OData route exists that match template ~/singleton/navigation/key/navigation with http verb GET for request /DeviceConfiguration/StatelessDeviceConfigurationFEService/deviceManagement/deviceCompliancePolicies('{{REMOVED}}')/scheduledActionsForRule.

Status: 400 (BadRequest)
ErrorCode: No method match route template
Date: 2023-07-20T19:56:17

Headers:
Transfer-Encoding : chunked
Vary : Accept-Encoding
Strict-Transport-Security : max-age=31536000
request-id : {{REMOVED}}
client-request-id : {{REMOVED}}
x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"USGov Arizona","Slice":"E","Ring":"5","ScaleUnit":"001","RoleInstance":"PH1NEPF00008CC9"}}
Date : Thu, 20 Jul 2023 19:56:16 GMT

DEBUG: [CmdletEndProcessing]: - Get-MgDeviceManagementDeviceCompliancePolicyScheduledActionForRule end processing.

Module Version

Name : Microsoft.Graph.Authentication
Version : 2.1.0
Name : Microsoft.Graph.Beta.DeviceManagement
Version : 2.1.0
Name : Microsoft.Graph.Beta.Identity.DirectoryManagement
Version : 2.1.0
Name : Microsoft.Graph.Beta.Identity.SignIns
Version : 2.1.0
Name : Microsoft.Graph.DeviceManagement
Version : 2.1.0
Name : Microsoft.Graph.Groups
Version : 2.1.0
Name : Microsoft.Graph.Identity.DirectoryManagement
Version : 2.1.0
Name : Microsoft.Graph.Identity.SignIns
Version : 2.1.0
Name : Microsoft.Graph.Users
Version : 2.1.0

Environment Data

Name : PSVersion
Value : 7.3.4
Name : PSEdition
Value : Core
Name : GitCommitId
Value : 7.3.4
Name : OS
Value : Microsoft Windows 10.0.19045
Name : Platform
Value : Win32NT
Name : PSCompatibleVersions
Value : {1.0, 2.0, 3.0, 4.0…}
Name : PSRemotingProtocolVersion
Value : 2.3
Name : SerializationVersion
Value : 1.1.0.1
Name : WSManStackVersion
Value : 3.0

Screenshots

N/A

Additional context

Sorry if I got carried away with ID removals, but should be able to replicate in a GCCH tenant.

I am utilizing an App Reg to connect to Graph:
(Get-MgContext).scopes

Policy.ReadWrite.ConditionalAccess
User.ReadWrite.All
Policy.ReadWrite.AuthenticationFlows
Domain.ReadWrite.All
RoleManagementPolicy.ReadWrite.Directory
Application.ReadWrite.All
Directory.ReadWrite.All
Group.ReadWrite.All
DeviceManagementServiceConfig.ReadWrite.All
Organization.ReadWrite.All
DeviceManagementManagedDevices.ReadWrite.All
PrivilegedAccess.ReadWrite.AzureAD
InformationProtectionPolicy.Read.All
RoleManagement.ReadWrite.Directory
AuditLog.Read.All
Policy.Read.All
DeviceManagementConfiguration.ReadWrite.All
Application.Read.All
Policy.ReadWrite.Authorization
DeviceManagementApps.ReadWrite.All

@ghost ghost added the ToTriage label Jul 20, 2023
@peombwa
Copy link
Member

peombwa commented Jul 26, 2023

Thanks for following up on this.

This looks like an API issue as the official documented API path is GET /deviceManagement/deviceCompliancePolicies/{deviceCompliancePolicyId}/scheduledActionsForRule - https://learn.microsoft.com/graph/api/intune-deviceconfig-devicecompliancescheduledactionforrule-list?view=graph-rest-1.0&tabs=http.

Please open a question/ticket at https://developer.microsoft.com/graph/support to get assistance from API owner.

This repository is intended for issues related to the functionality of the SDK (bugs and feature requests). We may not be the best place to answer some queries that are tied to the functionality of the API or how to use an API.

@ghost
Copy link

ghost commented Jul 30, 2023

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@microsoft-github-policy-service
Copy link
Contributor

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@ghost ghost removed the no-recent-activity label Aug 3, 2023
@microsoft-github-policy-service
Copy link
Contributor

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@microsoft-github-policy-service
Copy link
Contributor

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

dannyKBjj added a commit to dannyKBjj/Microsoft365DSC that referenced this issue Jan 16, 2025
…ntuneDeviceCompliancePolicyAndroidWorkProfile

* IntuneDeviceCompliancePolicyAndroidDeviceOwner
  * Added missing properties for androidForWorkCompliancePolicy resource type: https://learn.microsoft.com/en-us/graph/api/resources/intune-deviceconfig-androiddeviceownercompliancepolicy?view=graph-rest-beta.
  * Non-compliance actions now supported for Export- Test- Get-
  * Non-compliance actions now supported for Set- when creating a policy, but not when updating a policy. Update can't be supported due to MgGraph bug.
    FIXES [microsoft#5593](microsoft#5593)
* IntuneDeviceCompliancePolicyAndroidWorkProfile
  * Added missing properties for androidForWorkCompliancePolicy resource type: https://learn.microsoft.com/en-us/graph/api/resources/intune-deviceconfig-androidforworkcompliancepolicy?view=graph-rest-beta.
  * Non-compliance actions now supported for Export- Test- Get-
  * Non-compliance actions now supported for Set- when creating a policy, but not when updating a policy. Update can't be supported due to MgGraph bug.
    FIXES [microsoft#5592](microsoft#5592)

Graph issue with Update- / PATCH
microsoftgraph/msgraph-sdk-powershell#2177
microsoftgraph/msgraph-metadata#245
dannyKBjj added a commit to dannyKBjj/Microsoft365DSC that referenced this issue Jan 16, 2025
…DeviceCompliancePolicyAndroidWorkProfile

* IntuneDeviceCompliancePolicyAndroidDeviceOwner
  * Added missing properties for androidForWorkCompliancePolicy resource type: https://learn.microsoft.com/en-us/graph/api/resources/intune-deviceconfig-androiddeviceownercompliancepolicy?view=graph-rest-beta.
  * Non-compliance actions now supported for Export- Test- Get-
  * Non-compliance actions now supported for Set- when creating a policy, but not when updating a policy. Update can't be supported due to MgGraph bug.
    FIXES [microsoft#5593](microsoft#5593)
* IntuneDeviceCompliancePolicyAndroidWorkProfile
  * Added missing properties for androidForWorkCompliancePolicy resource type: https://learn.microsoft.com/en-us/graph/api/resources/intune-deviceconfig-androidforworkcompliancepolicy?view=graph-rest-beta.
  * Non-compliance actions now supported for Export- Test- Get-
  * Non-compliance actions now supported for Set- when creating a policy, but not when updating a policy. Update can't be supported due to MgGraph bug.
    FIXES [microsoft#5592](microsoft#5592)

MgGraph issues:
microsoftgraph/msgraph-sdk-powershell#2177
microsoftgraph/msgraph-metadata#245
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants