Skip to content

Add partner_id to provider configuration #715

@mattdot

Description

@mattdot
Member

Adding a partner_id setting to the Power Platform Terraform provider will let solution partners pass the same Customer Usage Attribution (CUA) GUID that AzureRM and AzAPI already honor, so deployments built with the new provider can be report analytics just like ARM‑based workloads.

User Story

As a partner engineer deploying Power Platform resources with Terraform
I want the provider block to accept an optional partner_id = "<GUID>" argument (or to read it from the ARM_PARTNER_ID environment variable)
So that Microsoft can attribute the consumed Power Platform usage to my organization under the existing Customer Usage Attribution program, enabling accurate ACR/PAL reporting and partner incentive recognition.

Acceptance Criteria

  1. Provider schema

    • New optional partner_id argument of type string; must validate as a GUID.
    • When omitted, provider behaves exactly as today.
    • When supplied, the value is propagated on every ARM REST call via appending pid-<GUID> to the user-agent header, matching the AzAPI/AzureRM convention.
  2. Environment variable parity

    • If partner_id is not set in Terraform code, the provider reads ARM_PARTNER_ID or POWER_PLATFORM_PARTNER_ID.
    • If both are set, the explicit provider block value wins (aligns with AzureRM behavior).
  3. Telemetry safeguards

    • Add disable_terraform_partner_id boolean flag (default false) mirroring AzAPI, allowing users to opt‑out. This prevents sending the default 222c6c49-1b0a-5959-a213-6608f9eb8820 terraform partner id if a custom partner id is not supplied
  4. Documentation & examples

  • Registry docs include explanation of CUA, a sample provider block, and links to Partner Center guidance.
  1. Tests
    • Unit test: provider initializes when partner_id is present and validates GUID format.
    • Acceptance test: verifies that the header is sent on an environment resource create call.

Implementation Notes

  • Follow the pattern in AzureRM (partner_id in provider schema).
  • Header syntax must be pid-<GUID> per CUA spec; avoid sending raw GUIDs.
  • Keep the feature behind a minor‑version bump (v1.x → v1.(x+1)) to preserve API compatibility.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    Participants

    @mattdot

    Issue actions

      Add `partner_id` to provider configuration · Issue #715 · microsoft/terraform-provider-power-platform