Azure Citadel
  • Blogs

  • Azure Arc
    • Overview
    • Azure Arc-enabled Kubernetes
      • Prereqs
      • Background
      • Deploy Cluster
      • Connect to Arc
      • Enable GitOps
      • Deploy Application
      • Enable Azure AD
      • Enforce Policy
      • Enable Monitoring
      • Enable Azure Defender
      • Enable Data Services
      • Enable Application Delivery
    • Azure Arc-enabled Servers
      • Prereqs
      • Scenario
      • Hack Overview
      • Azure Landing Zone
      • Arc Pilot resource group
      • Azure Monitoring Agent
      • Additional policy assignments
      • Access your on prem VMs
      • Create onboarding scripts
      • Onboarding using scripts
      • Inventory
      • Monitoring
      • SSH
      • Windows Admin Center
      • Governance
      • Custom Script Extension
      • Key Vault Extension
      • Managed Identity
    • Useful Links
  • Azure CLI
    • Install
    • Get started
    • JMESPATH queries
    • Integrate with Bash
  • Azure Landing Zones
    • ALZ Accelerator
      • Bootstrap
      • Prereqs
      • Elevate
      • Demote
      • Components
    • Deploy an Azure Landing Zone
      • Create an initial ALZ config
      • Test locally
      • Run through the CI/CD workflow
    • Understanding Libraries
      • Library overview
      • Policies and Roles
      • Archetypes
      • Architectures
      • Metadata
    • Example Library Configs
      • Azure Landing Zone library
      • Azure Landing Zone library with overrides
  • Azure Lighthouse
    • Minimal Lighthouse definition
    • Using service principals
    • Privileged Identity Management
  • Azure Policy
    • Azure Policy Basics
      • Policy Basics in the Azure Portal
      • Creating Policy via the CLI
      • Deploy If Not Exists
      • Management Groups and Initiatives
    • Creating Custom Policies
      • Customer scenario
      • Policy Aliases
      • Determine the logic
      • Create the custom policy
      • Define, assign and test
  • Marketplace
    • Introduction
      • Terminology
      • Offer Types
    • Partner Center
    • Offer Type
    • Publish a VM Offer HOL
      • Getting Started
      • Create VM Image
      • Test VM Image
      • VM Offer with SIG
      • VM Offer with SAS
      • Publish Offer
      • Other VM Resources
    • Publish a Solution Template HOL
      • Getting Started
      • Create ARM Template
      • Validate ARM Template
      • Create UI Definition
      • Package Assets
      • Publish Offer
    • Publish a Managed App HOL
      • Getting Started
      • Create ARM Template
      • Validate ARM Template
      • Create UI Definition
      • Package Assets
      • Publish Offer
    • Managed Apps with AKS HOL
    • Other Managed App Resources
    • SaaS Offer HOLs
    • SaaS Offer Video Series
      • Video 1 - SaaS Offer Overview
      • Video 2 - Purchasing a SaaS Offer
      • Video 3 - Purchasing a Private SaaS Plan
      • Video 4 - Publishing a SaaS Offer
      • Video 5 - Publishing a Private SaaS Plan
      • Video 6 - SaaS Offer Technical Overview
      • Video 7 - Azure AD Application Registrations
      • Video 8 - Using the SaaS Offer REST Fulfillment API
      • Video 9 - The SaaS Client Library for .NET
      • Video 10 - Building a Simple SaaS Landing Page in .NET
      • Video 11 - Building a Simple SaaS Publisher Portal in .NET
      • Video 12 - SaaS Webhook Overview
      • Video 13 - Implementing a Simple SaaS Webhook in .NET
      • Video 14 - Securing a Simple SaaS Webhook in .NET
      • Video 15 - SaaS Metered Billing Overview
      • Video 16 - The SaaS Metered Billing API with REST
  • Microsoft Fabric
    • Theory
    • Prereqs
    • Fabric Capacity
    • Set up a Remote State
    • Create a repo from a GitHub template
    • Configure an app reg for development
    • Initial Terraform workflow
    • Expanding your config
    • Configure a workload identity
    • GitHub Actions for Microsoft Fabric
    • GitLab pipeline for Microsoft Fabric
  • Packer & Ansible
    • Packer
    • Ansible
    • Dynamic Inventories
    • Playbooks & Roles
    • Custom Roles
    • Shared Image Gallery
  • Partner Admin Link
    • Understanding PAL
    • User IDs & PAL
    • Service principals & PAL
    • CI/CD pipelines & PAL
    • PAL tag with a service principal
    • Azure Lighthouse & PAL
    • PAL FAQ
  • REST API
    • REST API theory
    • Using az rest
  • Setup
  • Sovereign Landing Zones
    • ALZ Accelerator
      • Prereqs
      • Elevate
      • Bootstrap
      • Demote
      • Components
    • Deploy Sovereign Landing Zone
      • Create an initial SLZ config
      • Test locally
      • Run through the CI/CD workflow
    • Custom Libraries
      • Overview of Libraries
      • Policies, Assignments and Roles
      • Archetypes, Overrides and Architecture
    • Reference Library Configs
      • Sovereign Landing Zone
      • Sovereign Landing Zone library with overrides
      • SLZ extended with a country pack
  • Terraform
    • Fundamentals
      • Initialise
      • Format
      • Validate
      • Plan
      • Apply
      • Adding resources
      • Locals and outputs
      • Managing state
      • Importing resources
      • Destroy
    • Get set up for Terraform
      • Cloud Shell
      • macOS
      • Windows with PowerShell
      • Windows with Ubuntu in WSL2
    • Using AzAPI
      • Using the REST API
      • azapi_resource
      • Removing azapi_resource
      • azapi_update_resource
      • Data sources and outputs
      • Removing azapi_update_resource
  • Virtual Machines
    • Azure Bastion with native tools & AAD
    • Managed Identities

  • About
  • Archive
  1. Home
  2. Partner Admin Link
  3. PAL tag with a service principal
