almenscorner / intunecd-monitor

IntuneCD front end, monitor configurations and changes in Intune
MIT License
92 stars 8 forks source link

[BUG] GIT Repo only works if applied on creation of tenant #41

Closed havard105 closed 5 months ago

havard105 commented 5 months ago

Hi!

Using GIT repos in IntuneCD Monitor only seems to work if the repo is added while adding a new tenant. Adding a repo and PAT after the tenant is added does not work and will result in the error "Could not clone repository". The logs do not give any meaningful insight to the issue.

On tenants where the GIT repo is configured and working properly, editing the GIT repo URL (in IntuneCD monitor) will break it, even if reverted to the previous setting. The tenant will have to be added again with repo and PAT to fix it.

Running on version 2.1.0.

Have you encountered this before, and do you know of a fix?

Thanks!

almenscorner commented 5 months ago

What is happening is that an entry for the tenant is created when creating the tenant and a repo is set, this creation in the key vault is not happening when editing a tenant. I can look into changing that behaviour.

As for current tenants editing the URL, are you also updating the PAT to make sure you have a PAT with access to the new repo?

almenscorner commented 5 months ago

Just tried changing a repo on an existing tenant and it works if I also update the PAT to a valid one for the repo

havard105 commented 5 months ago

Thank you, it seems the PAT needs to updated at the same time as the new repo, even if the previous PAT would have been valid.