mirror of
https://github.com/KelvinTegelaar/CIPP.git
synced 2026-04-25 16:26:09 +03:00
[GH-ISSUE #3932] [Bug]: NamedLocation doesnt get created in time in New-CIPPCAPolicy causing CA policy to fail unitl next run #1764
Labels
No labels
API
Feature
NotABug
NotABug
Planned
Sponsor Priority
Sponsor Priority
bug
documentation
duplicate
enhancement
needs more info
no-activity
no-priority
not-assigned
pull-request
react-conversion
react-conversion
roadmap
security
stale
unconfirmed-by-user
unconfirmed-by-user
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/CIPP#1764
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @nickfratangelo on GitHub (Apr 5, 2025).
Original GitHub issue: https://github.com/KelvinTegelaar/CIPP/issues/3932
Originally assigned to: @nickfratangelo on GitHub.
Required confirmations before submitting
Issue Description
This issue seems to only occur when your CA Template contains both a namedLocation Country code AND a namedLocation with IP ranges (trusted). I was able to duplicate this issue both in my live Azure tenant and then after spending a few hours setting up my dev environment i was able to duplicate the issue there as well.
I did extensive research in discord and found one other user who reported this exact issue back in 2023, but it was deemed that he had setup his CA template incorrectly. For me i followed the documentation and setup my CA policies on my test tenant then created a CA Policy Template from that live tenant
conditional-access-json.txt
I have attached a copy of the conditional access template with the IP addresses stripped out.
During this failed run of the CA Policy Template the namedLocations do get created but i believe the GraphPostRequest fires off the API call before the namedLocation has had a chance to complete. A second run of the Standard/CAPolicy then correctly detects the namedLocation's as being present and creates the CA policy as intended.
This issue may not be present in all tenants and i do note that Kelvin dismissed this other users comments in the discord as user error. If that is the case please feel free to notify me of my mistake. How-ever i have already gone ahead and made a fix (although its simple) that i am ready to push for review.
Environment Type
Non-sponsored user
Front End Version
7.4.2
Back End Version
7.4.2
Relevant Logs / Stack Trace
@github-actions[bot] commented on GitHub (Apr 5, 2025):
Thank you for reporting a potential bug. If you would like to work on this bug, please comment:
Thank you for helping us maintain the project!
@nickfratangelo commented on GitHub (Apr 5, 2025):
I would like to work on this please!
@github-actions[bot] commented on GitHub (Apr 5, 2025):
Great! I assigned you (@nickfratangelo) to the issue. Have fun working on it!
@nickfratangelo commented on GitHub (Apr 5, 2025):
Sorry for the sloppy git pushes. I submitted the first push using my work account by mistake.
@KelvinTegelaar commented on GitHub (Apr 13, 2025):
Resolved in dev