PAL tag with a service principal
PAL tag with a service principal
Partner Admin Link
Understanding PAL
User IDs & PAL
Service principals & PAL
CI/CD pipelines & PAL
PAL tag with a service principal
Azure Lighthouse & PAL
PAL FAQ
  • Introduction
  • Create a service principal and PAL
  • Create RBAC role assignments for the service principal

PAL tag with a service principal

In the final service principal scenario, we'll look at creating a service principal dedicated purely for recognition purposes.

Table of Contents

  • Introduction
  • Create a service principal and PAL
  • Create RBAC role assignments for the service principal

Introduction

There are certain scenarios where the partner has had influence on a set of resources, say a specific subscription, but the customer does not need the partner to have ongoing access. Example scenarios:

  • Consultative engagements (e.g. advisories) where contributor access was never required
  • Proof of value pilot deployments which have been subsequently handed over to the customer team
  • Highly secured production environments that only permit contributor access for workload identities, i.e. those used in CI/CD deployment pipelines

Historically these scenarios may have been recognised by a mechanism called Digital Partner of Record but DPOR has been retired.

On this page we will use a dedicated service principal that purely exists to “PAL tag” specific environments so that the partner receives the correct level of recognition.

The commands below use a Bash environment which includes both the Azure CLI and jq. (The Cloud Shell has both preinstalled.)

The page has two key steps that require certain permissions:

  1. Create a service principal and partner admin link

    By default, standard users can create service principals. Guest IDs cannot.

    Standard users may not be able to create service principals if the Users can register applications setting has been toggled to no.

    Either way, the Application Administrator or Application Developer roles in Entra allow service principal creation.

  2. Create RBAC role assignments for the service principal

    A privileged role is required to create RBAC role assignments, e.g.:

    • Owner
    • User Access Administrator
    • Role Based Access Control Administrator

The two steps do not have to be run by the same person.

