ESC
Type to search...

DeviceTemplate.Create

Export JSON
Export CSV
Copy URL
Print
ApplicationDelegated Read User Scope

Allows the app to create device templates. The app is marked as owner of the created device template. As a member of owners, the app will be allowed to manage devices created from the template.

Permission data: April 6, 2026 at 4:06 AM UTC
Delegated Access App-Only Access

Permission Details

Application Permission

Create device template

Allows the app to create device templates. The app is marked as owner of the created device template. As a member of owners, the app will be allowed to manage devices created from the template.

Delegated Permission Admin consent required

Create device templates

Allows the app to create device templates on behalf of the signed in user. The user is marked as owners of the created device template. As a member of owners, the user will be allowed to manage devices created from the template.

Properties

Microsoft Graph beta exact-category-docs

Properties is shown from beta metadata because a stable v1.0 schema is not available for this resource mapping.

Property Type Description
deletedDateTime DateTimeOffsetNullable Date and time when this object was deleted. Always null when the object hasn't been deleted. Inherited from directoryObject.
deviceAuthority StringNullable A tenant-defined name for the party that's responsible for provisioning and managing devices on the Microsoft Entra tenant. For example, Tailwind Traders (the manufacturer) makes security cameras that are installed in customer buildings and managed by Lakeshore Retail (the device authority). This value is provided to the customer by the device authority (manufacturer or reseller).
id String The unique identifier for the object. Inherited from directoryObject. Read-only. Supports $filter (eq, in).
manufacturer StringNullable Manufacturer name.
model StringNullable Model name.
mutualTlsOauthConfigurationId StringNullable Object ID of the mutualTlsOauthConfiguration. This value isn't required if self-signed certificates are used. This value is provided to the customer by the device authority (manufacturer or reseller).
mutualTlsOauthConfigurationTenantId StringNullable ID (tenant ID for device authority) of the tenant that contains the mutualTlsOauthConfiguration. This value isn't required if self-signed certificates are used. This value is provided to the customer by the device authority (manufacturer or reseller).
operatingSystem StringNullable Operating system type. Supports $filter (eq, in).
deviceInstances device collection Collection of device objects created based on this template.
owners directoryObject collection Collection of directory objects that can manage the device template and the related deviceInstances. Owners can be represented as service principals, users, or applications. An owner has full privileges over the device template and doesn't require other administrator roles to create, update, or delete devices from this template, as well as to add or remove template owners. There can be a maximum of 100 owners on a device template. Supports $expand.

JSON Representation

Microsoft Graph beta exact-category-docs

JSON representation is shown from beta metadata because a stable v1.0 schema is not available for this resource mapping.

JSON representation
{
  "@odata.type": "#microsoft.graph.deviceTemplate",
  "deletedDateTime": "String (timestamp)",
  "deviceAuthority": "String",
  "id": "String (identifier)",
  "manufacturer": "String",
  "model": "String",
  "mutualTlsOauthConfigurationId": "String",
  "mutualTlsOauthConfigurationTenantId": "String",
  "operatingSystem": "String"
}

Relationships

Microsoft Graph beta exact-category-docs

Relationships is shown from beta metadata because a stable v1.0 schema is not available for this resource mapping.

Relationship Type Description
deviceInstances device collection Collection of device objects created based on this template.
owners directoryObject collection Collection of directory objects that can manage the device template and the related deviceInstances. Owners can be represented as service principals, users, or applications. An owner has full privileges over the device template and doesn't require other administrator roles to create, update, or delete devices from this template, as well as to add or remove template owners. There can be a maximum of 100 owners on a device template. , , Supports $expand.

Graph Methods

Delegated access App-only access
Exact Microsoft Learn match

Microsoft Graph v1.0 endpoints are mapped directly from refreshed Microsoft Learn permissions tables.

No API methods available for this version.

Exact Microsoft Learn match

Microsoft Graph beta endpoints are mapped directly from refreshed Microsoft Learn permissions tables.

Methods
POST /directory/templates/deviceTemplates
Exact Microsoft Learn PowerShell match

Microsoft Graph PowerShell v1.0 commands are mapped directly from refreshed Microsoft Learn PowerShell snippets.

No deterministic PowerShell command map is available for this permission.

Browse PowerShell docs
Exact Microsoft Learn PowerShell match

Microsoft Graph PowerShell beta commands are mapped directly from refreshed Microsoft Learn PowerShell snippets.

Commands
New-MgBetaDirectoryTemplateDeviceTemplate /directory/templates/deviceTemplates
Create deviceTemplate

Code Examples

C# / .NET SDK
Create deviceTemplate
// Code snippets are only available for the latest version. Current version is 5.x

// Dependencies
using Microsoft.Graph.Beta.Models;

var requestBody = new DeviceTemplate
{
	MutualTlsOauthConfigurationId = "00001111-aaaa-2222-bbbb-3333cccc4444",
	MutualTlsOauthConfigurationTenantId = "00001111-aaaa-2222-bbbb-3333cccc4445",
	DeviceAuthority = "Lakeshore Retail",
	Manufacturer = "Tailwind Traders",
	Model = "DeepFreezerModelAB",
	OperatingSystem = "WindowsIoT",
};

// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Directory.Templates.DeviceTemplates.PostAsync(requestBody);
JavaScript
Create deviceTemplate
const options = {
	authProvider,
};

const client = Client.init(options);

const deviceTemplate = {
  mutualTlsOauthConfigurationId: '00001111-aaaa-2222-bbbb-3333cccc4444',
  mutualTlsOauthConfigurationTenantId: '00001111-aaaa-2222-bbbb-3333cccc4445',
  deviceAuthority: 'Lakeshore Retail',
  manufacturer: 'Tailwind Traders',
  model: 'DeepFreezerModelAB',
  operatingSystem: 'WindowsIoT'
};

await client.api('/directory/templates/deviceTemplates')
	.version('beta')
	.post(deviceTemplate);
PowerShell
Create deviceTemplate
Import-Module Microsoft.Graph.Beta.Identity.DirectoryManagement

$params = @{
	mutualTlsOauthConfigurationId = "00001111-aaaa-2222-bbbb-3333cccc4444"
	mutualTlsOauthConfigurationTenantId = "00001111-aaaa-2222-bbbb-3333cccc4445"
	deviceAuthority = "Lakeshore Retail"
	manufacturer = "Tailwind Traders"
	model = "DeepFreezerModelAB"
	operatingSystem = "WindowsIoT"
}

New-MgBetaDirectoryTemplateDeviceTemplate -BodyParameter $params
Python
Create deviceTemplate
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.device_template import DeviceTemplate
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = DeviceTemplate(
	mutual_tls_oauth_configuration_id = "00001111-aaaa-2222-bbbb-3333cccc4444",
	mutual_tls_oauth_configuration_tenant_id = "00001111-aaaa-2222-bbbb-3333cccc4445",
	device_authority = "Lakeshore Retail",
	manufacturer = "Tailwind Traders",
	model = "DeepFreezerModelAB",
	operating_system = "WindowsIoT",
)

result = await graph_client.directory.templates.device_templates.post(request_body)

App Registration

1

Navigate to Azure Portal

Go to App registrations in Microsoft Entra admin center

2

Add API Permission

Select your app → API permissions → Add a permission → Microsoft Graph

3

Select Permission Type

Choose Application permissions or delegated permissions and search for DeviceTemplate.Create

4

Grant Admin Consent

Application permissions always require admin consent.