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

azuread.ServicePrincipalClaimsMappingPolicyAssignment

Explore with Pulumi AI

Manages a Claims Mapping Policy Assignment 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 app = new azuread.ServicePrincipalClaimsMappingPolicyAssignment("app", {
    claimsMappingPolicyId: myPolicy.id,
    servicePrincipalId: myPrincipal.id,
});
Copy
import pulumi
import pulumi_azuread as azuread

app = azuread.ServicePrincipalClaimsMappingPolicyAssignment("app",
    claims_mapping_policy_id=my_policy["id"],
    service_principal_id=my_principal["id"])
Copy
package main

import (
	"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 {
		_, err := azuread.NewServicePrincipalClaimsMappingPolicyAssignment(ctx, "app", &azuread.ServicePrincipalClaimsMappingPolicyAssignmentArgs{
			ClaimsMappingPolicyId: pulumi.Any(myPolicy.Id),
			ServicePrincipalId:    pulumi.Any(myPrincipal.Id),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureAD = Pulumi.AzureAD;

return await Deployment.RunAsync(() => 
{
    var app = new AzureAD.ServicePrincipalClaimsMappingPolicyAssignment("app", new()
    {
        ClaimsMappingPolicyId = myPolicy.Id,
        ServicePrincipalId = myPrincipal.Id,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azuread.ServicePrincipalClaimsMappingPolicyAssignment;
import com.pulumi.azuread.ServicePrincipalClaimsMappingPolicyAssignmentArgs;
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 app = new ServicePrincipalClaimsMappingPolicyAssignment("app", ServicePrincipalClaimsMappingPolicyAssignmentArgs.builder()
            .claimsMappingPolicyId(myPolicy.id())
            .servicePrincipalId(myPrincipal.id())
            .build());

    }
}
Copy
resources:
  app:
    type: azuread:ServicePrincipalClaimsMappingPolicyAssignment
    properties:
      claimsMappingPolicyId: ${myPolicy.id}
      servicePrincipalId: ${myPrincipal.id}
Copy

Create ServicePrincipalClaimsMappingPolicyAssignment Resource

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

Constructor syntax

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

@overload
def ServicePrincipalClaimsMappingPolicyAssignment(resource_name: str,
                                                  opts: Optional[ResourceOptions] = None,
                                                  claims_mapping_policy_id: Optional[str] = None,
                                                  service_principal_id: Optional[str] = None)
func NewServicePrincipalClaimsMappingPolicyAssignment(ctx *Context, name string, args ServicePrincipalClaimsMappingPolicyAssignmentArgs, opts ...ResourceOption) (*ServicePrincipalClaimsMappingPolicyAssignment, error)
public ServicePrincipalClaimsMappingPolicyAssignment(string name, ServicePrincipalClaimsMappingPolicyAssignmentArgs args, CustomResourceOptions? opts = null)
public ServicePrincipalClaimsMappingPolicyAssignment(String name, ServicePrincipalClaimsMappingPolicyAssignmentArgs args)
public ServicePrincipalClaimsMappingPolicyAssignment(String name, ServicePrincipalClaimsMappingPolicyAssignmentArgs args, CustomResourceOptions options)
type: azuread:ServicePrincipalClaimsMappingPolicyAssignment
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. ServicePrincipalClaimsMappingPolicyAssignmentArgs
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. ServicePrincipalClaimsMappingPolicyAssignmentArgs
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. ServicePrincipalClaimsMappingPolicyAssignmentArgs
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. ServicePrincipalClaimsMappingPolicyAssignmentArgs
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. ServicePrincipalClaimsMappingPolicyAssignmentArgs
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 servicePrincipalClaimsMappingPolicyAssignmentResource = new AzureAD.ServicePrincipalClaimsMappingPolicyAssignment("servicePrincipalClaimsMappingPolicyAssignmentResource", new()
{
    ClaimsMappingPolicyId = "string",
    ServicePrincipalId = "string",
});
Copy
example, err := azuread.NewServicePrincipalClaimsMappingPolicyAssignment(ctx, "servicePrincipalClaimsMappingPolicyAssignmentResource", &azuread.ServicePrincipalClaimsMappingPolicyAssignmentArgs{
	ClaimsMappingPolicyId: pulumi.String("string"),
	ServicePrincipalId:    pulumi.String("string"),
})
Copy
var servicePrincipalClaimsMappingPolicyAssignmentResource = new ServicePrincipalClaimsMappingPolicyAssignment("servicePrincipalClaimsMappingPolicyAssignmentResource", ServicePrincipalClaimsMappingPolicyAssignmentArgs.builder()
    .claimsMappingPolicyId("string")
    .servicePrincipalId("string")
    .build());
Copy
service_principal_claims_mapping_policy_assignment_resource = azuread.ServicePrincipalClaimsMappingPolicyAssignment("servicePrincipalClaimsMappingPolicyAssignmentResource",
    claims_mapping_policy_id="string",
    service_principal_id="string")
Copy
const servicePrincipalClaimsMappingPolicyAssignmentResource = new azuread.ServicePrincipalClaimsMappingPolicyAssignment("servicePrincipalClaimsMappingPolicyAssignmentResource", {
    claimsMappingPolicyId: "string",
    servicePrincipalId: "string",
});
Copy
type: azuread:ServicePrincipalClaimsMappingPolicyAssignment
properties:
    claimsMappingPolicyId: string
    servicePrincipalId: string
Copy

ServicePrincipalClaimsMappingPolicyAssignment 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 ServicePrincipalClaimsMappingPolicyAssignment resource accepts the following input properties:

ClaimsMappingPolicyId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the claims mapping policy to assign.
ServicePrincipalId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the service principal for the policy assignment.
ClaimsMappingPolicyId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the claims mapping policy to assign.
ServicePrincipalId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the service principal for the policy assignment.
claimsMappingPolicyId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the claims mapping policy to assign.
servicePrincipalId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the service principal for the policy assignment.
claimsMappingPolicyId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the claims mapping policy to assign.
servicePrincipalId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the service principal for the policy assignment.
claims_mapping_policy_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the claims mapping policy to assign.
service_principal_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the service principal for the policy assignment.
claimsMappingPolicyId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the claims mapping policy to assign.
servicePrincipalId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the service principal for the policy assignment.

Outputs

All input properties are implicitly available as output properties. Additionally, the ServicePrincipalClaimsMappingPolicyAssignment 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 ServicePrincipalClaimsMappingPolicyAssignment Resource

Get an existing ServicePrincipalClaimsMappingPolicyAssignment 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?: ServicePrincipalClaimsMappingPolicyAssignmentState, opts?: CustomResourceOptions): ServicePrincipalClaimsMappingPolicyAssignment
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        claims_mapping_policy_id: Optional[str] = None,
        service_principal_id: Optional[str] = None) -> ServicePrincipalClaimsMappingPolicyAssignment
func GetServicePrincipalClaimsMappingPolicyAssignment(ctx *Context, name string, id IDInput, state *ServicePrincipalClaimsMappingPolicyAssignmentState, opts ...ResourceOption) (*ServicePrincipalClaimsMappingPolicyAssignment, error)
public static ServicePrincipalClaimsMappingPolicyAssignment Get(string name, Input<string> id, ServicePrincipalClaimsMappingPolicyAssignmentState? state, CustomResourceOptions? opts = null)
public static ServicePrincipalClaimsMappingPolicyAssignment get(String name, Output<String> id, ServicePrincipalClaimsMappingPolicyAssignmentState state, CustomResourceOptions options)
resources:  _:    type: azuread:ServicePrincipalClaimsMappingPolicyAssignment    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:
ClaimsMappingPolicyId Changes to this property will trigger replacement. string
The ID of the claims mapping policy to assign.
ServicePrincipalId Changes to this property will trigger replacement. string
The ID of the service principal for the policy assignment.
ClaimsMappingPolicyId Changes to this property will trigger replacement. string
The ID of the claims mapping policy to assign.
ServicePrincipalId Changes to this property will trigger replacement. string
The ID of the service principal for the policy assignment.
claimsMappingPolicyId Changes to this property will trigger replacement. String
The ID of the claims mapping policy to assign.
servicePrincipalId Changes to this property will trigger replacement. String
The ID of the service principal for the policy assignment.
claimsMappingPolicyId Changes to this property will trigger replacement. string
The ID of the claims mapping policy to assign.
servicePrincipalId Changes to this property will trigger replacement. string
The ID of the service principal for the policy assignment.
claims_mapping_policy_id Changes to this property will trigger replacement. str
The ID of the claims mapping policy to assign.
service_principal_id Changes to this property will trigger replacement. str
The ID of the service principal for the policy assignment.
claimsMappingPolicyId Changes to this property will trigger replacement. String
The ID of the claims mapping policy to assign.
servicePrincipalId Changes to this property will trigger replacement. String
The ID of the service principal for the policy assignment.

Import

Claims Mapping Policy can be imported using the id, in the form service-principal-uuid/claimsMappingPolicy/claims-mapping-policy-uuid, e.g:

$ pulumi import azuread:index/servicePrincipalClaimsMappingPolicyAssignment:ServicePrincipalClaimsMappingPolicyAssignment app 00000000-0000-0000-0000-000000000000/claimsMappingPolicy/11111111-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.