tmaestrini / easyGovernance

governance and validation for configuration baselines in M365 – made as easy as possible
MIT License
11 stars 4 forks source link

Baseline `M365.1-1.1` errors #40

Open sympmarc opened 1 week ago

sympmarc commented 1 week ago

When validating with baseline M365.1-1.1, consistent errors for parameter checks. This is after successful connections. image

tmaestrini commented 1 week ago

I think this error is connected to #39

sympmarc commented 1 week ago

Agreed. I just wanted to record it separately.

I'm debugging, and if I stop at the connection line and just retry until it works (maybe 1 / 10 tries), then I can proceed.

I've introduced a retry in M365AdminCenter.psm1, which helps, but doesn't solve the problem - yet.

        try {
            # $path = ($req.path) -replace "{{tenantId}}", $tenantId
            $path = "https://admin.microsoft.com/$($req.path)"
            $method = $($req.method) ? $req.method : "GET"
            $result = Invoke-RestMethod -Uri $path -Headers $headers -Method "$($method)" -RetryIntervalSec 5
            $propertiesValues | Add-Member -MemberType NoteProperty -Name $req.name -Value ($req.attr ? $result.$($req.attr) : $result)
        }