Create a service principal and PAL

  1. Set a partner name variable.

    The name will be used in the display name for the service principal in case there are multiple partners working in the customer account.

    partnerName="<partnername>"
    
  2. Set a partner ID variable.

    Remember to use the location-based partner ID.

    partnerId="<partnerId>"
    
  3. Create the service principal

    displayName="PAL (Partner Admin Link) for ${partnerName}"
    json=$(az ad sp create-for-rbac --display-name "$displayName" --output json)
    appId=$(jq -r '.appId' <<< $json)
    secret=$(jq -r '.password' <<< $json)
    tenantId=$(jq -r '.tenant' <<< $json)
    az ad sp show --id $appId --output jsonc
    

    By default, the service principal will have no RBAC role assignments.

  4. Add an owner (optional)

    myObjectId=$(az ad signed-in-user show --query id -otsv)
    az ad app owner add --id $appId --owner-object-id $myObjectId
    az ad app owner list --id $appId
    

    You can also add owners in the portal.

  5. Get the token

    ℹ️ This approach uses the REST API to avoid having to switch IDs with the Azure CLI.

    uri="https://login.microsoftonline.com/${tenantId}/oauth2/v2.0/token"
    data="grant_type=client_credentials&client_id=${appId}&client_secret=${secret}&scope=https://management.azure.com/.default"
    token=$(curl --silent --request POST --header "Content-Type: application/x-www-form-urlencoded" --data "$data" "$uri" | jq -r '.access_token')
    [[ -n "$token" ]] && cut -d. -f2 <<< $token | base64 --decode 2>/dev/null | jq '{aud, iss, tid, appid}' || echo "Error getting the token."
    
  6. Create the Partner Admin Link

    uri="https://management.azure.com/providers/microsoft.managementpartner/partners/${partnerId}?api-version=2018-02-01"
    data='{"partnerId": "'${partnerId}'"}'
    curl --silent --request PUT --header "Authorization: Bearer ${token}" --header "Content-Type: application/json" --data "$data" "$uri" | jq .
    
    Additional commands

    Show the partner admin link.

    curl --silent --request GET --header "Authorization: Bearer ${token}" --header "Content-Type: application/json" "$uri" | jq .
    

    Delete the partner admin link.

    curl --silent --request DELETE --header "Authorization: Bearer ${token}" --header "Content-Type: application/json" "$uri" | jq .
    
  7. Remove the secret

    You may remove the secret once the Partner Admin Link has been successfully created.

    Removing the secret addresses potential security concerns and also removes the need to rotate secrets ahead of expiry dates.

    Delete the credential.

    keyId=$(az ad app credential list --id $appId --query "[?displayName == 'rbac']|[0].keyId" -otsv)
    az ad app credential delete --id $appId --key-id $keyId
    

    The command has no output, but you will see that there is no secret in the Azure Portal in the next step.

    Note that you will no longer be able to display that the partner admin link exists as you can no longer authenticate as the service principal.

  8. View the App registrations.

    1. Select the Partner Admin Link app registration in Owned Applications.

    2. View the Certificates and secrets and confirm that there are no certs, secrets, or federated credentials.

      Azure portal showing the Certificates and secrets page for an app registration with empty sections for Certificates, Client secrets, and Federated credentials, confirming no authentication credentials are configured

The service principal is now ready and RBAC role assignments can be created for it.

Create RBAC role assignments for the service principal

The recognition in Partner Admin Link is based on the RBAC role assignment scope points, and only applies to role assignments with a PEC eligible role. These examples use Support Request Contributor.

Remember, a privileged role is required to create RBAC role assignments, e.g.:

  • Owner
  • User Access Administrator
  • Role Based Access Control Administrator

Recognition will associate the resource telemetry for all resources below the role assignment scope points.

Only assign roles to scope points that define the set of resources where the partner deserves recognition for their influence.

Note that the telemetry is always collected for Azure billing purposes. No new telemetry is collected, it is just associated withe the partner ID. The association solely indicates the positive influence that the partner has in the customer account and the partner does not have access to the telemetry itself except for a highly aggregated and anonymized number for the customer.

You can create the role assignments in the Azure Portal. Here is one way to do so:

  1. Open Resource Manager
  2. Click on Organization
  3. Select Management Group or Subscriptions.
  4. Select your scope point.
  5. Click on Access control (IAM) in the blade
  6. Click on + Add > Add role assignment
  7. Select the Support Request Administrator role, and click Next
  8. Click on + Select members, search for PAL and select the service principal
  9. Click on Review + assign and validate the assignment details
  10. Click on Review + assign again to create the RBAC role assignment

Repeat the process for other scope points if required.

Subscription example

This example creates an assignment for the current subscription.

objectId=$(az ad sp show --id $appId --query id -otsv)
role="Support Request Contributor"
scope="/subscriptions/$(az account show --query id -otsv)"
az role assignment create --role "$role" --scope "$scope" --assignee-object-id "$objectId" --assignee-principal-type "ServicePrincipal"

The scope point can be the resourceId for a subscription, resource group or individual resource.

The scope may also be set to a management group’s resourceId, in which case it will include all subscriptions underneath that management group.

Multiple subscriptions

This example creates the role assignment at all subscriptions within the service principal’s tenant based on your access.

objectId=$(az ad sp show --id $appId --query id -otsv)
role="Support Request Contributor"
upn=$(az ad signed-in-user show --query userPrincipalName -otsv)

subscriptionIds=$(az account list --refresh --only-show-errors --query "[?tenantId == '"${tenantId}"' && user.name == '"${upn}"'].id" -otsv)

for subscriptionId in $subscriptionIds
do az role assignment create --role "$role" --scope "/subscriptions/${subscriptionId}" --assignee-object-id "$objectId" --assignee-principal-type "ServicePrincipal"
done
Source: https://www.azurecitadel.com/pal/paltag/
Published: 10 Oct 2025
Printed:
CI/CD pipelines & PAL PAL tag with a service principal Azure Lighthouse & PAL