State Configuration - Install PFX Certificate with password

Jessey Clarke 21 Reputation points
2022-12-15T16:57:08.67+00:00

Hi,

I am trying to use State Configuration (DSC) within the azure automation account to install a pfx certificate and apply it to iis.

I came across a script in the gallery for DSC (snippet below). The only part I cannot figure out or find information for is how to specify the pfx password and without it being in plain text

A snippet of the code

Configuration PfxImport_InstallPFX_Config
{
param
(
[Parameter(Mandatory = $true)]
[ValidateNotNullorEmpty()]
[System.Management.Automation.PSCredential]
$Credential
)

Import-DscResource -ModuleName CertificateDsc  

Node localhost  
{  
    PfxImport CompanyCert  
    {  
        Thumbprint = 'c81b94933420221a7ac004a90242d8b1d3e5070d'  
        Path       = '\\Server\Share\Certificates\CompanyCert.pfx'  
        Location   = 'LocalMachine'  
        Store      = 'My'  
        Credential = $Credential  
    }  
}  

}

Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,328 questions
0 comments No comments
{count} votes

Accepted answer
  1. tbgangav-MSFT 10,431 Reputation points
    2022-12-25T08:51:41.453+00:00
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.