Added PowersShell method for creating service principal (#320)

* Update DataManagementAnalytics-ServicePrincipal.md

* Update docs/DataManagementAnalytics-ServicePrincipal.md

Co-authored-by: Marvin Buss <34542414+marvinbuss@users.noreply.github.com>

* Update docs/DataManagementAnalytics-ServicePrincipal.md

Co-authored-by: Marvin Buss <34542414+marvinbuss@users.noreply.github.com>

* Update docs/DataManagementAnalytics-ServicePrincipal.md

Co-authored-by: Marvin Buss <34542414+marvinbuss@users.noreply.github.com>

* Update DataManagementAnalytics-ServicePrincipal.md

Using the right markdown for notes

* Update docs/DataManagementAnalytics-ServicePrincipal.md

Co-authored-by: Marvin Buss <34542414+marvinbuss@users.noreply.github.com>

---------

Co-authored-by: Marvin Buss <34542414+marvinbuss@users.noreply.github.com>
This commit is contained in:
Hamood 2023-06-08 18:39:30 -04:00 коммит произвёл GitHub
Родитель e23cd1e810
Коммит f5b34d8d58
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 14 добавлений и 0 удалений

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

@ -32,6 +32,20 @@ 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 assigments
For automation purposes, one more role assignments is required for the service principal.