adding PowerShell method for creating service principal (#108)
This commit is contained in:
Родитель
cf9095dfe0
Коммит
324355ba7d
|
@ -34,6 +34,19 @@ This will generate the following JSON output:
|
||||||
|
|
||||||
> **Note:** Take note of the output. It will be required for the next steps.
|
> **Note:** Take note of the output. It will be required for the next steps.
|
||||||
|
|
||||||
|
**Azure PowerShell:**
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
# Ensure you are in the right subscription
|
||||||
|
Set-AzContext -Subscription "{SubscriptionId or SubscriptionName}"
|
||||||
|
# Create service principal
|
||||||
|
$sp = New-AzADServicePrincipal -DisplayName {name}
|
||||||
|
$sp.PasswordCredentials.SecretText
|
||||||
|
```
|
||||||
|
The returned object contains the generated password. Make sure that you store this value somewhere secure to authenticate with the service principal.
|
||||||
|
|
||||||
|
> **Note:** Beginning with Az PowerShell module version 7.x, `New-AzADServicePrincipal` no longer assigns the Contributor role to the service principal by default. Follow steps below to grant it the `Contributor` role.
|
||||||
|
|
||||||
## Adding additional role assignments
|
## Adding additional role assignments
|
||||||
|
|
||||||
For automation purposes, more role assignments are required for the service principal.
|
For automation purposes, more role assignments are required for the service principal.
|
||||||
|
|
Загрузка…
Ссылка в новой задаче