Error Reading certificate file

Sometimes, DSC will get “upset” with the certificate I use for credential encryption for my configs. It will work for some configs and not for others, restart ISE and it starts working again. I check the path of the error and the file can be read and loaded into an X509Certificate object.

ConvertTo-MOFInstance : System.InvalidOperationException error processing property 'Password' OF TYPE 'MSFT_Credential': Error Reading certificate file \\dscpullserver\Certificates$\NODE.cer.

Should I not be storing my certificates on a share and keep them local to the DSC build server and my “dev” workstation?

It would be best to have copies of the certificates stored locally on the server where you’re compiling the MOFs, just to avoid those occasional networking / file sharing hiccups that you’re seeing. (Ideally, these certificates would be stored in source control along with your configurations / resources, and local copies would be checked out by you or by an automated build server when the MOFs are about to be compiled.)

Thanks, I refactored the config to use a folder in the local repo via an environment variable. This seems to be working consistently so far.