1. Packages
  2. Azure Active Directory (Azure AD)
  3. API Docs
  4. ClaimsMappingPolicy
Azure Active Directory (Azure AD) v6.4.0 published on Monday, Apr 7, 2025 by Pulumi

azuread.ClaimsMappingPolicy

Explore with Pulumi AI

Manages a Claims Mapping Policy within Azure Active Directory.

API Permissions

The following API permissions are required in order to use this resource.

When authenticated with a service principal, this resource requires the following application roles: Policy.ReadWrite.ApplicationConfiguration and Policy.Read.All

When authenticated with a user principal, this resource requires one of the following directory roles: Application Administrator or Global Administrator

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azuread from "@pulumi/azuread";

const myPolicy = new azuread.ClaimsMappingPolicy("my_policy", {
    definitions: [JSON.stringify({
        claimsMappingPolicy: {
            claimsSchema: [
                {
                    ID: "employeeid",
                    jwtClaimType: "name",
                    samlClaimType: "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name",
                    source: "user",
                },
                {
                    ID: "tenantcountry",
                    jwtClaimType: "country",
                    samlClaimType: "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/country",
                    source: "company",
                },
            ],
            includeBasicClaimSet: "true",
            version: 1,
        },
    })],
    displayName: "My Policy",
});
Copy
import pulumi
import json
import pulumi_azuread as azuread

my_policy = azuread.ClaimsMappingPolicy("my_policy",
    definitions=[json.dumps({
        "claimsMappingPolicy": {
            "claimsSchema": [
                {
                    "ID": "employeeid",
                    "jwtClaimType": "name",
                    "samlClaimType": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name",
                    "source": "user",
                },
                {
                    "ID": "tenantcountry",
                    "jwtClaimType": "country",
                    "samlClaimType": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/country",
                    "source": "company",
                },
            ],
            "includeBasicClaimSet": "true",
            "version": 1,
        },
    })],
    display_name="My Policy")
Copy
package main

