Skip to content

Instantly share code, notes, and snippets.

View pharring's full-sized avatar

Paul Harrington pharring

View GitHub Profile
@pharring
pharring / SetCertificatePermissions.ps1
Created April 24, 2017 17:08
Powershell to grant NETWORK SERVICE Read access to the private key of a certificate
<#
.SYNOPSIS
Grants the NETWORK SERVICE read access to a certificate's private key.
.DESCRIPTION
In order for HTTPS to work in ASP.Net Core, an SSL certificate must be installed and readable by NETWORK SERVICE
account.
The SSL certificate is obtained from KeyVault and installed into the VM Scale Set by our ARM template. However,
the certificate is protected by a private key. The default permissions (ACLs) on the imported certificate are