adding PowerShell method for creating service principal (#142)

This commit is contained in:
Hamood 2023-06-15 16:00:41 -04:00 коммит произвёл GitHub
Родитель 4d1666acd2
Коммит 87c016b4ba
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 13 добавлений и 0 удалений

Просмотреть файл

@ -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.
**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
For automation purposes, more role assignments are required for the service principal.