> For the complete documentation index, see [llms.txt](https://docs.realmjoin.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.realmjoin.com/de/dev-reference/simulating-a-runbook-environment.md).

# Simulieren einer Runbook-Umgebung

## Übersicht

### Eine Anwendungsregistrierung erstellen

Wir erstellen eine Azure Anwendungsregistrierung, um die anwendungsbasierte Anmeldung bei Microsoft Entra zu simulieren.

<figure><img src="/files/452031beec117dc218cf501ed7a2697044459050" alt=""><figcaption><p>Eine App-Registrierung erstellen</p></figcaption></figure>

### Berechtigungen gewähren

Wir gewähren dieselben Berechtigungen, die auch die verwaltete Identität hätte. Wir verwenden dafür dasselbe [AppRoleGranter Toolkit](https://github.com/hcoberdalhoff/approle-and-directoryrole-granter) zu diesem Zweck.

Ersetzen Sie `{AppRegObjectId}` mit der Objekt-ID Ihrer Anwendungsregistrierung.

```powershell
git clone https://github.com/hcoberdalhoff/approle-and-directoryrole-granter.git
cd "approle-and-directoryrole-granter\RealmJoinVnext"
. .\AllInOne.ps1 -appRegObjectId "{AppRegObjectId}"
```

### Ein Dev-Zertifikat erstellen und hochladen

Siehe [hier ](https://github.com/realmjoin/RealmJoin.RunbookHelper/blob/main/DevCertificates.ps1)für ein Beispiel, wie ein RunbookHelper Dev-Zertifikat erstellt wird. Ersetzen Sie `{Variables}` entsprechend.

Die `{AppID}` bezieht sich auf die App-/Client-ID der Anwendungsregistrierung.

Wenn Sie keine bestimmte Abonnement-ID haben, verwenden Sie einfach ein Standardabonnement aus Ihrem Tenant. (Das spielt in den meisten Fällen keine Rolle.)

```powershell
New-SelfSignedCertificate -Subject 'CN=AzureRunAsConnection, OU={AppID}, DC={TenantID}, O={SubscriptionID}' `
    -CertStoreLocation "cert:\CurrentUser\My" -NotAfter (Get-Date).AddYears(10) -KeySpec Signature | `
    Export-Certificate -FilePath "AzureRunAsConnection.cer"
```

Sie erhalten eine Datei `AzureRunAsConnection.cer` die Sie in die Geheimnisse der Anwendungsregistrierung hochladen.

{% hint style="info" %}
Wenn Sie mehrere Apps / Umgebungen bereitstellen möchten, können Sie den Standardwert "AzureRunAsConnection" in`CN=AzureRunAsConnection` beim Erstellen des Zertifikats für diese Umgebung durch einen benutzerdefinierten Namen ersetzen.

Sie können dann auswählen, welche Umgebung/welches Zertifikat (z. B. "OtherEnv") Sie mit `Connect-RjRbGraph -AutomationConnectionName "OtherEnv"`

auf diese Weise verwenden möchten.
{% endhint %}

<figure><img src="/files/a0a1ca162a19b4c8d104d6bb1b0b2304f1238c78" alt=""><figcaption><p>Zertifikats-Upload</p></figcaption></figure>

### Nutzung

Verwenden Sie einfach `Connect-RjRbGraph` zur Authentifizierung bei der App.

Stellen Sie sicher, dass Sie ältere Dev-Zertifikate mit mmc.exe aus Ihrem Satz persönlicher Zertifikate entfernen, falls vorhanden, um Konflikte/Anmeldefehler zu vermeiden.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.realmjoin.com/de/dev-reference/simulating-a-runbook-environment.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
