Forum Discussion

Alex_Rechs's avatar
Alex_Rechs
Brass Contributor
Mar 17, 2023
Solved

Cert not found for Connect-MgGraph via Runbook Hybrid Worker

I use certificate to connect to Microsoft Graph and it works fine in runbooks azure instance. However, when I perform  Connect-MgGraph -CertificateThumbprint <certThumbprint>-ClientID "<clientID>" -...
  • LainRobertson's avatar
    LainRobertson
    Mar 18, 2023

    Alex_Rechs 

     

    I know nothing about the Azure Hybrid Runbook Worker.

     

    I've just had a quick read of the following article just to get an overview of it - which hardly makes me knowledgeable on the topic, but it does provide some useful information to even someone in my position. Notably that:

     

    • If you're using the "User run as credentials" option, then your certificate will need to live either within the crypto store of that user's profile on the server running the runbook agent (if you wish to use the -CertificateThumbprint or -CertificateName parameters) or within the LocalMachine crypto store (if you use the -Certificate parameter) on that same server;
    • The Windows Service name appears to be "Azure Hybrid Instance Metadata Service".

     

    Reference article:

     

    This topic isn't really about PowerShell but rather the hybrid runbook worker's configuration. You might want to ask about it in one of the Azure-centric forums as well.

     

    Once the correct certificate is positioned in the correct store or you switch to using the third example from the earlier example where you load the certificate separately before using it in the Connect-MgGraph call (using the -Certificate parameter, not -CertificateThumbprint or Name), the error should be resolved.

     

    Cheers,

    Lain

Resources