Does the "Enable multifactor authentication by 21 Sep 2026" apply to terraform updates via SP

Kiran Gurumukhi 0 Reputation points
2026-09-18T19:57:17.2833333+00:00

Does the "Enable multifactor authentication for your Azure tenant by 21 September 2026" notification apply to Terraform and automated tools that use service principal based credentials for update of Azure resources?

Microsoft Security | Intune | Configuration
0 comments No comments

2 answers

Sort by: Oldest
  1. AI answer

    2026-09-18T19:57:31.6766667+00:00

    No. Terraform updates that use a service principal are not affected in the same way as user sign-ins.

    The mandatory MFA enforcement applies to users signing in to Azure management surfaces and tools such as the Azure portal, Azure CLI, Azure PowerShell, SDKs, REST APIs, and IaC tools including Terraform when those actions are performed through a user identity.

    For automation, the recommended approach is to use a workload identity such as a service principal or managed identity instead of a user-based account. Terraform supports authenticating with a service principal by setting provider credentials such as:

    $env:ARM_CLIENT_ID="<service_principal_app_id>"
    $env:ARM_SUBSCRIPTION_ID="<azure_subscription_id>"
    $env:ARM_TENANT_ID="<azure_subscription_tenant_id>"
    $env:ARM_CLIENT_SECRET="<service_principal_password>"
    

    Then verify them with:

    gci env:ARM_*
    

    Important: storing credentials directly in a Terraform configuration file is not advisable because clear-text credentials can be viewed by non-trusted individuals.

    If the Terraform automation is currently using a user-based account instead of a service principal, that user-based automation will be affected by MFA enforcement and should be migrated to a service principal or managed identity.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

  2. Marcin Policht 108.3K Reputation points MVP Volunteer Moderator
    2026-09-18T20:01:50.2866667+00:00

    In short - no. As per https://azure.microsoft.com/en-us/blog/azure-mandatory-multifactor-authentication-phase-2-starting-in-october-2025/

    Workload identities, such as managed identities and service principals, aren’t impacted by either phase of this MFA enforcement.


    If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

    hth

    Marcin

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.