microsoftgraph / microsoftgraph/msgraph-sdk-powershell
Broken Absolute URI referenced by New-MGBetaDeviceManagementconfigurationPolicyAssignment
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 898
- Forks
- 230
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 31
Description
Describe the bug
I am from Microsoft internal team and recently came across a broken reference of the absolute URI with the New-MgBetaDevicemanagementConfigurationPolicyAssignment PS cmdlet. The PS cmdlet is running into a HTTP 400 error and the same absolute URI that is referenced by this cmd is returning HTTP 400 on Graph-
Absolute URI pointed by the PS command - /deviceManagement/configurationPolicies/{deviceManagementConfigurationPolicy-id}/assignments - Same URI returns HTTP 400 on Graph also
After capturing the network trace on the Intune portal we received the correct URI which returns HTTP 200 on Graph- Correct URI - https://graph.microsoft.com/beta/deviceManagement/configurationPolicies('')/assign
While we already have the workaround script with Invoke-MgGraphRequest and using the correct URI, there is still this bug with this PS cmdlet that customers might want to use to ensure uniformity across their script.
Expected behavior
PS cmdlet should point to the correct URI and give HTTP 200 as per the MS docs.
How to reproduce
- Execute New-MGBetaDeviceManagementconfigurationPolicyAssignment command with appropriate permissions.
- Returns HTTP 400 on PS command as well as on Graph (with the URI referenced by this cmd)
SDK Version
No response
Latest version known to work for scenario above?
No response
Known Workarounds
Invoke-MgGraphRequest can be used as a workaround.
Debug output
Click to expand log
```</details>
### Configuration
_No response_
### Other information
_No response_
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing New-MGBetaDeviceManagementconfigurationPolicyAssignment and compare its referenced URI with the working Graph URI from the issue. Trace where the cmdlet constructs that request; done when it uses the corrected /assign URI and returns HTTP 200 instead of HTTP 400.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, powershell
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100