Skip to content

Commit 93772e3

Browse files
committed
update doc2
1 parent f5f729e commit 93772e3

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

articles/synapse-analytics/spark/how-to-use-certsp-emit-log-to-eventhub.md

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ ms.date: 03/24/2025
7979
8080
2. In **Key Vault**, assign the linked service a **Reader** role.
8181
82-
## Step 7. Configure Logging in Synapse Notebook
82+
## Step 7. Configure with a linked service
8383
8484
1. Open your Synapse workspace and create or open a notebook.
8585
2. In the first code cell, add the configuration code to emit logs to Event Hub.
@@ -88,29 +88,31 @@ ms.date: 03/24/2025
8888
%%configure -f
8989
{
9090
"conf": {
91-
"spark.yarn.user.classpath.first": "true",
92-
"spark.synapse.diagnostic.emitters": "EventHub",
93-
"spark.synapse.diagnostic.emitter.EventHub.type": "AzureEventHub",
94-
"spark.synapse.diagnostic.emitter.EventHub.categories": "DriverLog,ExecutorLog,EventLog,Metrics",
95-
"spark.synapse.diagnostic.emitter.EventHub.certificate.keyVault": "Your-keyvault-name",
96-
"spark.synapse.diagnostic.emitter.EventHub.certificate.keyVault.certificateName": "Your-certificate-name",
97-
"spark.synapse.diagnostic.emitter.EventHub.certificate.keyVault.linkedService": "Your-linkedservice-name",
98-
"spark.synapse.diagnostic.emitter.EventHub.hostName": "Your-eventhub-hostname",
99-
"spark.synapse.diagnostic.emitter.EventHub.tenantId": "Your-sp-tenantId",
100-
"spark.synapse.diagnostic.emitter.EventHub.clientId": "Your-sp-clientid",
101-
"spark.synapse.diagnostic.emitter.EventHub.entityPath": "Your-eventhub-entitypath"
91+
"spark.synapse.diagnostic.emitters": <EMITTER_NAME>,
92+
"spark.synapse.diagnostic.emitter.<EMITTER_NAME>.type": "AzureEventHub",
93+
"spark.synapse.diagnostic.emitter.<EMITTER_NAME>.categories": "DriverLog,ExecutorLog,EventLog,Metrics",
94+
"spark.synapse.diagnostic.emitter.<EMITTER_NAME>.certificate.keyVault.certificateName": <CERTIFICATE_NAME>",
95+
"spark.synapse.diagnostic.emitter.<EMITTER_NAME>.certificate.keyVault.linkedService": <LINKED_SERVICE_NAME>,
96+
"spark.synapse.diagnostic.emitter.<EMITTER_NAME>.hostName": <EVENT_HUB_HOST_NAME>,
97+
"spark.synapse.diagnostic.emitter.<EMITTER_NAME>.tenantId": <SERVICE_PRINCIPAL_TENANT_ID>,
98+
"spark.synapse.diagnostic.emitter.<EMITTER_NAME>.clientId": <SERVICE_PRINCIPAL_CLIENT_ID>,
99+
"spark.synapse.diagnostic.emitter.<EMITTER_NAME>.entityPath": <EVENT_HUB_ENTITY_PATH>
102100
},
103101
"jars": [
104102
"Your-specific-jar-in-blob"
105103
]
106104
}
107105
```
108-
### Description
109106
110-
- **EventHub.hostName**: Event Hubs Namespace -> Overview -> Host name
111-
- **EventHub.tenantId**: App registrations -> your app name -> Overview -> Directory (tenant) ID
112-
- **EventHub.clientId**: App registrations -> your app name -> Overview -> Application(client) ID
113-
- **EventHub.entityPath**: Event Hubs Instance -> Settings -> Shared access policies -> Find "EntityPath" in Connection string
107+
Gather the following values and add to the Apache Spark configuration.
108+
109+
- **<EMITTER_NAME>**: The name for the emmiter.
110+
- **<CERTIFICATE_NAME>**: The certificate name that you generated in the key vault.
111+
- **<LINKED_SERVICE_NAME>**: The Azure Key vault linked service name.
112+
- **<EVENT_HUB_HOST_NAME>**: The Event Hub host name, you can find it in Event Hubs Namespace -> Overview -> Host name.
113+
- **<SERVICE_PRINCIPAL_TENANT_ID>**: The service principal tenant id, you can find it in App registrations -> your app name -> Overview -> Directory (tenant) ID
114+
- **<SERVICE_PRINCIPAL_CLIENT_ID>**: The service principal client id, you can find it in registrations -> your app name -> Overview -> Application(client) ID
115+
- **<EVENT_HUB_ENTITY_PATH>**: The Event Hub entity path, you can find it in Event Hubs Namespace -> Overview -> Host name.
114116
115117
## Step 8. Submit an Apache Spark application and view the logs and metrics
116118

0 commit comments

Comments
 (0)