# Create Service Principal

An Azure Service Principal with the `Reader` role over a subscription can be created from Azure CLI:

```bash
az ad sp create-for-rbac \
  --name pandora-azure-application-gateway-discovery \
  --role Reader \
  --scopes /subscriptions/<SUBSCRIPTION_ID>
```

The command returns an output similar to this:

```json
{
  "appId": "<CLIENT_ID>",
  "displayName": "pandora-azure-application-gateway-discovery",
  "password": "<CLIENT_SECRET>",
  "tenant": "<TENANT_ID>"
}
```

The mapping with the plugin fields is:

```text
tenant       -> Azure Tenant ID
appId        -> Azure Client ID
password     -> Azure Client Secret
subscription -> Azure Subscription ID
```