MigrationTable failure

Open
#97 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

Research direction

Start in Extensions/MSGraph.psm1 around line 2108 and trace how MigrationTable files are generated and consumed during export and import. Compare the Conditional Access path with Settings Catalog and Endpoint Security, then reproduce the MS Graph createInstance failure and missing JSON file error. Done means the affected policy exports produce the required migration data and import without these errors.

Written by the indexing model from the issue text.

Description

As I want to have an template of policys from a demo tenant I apply to loads of different tenants I use the import export feature a lot.

Then I export Conditional Access rules, it always create an MigrationTable. But then I export Settings Catalog or Endpoint Security policys it doesnt create an MigrationTable.
I have tried manually creating a MigrationTable which matches the one from the Conditional Access export.
Which does make it import some of the rules, but not all of them.
The rest fails with:

Failed to invoke MS Graph with URL https://graph.microsoft.com/beta/deviceManagement/templates//createInstance (Request ID: XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXX). Status code: BadRequest

Get-Item : Could not find item C:\M365 - Defender Endpoint Protection\JSON\Endpoint Security Section\Conecto Ba
seline Security Windows - Defender ASR.json.
At C:\VSCode\IntuneManagement\Extensions\MSGraph.psm1:2108 char:23
+     foreach($file in (Get-Item -path "$path\*.json" @params))
+                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\Users\***\On...le content.json:String) [Get-Item], IOException
    + FullyQualifiedErrorId : ItemNotFound,Microsoft.PowerShell.Commands.GetItemCommand
Dominant language
PowerShell
Stars
2.1k
Forks
377
PR merge metrics
No merged PRs in 30d

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.

More from Micke-K/IntuneManagement

All issues in Micke-K/IntuneManagement

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.