Table of Contents

Use-CafServicePrincipal

Sets the context for the service principal and logging it in using the password in the resolved Azure Key Vault.

Syntax

Use-CafServicePrincipal
    [-ServicePrincipalScope <string>]
    [-ServicePrincipalType <string>]

Description

Gets the subscription Id from the .azcontext file. It uses this id and retrieves the deploy service principal which has an Owner role assignment on the subscription scope. This service principal is then used to retrieve its respective key vault name.

Example

Use-CafServicePrincipal
    -ServicePrincipalType "deploy"

Parameter

-ServicePrincipalScope Specifies the scope of service principal to use.

Property Value
Type: string
Allowed values: ["Subscription", "ManagementGroup"]
Default value: "Subscription"
Required: False

-ServicePrincipalType Specifies the type of service principal to use.

Property Value
Type: string
Allowed values: ["deploy", "ops"]
Default value: "deploy"
Required: False