Microsoft Cloud PKI is a modern approach to certificate management, done directly from the Microsoft Intune admin portal (or programmatically with Graph APIs) without any complex on-premises infrastructure. It allows you to create both root and issuing Certificate Authorities from the cloud, which are private to you. Device configuration profiles can then automatically deploy certificates to end user devices for authentication scenarios such as WiFi, VPN, Code Signing and much more.
In this blog post, I will show you how to deploy Microsoft Cloud PKI infrastructure in Microsoft Intune using both the web portal and Microsoft Graph PowerShell to issue certificates to end devices.
Page Contents
Prerequisites
Before you get started, ensure you meet all the prerequisites to deploy Cloud PKI in your environment using Microsoft Intune.
Licensing
Cloud PKI comes as part of the Intune Suite licensing package. As such, you must ensure that any users who stand to benefit from the Microsoft Cloud PKI have an Intune Suite license assigned.
Permissions
To access all of the necessary functionality to deploy PKI infrastructure with Microsoft Intune, you must have at least the Intune Administrator role if you are not using custom roles.
If you use Microsoft Graph PowerShell, the following permission must be consented to your application: DeviceManagementConfiguration.ReadWrite.All, this will enable you to create Configuration Profiles. As for permissions to create CAs, the Graph API is currently bugged and will allow you to create CAs without any permissions assigned.
Benefits of Cloud PKI
- Heavily removes the complexity of PKI deployments in general.
- Removes the need for complex NDES deployments.
- Move from capital expenditure to an operational expenditure model.
- Natural upgrade path to the cloud.
- Supports the Intune SCEP certificate profile, which includes Windows, IOS, iPadOS, Android, and MacOS, but not Linux.
- It can be obtained through the Intune Suite for additional functionality or the sole PKI add-on license.
- Root and Intermediate CA certificates can be exported for third-party services.
- The CA keys are HSM-backed.
- Cloud PKI is co-located in the same geo-region as the Intune tenant with redundancy built-in.
- Issued certificates are automatically replaced (not directly renewed) through the SCEP certificate profile.
- Issued certificates can be manually revoked through the portal.
Cost analysis, is it worth it?
One of the core difficulties in adopting the Intune Suite is the price. At £8.20 on a yearly commitment or £9.84 for a monthly rolling contract, 3rd party solutions, while not offering the same ease of use and functionality, tend to win on price alone.
Factoring out on-premise solutions for a moment (due to an evident economy of scale and assumed hardware and labour costs), the best competitor is SCEPman, offering a fixed product price of 1 euro per user per month for up to 200 users for their cloud CA services. Then, there is an evident economy of scale after that, with 3625 users costing a reduced total of 1000 euros per month.
Comparing this to Cloud PKI, which scales up indefinitely at the same rate, the price is incomparable. Right now, the product is bundled with the Intune Suite license, which has many other benefits and becomes attractive if all of the features are adopted. Assuming the price of standalone Cloud PKI (which has not been released) is $2 per user per month. Immediately, this is $400 per month for 200 users and $7250 per month for 3625 users (roughly 6680 euros).
The only accurate way to evaluate the financial value of Cloud PKI is to perform a total cost of ownership exercise against your existing products and the Intune Suite. However, this is already a hard sell for new customers fully invested in the Microsoft suite of products. Tools like https://transform.microsoft.com/ can help you on this journey.
Creating a new Root CA
1. Log in to https://intune.microsoft.com.
2. Navigate to the Tenant Administration page, then click Cloud PKI > Create.
3. Define a name for your Root CA. I will choose OurCloudNetworkRootCA, then click Next.
4. Configure the CA type as Root CA, then define a validity period as required. I recommend choosing 10 years. However, different providers recommended different validity periods.
Also, under Extended Key Usages, define all the usages that you may need in your Issuing CA, as you cannot return to modify these properties.
5. For the Subject attributes, it is good practise to fill this out accurately.
6. Lastly, choose the highest encryption option for the best protection under the Encryption settings. While is traditional deployments, setting a higher algorithm may have significant security and capability implications, this is not so much a worry with Cloud PKI. Click Next through the final pages, then click Create.
Creating a new Root CA with PowerShell
You can deploy your Cloud PKI Root CA using Microsoft Graph PowerShell. The below code will deploy a Root CA using the settings I have defined above. Before deploying with PowerShell, you must modify the relevant names, algorithms and Extended Key Usages to meet your needs.
Connect-MgGraph -scope DeviceManagementConfiguration.ReadWrite.All
$body = @{
commonName = "Our Cloud Network RootCA"
displayName = "OurCloudNetworkRootCA"
cloudCertificationAuthorityType = "rootCertificationAuthority"
certificationAuthorityIssuerId = $null
validityPeriodInYears = 10
certificateKeySize = "rsa4096"
cloudCertificationAuthorityHashingAlgorithm = "sha512"
organizationName = "Our Cloud Network"
organizationUnit = "IT"
countryName = "UK"
stateName = "Kent"
localityName = "GB"
roleScopeTagIds = @(
"0"
)
extendedKeyUsages = @(
@{
name = "Server auth"
objectIdentifier = "1.3.6.1.5.5.7.3.1"
}
@{
name = "Client auth"
objectIdentifier = "1.3.6.1.5.5.7.3.2"
}
@{
name = "Code signing"
objectIdentifier = "1.3.6.1.5.5.7.3.3"
}
)
}
Invoke-MgGraphRequest -Method POST `
-Uri "/beta/deviceManagement/cloudCertificationAuthority" `
-Body $body `
-ContentType "application/json" Below is a list of Object Identifiers for the supported Extended Key Usages in Cloud PKI.
- Server auth (1.3.6.1.5.5.7.3.1)
- Client auth (1.3.6.1.5.5.7.3.2)
- Code signing (1.3.6.1.5.5.7.3.3)
- Email protection (1.3.6.1.5.5.7.3.4)
- IPSEC end system (1.3.6.1.5.5.7.3.5)
- IPSEC tunnel (1.3.6.1.5.5.7.3.6)
- IPSEC user (1.3.6.1.5.5.7.3.7)
- Time stamping (1.3.6.1.5.5.7.3.8)
- OCSP signing (1.3.6.1.5.5.7.3.9)
- Smartcard logon (1.3.6.1.4.1.311.20.2.2)
- Mac address (1.3.6.1.1.1.1.22)
Creating a new Issuing CA
Now you have deployed your Root CA, you can create a new Issuing CA. Follow the below steps to create your Issuing CA.
2. Define the name of the Issuing CA, I have chosen OurCloudNetworkIssuingCA and click Next.
3. For the CA type, select Issuing CA. You will then need to choose the Root CA. First select Intune for the Root CA source and select your Root CA from the list. Also select a Validity period, as good practise, I have selected 2 years.
4. Select the certificate types you wish to issue under Extended Key Usages. I have matched this with my Root CA.
5. Complete all the Subject attributes similar to how you did for the Root CA, ensuring you modify the Common name.
6. Lastly, you can see the Encryption settings for the Issuing CA have been inherited from the Root CA. Click Next through the final pages, then click Create.
Creating a new Issuing CA with PowerShell
Like our Root CA, you can create your Issuing CA using Microsoft Graph PowerShell with the following code. Again, ensure you modify the settings to match your requirements.
$body = @{
commonName = "Our Cloud Network Issuing CA"
displayName = "OurCloudNetworkIssuingCA"
cloudCertificationAuthorityType = "issuingCertificationAuthority"
certificationAuthorityIssuerId = "e95d737f-ab0d-401f-9b4b-aaf76bed80e5"
validityPeriodInYears = 2
certificateKeySize = "rsa4096"
cloudCertificationAuthorityHashingAlgorithm = "sha512"
organizationName = "Our Cloud Network"
organizationUnit = "IT"
countryName = "UK"
stateName = "Kent"
localityName = "GB"
roleScopeTagIds = @(
"0"
)
extendedKeyUsages = @(
@{
name = "Server auth"
objectIdentifier = "1.3.6.1.5.5.7.3.1"
}
@{
name = "Client auth"
objectIdentifier = "1.3.6.1.5.5.7.3.2"
}
@{
name = "Code signing"
objectIdentifier = "1.3.6.1.5.5.7.3.3"
}
)
}
Invoke-MgGraphRequest -Method POST `
-Uri "/beta/deviceManagement/cloudCertificationAuthority" `
-Body $body `
-ContentType "application/json" Download and deploy the CA certificates
Before we start issuing certificates to devices, we must download the Root and Issuing CA certificates and then create device configuration profiles to deploy them to our devices. Follow the below headings to complete the configuration.
The first step is to download the CA certificates, which must be uploaded to the client devices Trusted Root and Intermediate certificate stores. To do this, navigate to your CAs in the Intune admin portal, then on the properties tab, click the Download button and ensure you save the certificates somewhere safe.
Now follow the below steps to create a configuration profile to deploy the certificates:
1. In the Intune Admin Center, navigate to Devices > Configuration > Create > New policy.
2. Select Windows 10 and later > Templates, then choose the Trusted certificate template from the list and click Create.
3. Define a name for the policy and click Next. (I have chosen ‘Deploy Issuing CA‘)
4. Select the Intermediate certificate you downloaded and set the Destination store to Computer certificate store – Intermediate, then click Next.
5. On the Assignments tab, select a target group for deployment. I recommend creating a pilot group for testing. I have created a new group called Cloud PKI Devices, which includes a handful of managed devices.
6. Complete the final pages of the wizard and click Create.
7. Complete these steps again for the Root CA Certificate, but this time for the Destination store, select Computer certificate store – Root.
Download and deploy the CA certificates with PowerShell
This whole step can be automated with the following PowerShell function. Just modify the name of the CA, Group ID and PolicyName when executing the function, and it will automatically grab the encoded base64 certificate, create a new device configuration profile and assign it to your group.
Function DeployCloudPKICA (){
<#
.Author
Name: Daniel Bradley
LinkedIn: https://www.linkedin.com/in/danielbradley2/
Blog: https://ourcloudnetwork.com
.Example
DeployCloudPKICA -CA "OurCloudNetworkIssuingCA" -Groupid "5d91d8ee-a40c-45f0-be1d-d5684e636ce6" -PolicyName "Deploy Issuing CA"
#>
param(
$CA,
$Groupid,
$PolicyName
)
#Obtain CA information
$uri = "https://graph.microsoft.com/beta/deviceManagement/cloudCertificationAuthority?`$filter=displayname eq '$CA'"
$CAInfo = Invoke-MgGraphRequest -Method GET -Uri $uri
#Extract Base64 cert
[regex]$regex = '(?<=data:application/x-x509-ca-cert;base64,).*$'
$Cert = $regex.Matches($CAInfo.value.certificateDownloadUrl) | foreach-object {$_.Value}
#Create policy
Write-Output "creating policy for $($CAInfo.value.commonname)"
$body = @{
id = "00000000-0000-0000-0000-000000000000"
displayName = "$PolicyName"
roleScopeTagIds = @(
"0"
)
"@odata.type" = "#microsoft.graph.windows81TrustedRootCertificate"
destinationStore = "computerCertStoreIntermediate"
certFileName = "$($CAInfo.value.commonname).cer"
trustedRootCertificate = $Cert
}
$RootCAProfile = Invoke-MgGraphRequest -Method POST `
-Uri "/beta/deviceManagement/deviceConfigurations" `
-Body $body `
-ContentType "application/json"
#Assign policy to group ID
Write-Output "Assigning $($CAInfo.value.commonname) to $($groupid)"
$AssignBody = @{
assignments = @(
@{
target = @{
"@odata.type" = "#microsoft.graph.groupAssignmentTarget"
groupId = "$groupid"
}
}
)
}
Invoke-MgGraphRequest -Method POST `
-Uri "/beta/deviceManagement/deviceConfigurations/$($RootCAProfile.id)/assign" `
-Body $AssignBody `
-ContentType "application/json"
}
DeployCloudPKICA -CA "OurCloudNetworkRootCA" -Groupid "5d91d8ee-a40c-45f0-be1d-d5684e636ce6" -PolicyName "Deploy Root CA"
DeployCloudPKICA -CA "OurCloudNetworkIssuingCA" -Groupid "5d91d8ee-a40c-45f0-be1d-d5684e636ce6" -PolicyName "Deploy Issuing CA" Issuing certificates to devices
Now you are ready to issue certificates to our end users. This is done with Device Configuration Profiles using the SCEP certificate template. Follow the below steps to deploy certificated to end user in Intune.
1. In the Intune Admin Center, navigate to Devices > Configuration > Create > New policy.
2. Select Windows 10 and later > Templates, then choose the SCEP certificate template from the list and click Create.
3. Define a name for the policy and click Next. I have chosen ‘SCEP Certificate – Client Auth‘.
4. On the Configuration settings page, I will use the following settings:
- Certificate Type: User
- Subject name format: Leave as the default
- Subject alternative name: Leave as the default
- Certificate validity period: 1 year (default)
- Key storage provider: Software KSP (Only this option can be chosen if you set the key size to 4096).
- Key usage: Digital signature & Key encipherment
- Key size (bits): 4096
- Hash algorithm: SHA-2
5. Click + Root Certificate and select your Issuing CA from the list. Note: this list will show you a list of the CA’s deployed through configuration profiles, not from the Cloud PKI list under Tenant administration.
6. Select Client Authentication from the Predefined values drop-down box under Extended key usage.
7. Under Enrollment Settings, leave the Renewal threshold at default (20%), then copy and paste the SCEP Server URL from your Issuing CA and click Next.
Obtain the SCEP URL from Tenant administration > Cloud PKI > Select the Issuing CA > Properties > SCEP URI.
8. On the Assignments tab, assign this policy to your target device group (likely the same group as before), then continue to finish creating the policy.
Deploy SCEP profiles automatically with PowerShell
While a bit tricker, SCEP profiles can be automatically deployed using Microsoft Graph PowerShell. Ensure you define the variables at the start of the script below then let it do the rest of the work for you!
#Define these variables
$CA = "OurCloudNetworkIssuingCA"
$Groupid = "5d91d8ee-a40c-45f0-be1d-d5684e636ce6"
$TrustedCertificateRootProfileName = "Deploy Root CA"
#Get CA Info and Trust Root Certificate deployment profile info
$CAuri = "https://graph.microsoft.com/beta/deviceManagement/cloudCertificationAuthority?`$filter=displayname eq '$CA'"
$CAInfo = Invoke-MgGraphRequest -Method GET -Uri $CAuri
$ProfileUri = "https://graph.microsoft.com/beta/deviceManagement/deviceConfigurations?`$filter=displayName eq '$TrustedCertificateRootProfileName'"
$ProfileInfo = Invoke-MgGraphRequest -Method GET -Uri $ProfileUri
$body = @{
id = "00000000-0000-0000-0000-000000000000"
displayName = "Deploy SCEP Certificate"
roleScopeTagIds = @(
"0"
)
"@odata.type" = "#microsoft.graph.windows81SCEPCertificateProfile"
renewalThresholdPercentage = 20
certificateStore = "user"
certificateValidityPeriodScale = "years"
certificateValidityPeriodValue = 1
subjectNameFormat = "custom"
subjectNameFormatString = "CN={{UserName}},E={{EmailAddress}}"
keyStorageProvider = "useSoftwareKsp"
keyUsage = "digitalSignature,keyEncipherment"
keySize = "size4096"
hashAlgorithm = "sha2"
extendedKeyUsages = @(
@{
name = "Client Authentication"
objectIdentifier = "1.3.6.1.5.5.7.3.2"
}
)
scepServerUrls = @(
"$($CAInfo.Value.ScepServerUrl)"
)
"[email protected]" = "https://graph.microsoft.com/beta/deviceManagement/deviceConfigurations('$($ProfileInfo.value.id)')"
}
#Create Profile
$SCEPProfile = Invoke-MgGraphRequest -Method POST `
-Uri "/beta/deviceManagement/deviceConfigurations/" `
-Body $Body `
-ContentType "application/json"
#Assign Profile
$AssignBody = @{
assignments = @(
@{
target = @{
"@odata.type" = "#microsoft.graph.groupAssignmentTarget"
groupId = "$groupid"
}
}
)
}
Invoke-MgGraphRequest -Method POST `
-Uri "/beta/deviceManagement/deviceConfigurations/$($SCEPProfile.id)/assign" `
-Body $AssignBody `
-ContentType "application/json" Verifying a successful deployment
While the aim of this post is not to deploy certificates in any specific scenario, we can still ensure the certificates we pushed are successfully deployed to our end user devices as well as ensure the certificate status is OK.
Log into a client system and open the Manage user certificates control panel tool from Windows search.
Expand Intermediate Certification Authorities, then Certificates. You should see your Issuing certificate listed.
Then expand Trusted Root Certification Authorities, then Certificates, you should also see your Root certificate listed.
Finally, click on the Personal folder and select Certificates. Here, you should see your certificate issued from the Cloud PKI. Double-click it and view the Certification Path tab. You should see the full path listed and the Certificate status as OK here.
F.A.Q
How do I delete a Cloud PKI CA?
You can delete a Cloud PKI CA using the Intune admin portal or Microsoft Graph PowerShell, see How to delete Cloud PKI CAs in Microsoft Intune for the step-by-step process.
When does Cloud PKI become fully available?
Cloud PKI will be fully accessible by March 1st.
Can you fully replace on-premise PKI with Cloud PKI?
You can significantly simplify and reduce the workload associated with your private (on-premises) PKI but not fully replace it yet.
Can you implement Cloud PKI cross-tenant?
When you create a Root CA in Cloud PKI, this is private to your tenant. You cannot sign your issuing CA certificate from a Root CA in another tenant, but you can sign it from your on-premises CA.
Can I use this to replace existing on-premise RADIUS for WiFi authentication?
No. Cloud PKI is not a RADIUS service. There is no known information to suggest Microsoft is implementing a cloud-based RADIUS service.


Thank you for the helpful article. I am exploring Cloud PKI for 802.1x WLAN and curious about options for the RADIUS component. This is probably a very silly question but can an existing on-prem RADIUS remain in use, such as our NPS server?
Thank you!, yes, in the BYOCA scenario, but not when using Entra ID Join and Cloud PKI only.