import (
	"encoding/json"

	"github.com/pulumi/pulumi-azuread/sdk/v6/go/azuread"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		tmpJSON0, err := json.Marshal(map[string]interface{}{
			"claimsMappingPolicy": map[string]interface{}{
				"claimsSchema": []map[string]interface{}{
					map[string]interface{}{
						"ID":            "employeeid",
						"jwtClaimType":  "name",
						"samlClaimType": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name",
						"source":        "user",
					},
					map[string]interface{}{
						"ID":            "tenantcountry",
						"jwtClaimType":  "country",
						"samlClaimType": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/country",
						"source":        "company",
					},
				},
				"includeBasicClaimSet": "true",
				"version":              1,
			},
		})
		if err != nil {
			return err
		}
		json0 := string(tmpJSON0)
		_, err = azuread.NewClaimsMappingPolicy(ctx, "my_policy", &azuread.ClaimsMappingPolicyArgs{
			Definitions: pulumi.StringArray{
				pulumi.String(json0),
			},
			DisplayName: pulumi.String("My Policy"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using AzureAD = Pulumi.AzureAD;

return await Deployment.RunAsync(() => 
{
    var myPolicy = new AzureAD.ClaimsMappingPolicy("my_policy", new()
    {
        Definitions = new[]
        {
            JsonSerializer.Serialize(new Dictionary<string, object?>
            {
                ["claimsMappingPolicy"] = new Dictionary<string, object?>
                {
                    ["claimsSchema"] = new[]
                    {
                        new Dictionary<string, object?>
                        {
                            ["ID"] = "employeeid",
                            ["jwtClaimType"] = "name",
                            ["samlClaimType"] = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name",
                            ["source"] = "user",
                        },
                        new Dictionary<string, object?>
                        {
                            ["ID"] = "tenantcountry",
                            ["jwtClaimType"] = "country",
                            ["samlClaimType"] = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/country",
                            ["source"] = "company",
                        },
                    },
                    ["includeBasicClaimSet"] = "true",
                    ["version"] = 1,
                },
            }),
        },
        DisplayName = "My Policy",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azuread.ClaimsMappingPolicy;
import com.pulumi.azuread.ClaimsMappingPolicyArgs;
import static com.pulumi.codegen.internal.Serialization.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var myPolicy = new ClaimsMappingPolicy("myPolicy", ClaimsMappingPolicyArgs.builder()
            .definitions(serializeJson(
                jsonObject(
                    jsonProperty("claimsMappingPolicy", jsonObject(
                        jsonProperty("claimsSchema", jsonArray(
                            jsonObject(
                                jsonProperty("ID", "employeeid"),
                                jsonProperty("jwtClaimType", "name"),
                                jsonProperty("samlClaimType", "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name"),
                                jsonProperty("source", "user")
                            ), 
                            jsonObject(
                                jsonProperty("ID", "tenantcountry"),
                                jsonProperty("jwtClaimType", "country"),
                                jsonProperty("samlClaimType", "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/country"),
                                jsonProperty("source", "company")
                            )
                        )),
                        jsonProperty("includeBasicClaimSet", "true"),
                        jsonProperty("version", 1)
                    ))
                )))
            .displayName("My Policy")
            .build());

    }
}
Copy
resources:
  myPolicy:
    type: azuread:ClaimsMappingPolicy
    name: my_policy
    properties:
      definitions:
        - fn::toJSON:
            claimsMappingPolicy:
              claimsSchema:
                - ID: employeeid
                  jwtClaimType: name
                  samlClaimType: http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name
                  source: user
                - ID: tenantcountry
                  jwtClaimType: country
                  samlClaimType: http://schemas.xmlsoap.org/ws/2005/05/identity/claims/country
                  source: company
              includeBasicClaimSet: 'true'
              version: 1
      displayName: My Policy
Copy

Create ClaimsMappingPolicy Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new ClaimsMappingPolicy(name: string, args: ClaimsMappingPolicyArgs, opts?: CustomResourceOptions);
@overload
def ClaimsMappingPolicy(resource_name: str,
                        args: ClaimsMappingPolicyArgs,
                        opts: Optional[ResourceOptions] = None)

@overload
def ClaimsMappingPolicy(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        definitions: Optional[Sequence[str]] = None,
                        display_name: Optional[str] = None)
func NewClaimsMappingPolicy(ctx *Context, name string, args ClaimsMappingPolicyArgs, opts ...ResourceOption) (*ClaimsMappingPolicy, error)
public ClaimsMappingPolicy(string name, ClaimsMappingPolicyArgs args, CustomResourceOptions? opts = null)
public ClaimsMappingPolicy(String name, ClaimsMappingPolicyArgs args)
public ClaimsMappingPolicy(String name, ClaimsMappingPolicyArgs args, CustomResourceOptions options)
type: azuread:ClaimsMappingPolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ClaimsMappingPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. ClaimsMappingPolicyArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. ClaimsMappingPolicyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ClaimsMappingPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ClaimsMappingPolicyArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var claimsMappingPolicyResource = new AzureAD.ClaimsMappingPolicy("claimsMappingPolicyResource", new()
{
    Definitions = new[]
    {
        "string",
    },
    DisplayName = "string",
});
Copy
example, err := azuread.NewClaimsMappingPolicy(ctx, "claimsMappingPolicyResource", &azuread.ClaimsMappingPolicyArgs{
	Definitions: pulumi.StringArray{
		pulumi.String("string"),
	},
	DisplayName: pulumi.String("string"),
})
Copy
var claimsMappingPolicyResource = new ClaimsMappingPolicy("claimsMappingPolicyResource", ClaimsMappingPolicyArgs.builder()
    .definitions("string")
    .displayName("string")
    .build());
Copy
claims_mapping_policy_resource = azuread.ClaimsMappingPolicy("claimsMappingPolicyResource",
    definitions=["string"],
    display_name="string")
Copy
const claimsMappingPolicyResource = new azuread.ClaimsMappingPolicy("claimsMappingPolicyResource", {
    definitions: ["string"],
    displayName: "string",
});
Copy
type: azuread:ClaimsMappingPolicy
properties:
    definitions:
        - string
    displayName: string
Copy

ClaimsMappingPolicy Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The ClaimsMappingPolicy resource accepts the following input properties:

Definitions This property is required. List<string>
The claims mapping policy. This is a JSON formatted string, for which the jsonencode() function can be used.
DisplayName This property is required. string
The display name for this Claims Mapping Policy.
Definitions This property is required. []string
The claims mapping policy. This is a JSON formatted string, for which the jsonencode() function can be used.
DisplayName This property is required. string
The display name for this Claims Mapping Policy.
definitions This property is required. List<String>
The claims mapping policy. This is a JSON formatted string, for which the jsonencode() function can be used.
displayName This property is required. String
The display name for this Claims Mapping Policy.
definitions This property is required. string[]
The claims mapping policy. This is a JSON formatted string, for which the jsonencode() function can be used.
displayName This property is required. string
The display name for this Claims Mapping Policy.
definitions This property is required. Sequence[str]
The claims mapping policy. This is a JSON formatted string, for which the jsonencode() function can be used.
display_name This property is required. str
The display name for this Claims Mapping Policy.
definitions This property is required. List<String>
The claims mapping policy. This is a JSON formatted string, for which the jsonencode() function can be used.
displayName This property is required. String
The display name for this Claims Mapping Policy.

Outputs

All input properties are implicitly available as output properties. Additionally, the ClaimsMappingPolicy resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing ClaimsMappingPolicy Resource

Get an existing ClaimsMappingPolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: ClaimsMappingPolicyState, opts?: CustomResourceOptions): ClaimsMappingPolicy
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        definitions: Optional[Sequence[str]] = None,
        display_name: Optional[str] = None) -> ClaimsMappingPolicy
func GetClaimsMappingPolicy(ctx *Context, name string, id IDInput, state *ClaimsMappingPolicyState, opts ...ResourceOption) (*ClaimsMappingPolicy, error)
public static ClaimsMappingPolicy Get(string name, Input<string> id, ClaimsMappingPolicyState? state, CustomResourceOptions? opts = null)
public static ClaimsMappingPolicy get(String name, Output<String> id, ClaimsMappingPolicyState state, CustomResourceOptions options)
resources:  _:    type: azuread:ClaimsMappingPolicy    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Definitions List<string>
The claims mapping policy. This is a JSON formatted string, for which the jsonencode() function can be used.
DisplayName string
The display name for this Claims Mapping Policy.
Definitions []string
The claims mapping policy. This is a JSON formatted string, for which the jsonencode() function can be used.
DisplayName string
The display name for this Claims Mapping Policy.
definitions List<String>
The claims mapping policy. This is a JSON formatted string, for which the jsonencode() function can be used.
displayName String
The display name for this Claims Mapping Policy.
definitions string[]
The claims mapping policy. This is a JSON formatted string, for which the jsonencode() function can be used.
displayName string
The display name for this Claims Mapping Policy.
definitions Sequence[str]
The claims mapping policy. This is a JSON formatted string, for which the jsonencode() function can be used.
display_name str
The display name for this Claims Mapping Policy.
definitions List<String>
The claims mapping policy. This is a JSON formatted string, for which the jsonencode() function can be used.
displayName String
The display name for this Claims Mapping Policy.

Import

Claims Mapping Policy can be imported using the id, e.g.

$ pulumi import azuread:index/claimsMappingPolicy:ClaimsMappingPolicy my_policy 00000000-0000-0000-0000-000000000000
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Azure Active Directory (Azure AD) pulumi/pulumi-azuread
License
Apache-2.0
Notes
This Pulumi package is based on the azuread Terraform Provider.