Livy Sessions - List Livy Sessions
Returns a list of livy sessions from the specified item identifier.
This API supports pagination.
Permissions
The caller must have read permissions for the notebook.
Required Delegated Scopes
Notebook.Read.All or Notebook.ReadWrite.All or Item.Read.All or Item.ReadWrite.All
Microsoft Entra supported identities
This API supports the Microsoft identities listed in this section.
| Identity | Support |
|---|---|
| User | Yes |
| Service principal and Managed identities | Yes |
Interface
GET https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/notebooks/{notebookId}/livySessions
GET https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/notebooks/{notebookId}/livySessions?continuationToken={continuationToken}
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
notebook
|
path | True |
string (uuid) |
The notebook ID. |
|
workspace
|
path | True |
string (uuid) |
The workspace identifier. |
|
continuation
|
query |
string |
Token to retrieve the next page of results, if available. |
Responses
| Name | Type | Description |
|---|---|---|
| 200 OK |
OK -- Returns a list of all livy sessions associated to an itemId. |
|
| 429 Too Many Requests |
The service rate limit was exceeded. The server returns a Headers Retry-After: integer |
|
| Other Status Codes |
Common error codes:
|
Examples
List all livy sessions example
Sample request
GET https://api.fabric.microsoft.com/v1/workspaces/f8113ba8-dd81-443e-811a-b385340f3f05/notebooks/8cee7699-2e81-4121-9a53-cc9025046193/livySessions
Sample response
{
"continuationToken": null,
"continuationUri": null,
"value": [
{
"sparkApplicationId": "application_1730933685452_0001",
"state": "Cancelled",
"livyId": "9611f500-bf44-42e0-a0de-78dacb374398",
"origin": "SubmittedJob",
"attemptNumber": 1,
"maxNumberOfAttempts": 1,
"livyName": "random_test_name_app",
"submitter": {
"id": "6f23a8a6-d954-4550-b91a-4df73ccd0311",
"type": "User"
},
"item": {
"workspaceId": "f8113ba8-dd81-443e-811a-b385340f3f05",
"itemId": "8cee7699-2e81-4121-9a53-cc9025046193",
"referenceType": "ById"
},
"itemName": "lh_itemName",
"itemType": "Notebook",
"jobType": "SparkBatch",
"submittedDateTime": "2025-01-31T15:32:03Z",
"startDateTime": "2025-01-31T15:34:11Z",
"endDateTime": "2025-01-31T15:37:30Z",
"queuedDuration": {
"value": 1,
"timeUnit": "Seconds"
},
"runningDuration": {
"value": 180,
"timeUnit": "Seconds"
},
"totalDuration": {
"value": 360,
"timeUnit": "Seconds"
},
"jobInstanceId": "c2baabbd-5327-430c-87a6-ff4f98285601",
"creatorItem": {
"workspaceId": "f8113ba8-dd81-443e-811a-b385340f3f05",
"itemId": "8cee7699-2e81-4121-9a53-cc9025046193",
"referenceType": "ById"
},
"cancellationReason": "User cancelled the Spark batch",
"capacityId": "3c0cd366-dc28-4b6d-a525-4d415a8666e7",
"operationName": "Batch Livy Run",
"runtimeVersion": "1.3",
"livySessionItemResourceUri": "",
"driverMemory": 4,
"driverCores": 2,
"executorMemory": 8,
"executorCores": 4,
"numExecutors": 10,
"isDynamicAllocationEnabled": true,
"dynamicAllocationMaxExecutors": 20
}
]
}
Definitions
| Name | Description |
|---|---|
| Duration |
A duration. |
|
Entire |
Represents a tenant principal |
|
Error |
The error related resource details object. |
|
Error |
The error response. |
|
Error |
The error response details. |
|
Group |
Group specific details. Applicable when the principal type is |
|
Group |
Represents a security group. |
|
Group |
The type of the group. Additional group types may be added over time. |
|
Item |
An item reference by ID object. |
|
Item |
The item reference type. Additional |
|
Job |
Current state of the job. |
|
Livy |
The livy session response |
|
Livy |
The item type. Values are: |
|
Livy |
A paginated list of livy sessions. |
| Origin |
Origin of the job. |
|
Principal |
The type of the principal. Additional principal types may be added over time. |
|
Service |
Service principal specific details. Applicable when the principal type is |
|
Service |
Represents a Microsoft Entra service principal. |
|
Service |
Service principal profile details. Applicable when the principal type is |
|
Service |
Represents a service principal profile. |
| State |
Current state of the job. |
|
Time |
The unit of time for the duration. Additional duration types may be added over time. |
|
User |
User principal specific details. Applicable when the principal type is |
|
User |
Represents a Microsoft Entra user principal. |
Duration
A duration.
| Name | Type | Description |
|---|---|---|
| timeUnit |
The unit of time for the duration. Additional duration types may be added over time. |
|
| value |
number |
The number of timeUnits in the duration. |
EntireTenantPrincipal
Represents a tenant principal
| Name | Type | Description |
|---|---|---|
| displayName |
string |
The principal's display name. |
| id |
string (uuid) |
The principal's ID. |
| type |
string:
Entire |
The type of the principal. Additional principal types may be added over time. |
ErrorRelatedResource
The error related resource details object.
| Name | Type | Description |
|---|---|---|
| resourceId |
string |
The resource ID that's involved in the error. |
| resourceType |
string |
The type of the resource that's involved in the error. |
ErrorResponse
The error response.
| Name | Type | Description |
|---|---|---|
| errorCode |
string |
A specific identifier that provides information about an error condition, allowing for standardized communication between our service and its users. |
| message |
string |
A human readable representation of the error. |
| moreDetails |
List of additional error details. |
|
| relatedResource |
The error related resource details. |
|
| requestId |
string (uuid) |
ID of the request associated with the error. |
ErrorResponseDetails
The error response details.
| Name | Type | Description |
|---|---|---|
| errorCode |
string |
A specific identifier that provides information about an error condition, allowing for standardized communication between our service and its users. |
| message |
string |
A human readable representation of the error. |
| relatedResource |
The error related resource details. |
GroupDetails
Group specific details. Applicable when the principal type is Group.
| Name | Type | Description |
|---|---|---|
| groupType |
The type of the group. Additional group types may be added over time. |
GroupPrincipal
Represents a security group.
| Name | Type | Description |
|---|---|---|
| displayName |
string |
The principal's display name. |
| groupDetails |
Group specific details. Applicable when the principal type is |
|
| id |
string (uuid) |
The principal's ID. |
| type |
string:
Group |
The type of the principal. Additional principal types may be added over time. |
GroupType
The type of the group. Additional group types may be added over time.
| Value | Description |
|---|---|
| Unknown |
Principal group type is unknown. |
| SecurityGroup |
Principal is a security group. |
| DistributionList |
Principal is a distribution list. |
ItemReferenceById
An item reference by ID object.
| Name | Type | Description |
|---|---|---|
| itemId |
string (uuid) |
The ID of the item. |
| referenceType |
string:
By |
The item reference type. |
| workspaceId |
string (uuid) |
The workspace ID of the item. |
ItemReferenceType
The item reference type. Additional ItemReferenceType types may be added over time.
| Value | Description |
|---|---|
| ById |
The item is referenced by its ID. |
| ByVariable |
The item is referenced by a variable. |
JobType
Current state of the job.
| Value | Description |
|---|---|
| Unknown |
Job type is unknown. |
| SparkSession |
Job type is from a spark session. |
| SparkBatch |
Job type is from a spark batch. |
| JupyterSession |
Job type is from jupyter session. |
LivySession
The livy session response
| Name | Type | Description |
|---|---|---|
| attemptNumber |
integer |
Current attempt number. |
| cancellationReason |
string |
Reason for the job cancellation. |
| capacityId |
string (uuid) |
ID of the capacity. |
| consumerId | Principal: |
ID of the consumer. |
| creatorItem |
ID of the item creator. When |
|
| driverCores |
integer |
The number of CPU cores allocated to the Spark driver. Controls how much parallel processing the driver can handle. |
| driverMemory |
integer |
The amount of memory (in GB) assigned to the Spark driver process. Affects the driver's ability to handle job coordination and metadata. |
| dynamicAllocationMaxExecutors |
integer |
Sets the maximum number of executors that Spark's dynamic allocation can scale up to during job execution. |
| endDateTime |
string (date-time) |
Timestamp when the job ended in UTC, using the YYYY-MM-DDTHH:mm:ssZ format. |
| executorCores |
|
The number of CPU cores allocated to each Spark executor. Determines how many tasks each executor can run in parallel. |
| executorMemory |
integer |
The amount of memory (in GB) assigned to each Spark executor process. Impacts how much data can be processed in memory per executor. |
| isDynamicAllocationEnabled |
boolean |
Flag indicating whether dynamic allocation is enabled for the Spark job. |
| isHighConcurrency |
boolean |
Flag indicating high concurrency. |
| item |
ID of the item. |
|
| itemName |
string |
Name of the item. |
| itemType |
The item type. |
|
| jobInstanceId |
string (uuid) |
ID of the job instance. |
| jobType |
Current state of the job. |
|
| livyId |
string (uuid) |
ID of the Livy session or Livy batch. |
| livyName |
string |
Name of the Livy session or Livy batch. |
| livySessionItemResourceUri |
string |
The URI used to retrieve all Livy sessions for a given item. |
| maxNumberOfAttempts |
integer |
Maximum number of attempts. |
| numExecutors |
integer |
The total number of executors requested for the Spark job. Controls the parallelism and scalability of the job. |
| operationName |
string |
Name of the operation. Possible values include: Notebook run, Notebook HC run and Notebook pipeline run. |
| origin |
Origin of the job. |
|
| queuedDuration |
Duration for which the job was queued. |
|
| runningDuration |
Time it took the job to run. |
|
| runtimeVersion |
string |
The fabric runtime version. |
| sparkApplicationId |
string |
A Spark application ID is a unique identifier assigned to each Apache Spark application. It also appears in the Spark UI. |
| startDateTime |
string (date-time) |
Timestamp when the job started in UTC, using the YYYY-MM-DDTHH:mm:ssZ format. |
| state |
Current state of the job. |
|
| submittedDateTime |
string (date-time) |
Timestamp when the job was submitted in UTC, using the YYYY-MM-DDTHH:mm:ssZ format. |
| submitter | Principal: |
ID of the submitter. |
| totalDuration |
Total duration of the job. |
LivySessionItemType
The item type. Values are: Lakehouse, SparkJobDefinition, Notebook. Additional LivySessionItemType types may be added over time.
| Value | Description |
|---|---|
| Lakehouse |
Item is a lakehouse item. |
| SparkJobDefinition |
Item is a spark job definition item. |
| Notebook |
Item is a notebook item. |
LivySessions
A paginated list of livy sessions.
| Name | Type | Description |
|---|---|---|
| continuationToken |
string |
The token for the next result set batch. If there are no more records, it's removed from the response. |
| continuationUri |
string |
The URI of the next result set batch. If there are no more records, it's removed from the response. |
| value |
A list of livy sessions. |
Origin
Origin of the job.
| Value | Description |
|---|---|
| SubmittedJob |
Job is coming from submitted data source. |
| PendingJob |
Job is coming from pending data source. |
PrincipalType
The type of the principal. Additional principal types may be added over time.
| Value | Description |
|---|---|
| User |
Principal is a Microsoft Entra user principal. |
| ServicePrincipal |
Principal is a Microsoft Entra service principal. |
| Group |
Principal is a security group. |
| ServicePrincipalProfile |
Principal is a service principal profile. |
| EntireTenant |
Principal represents all tenant users. |
ServicePrincipalDetails
Service principal specific details. Applicable when the principal type is ServicePrincipal.
| Name | Type | Description |
|---|---|---|
| aadAppId |
string (uuid) |
The service principal's Microsoft Entra AppId. |
ServicePrincipalPrincipal
Represents a Microsoft Entra service principal.
| Name | Type | Description |
|---|---|---|
| displayName |
string |
The principal's display name. |
| id |
string (uuid) |
The principal's ID. |
| servicePrincipalDetails |
Service principal specific details. Applicable when the principal type is |
|
| type |
string:
Service |
The type of the principal. Additional principal types may be added over time. |
ServicePrincipalProfileDetails
Service principal profile details. Applicable when the principal type is ServicePrincipalProfile.
| Name | Type | Description |
|---|---|---|
| parentPrincipal | Principal: |
The service principal profile's parent principal. |
ServicePrincipalProfilePrincipal
Represents a service principal profile.
| Name | Type | Description |
|---|---|---|
| displayName |
string |
The principal's display name. |
| id |
string (uuid) |
The principal's ID. |
| servicePrincipalProfileDetails |
Service principal profile details. Applicable when the principal type is |
|
| type |
string:
Service |
The type of the principal. Additional principal types may be added over time. |
State
Current state of the job.
| Value | Description |
|---|---|
| InProgress |
Job is in running or is cancelling state. |
| Cancelled |
Job got cancelled. |
| NotStarted |
Job is queued, is starting or in library packaging state. |
| Succeeded |
Job has stopped or is in success state. |
| Failed |
Job failed or its session timed out. |
| Unknown |
Job is in invalid state. |
TimeUnit
The unit of time for the duration. Additional duration types may be added over time.
| Value | Description |
|---|---|
| Seconds |
Duration in seconds. |
| Minutes |
Duration in minutes. |
| Hours |
Duration in hours. |
| Days |
Duration in days. |
UserDetails
User principal specific details. Applicable when the principal type is User.
| Name | Type | Description |
|---|---|---|
| userPrincipalName |
string |
The user principal name. |
UserPrincipal
Represents a Microsoft Entra user principal.
| Name | Type | Description |
|---|---|---|
| displayName |
string |
The principal's display name. |
| id |
string (uuid) |
The principal's ID. |
| type |
string:
User |
The type of the principal. Additional principal types may be added over time. |
| userDetails |
User principal specific details. Applicable when the principal type is |