Azure Synapse Analytics SparkSession API

The SparkSession API from Azure Synapse Analytics — 4 operation(s) for sparksession.

Documentation

📖
Documentation
https://learn.microsoft.com/en-us/rest/api/synapse/workspace
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/synapse/sqlpools
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/synapse/bigdatapool
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/synapse/data-plane/pipeline
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/synapse/data-plane/spark
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/synapse/data-plane/monitoring
📖
Documentation
https://learn.microsoft.com/en-us/azure/synapse-analytics/synapse-link/
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/synapse/data-plane/role-assignments
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/synapse/data-plane/notebook
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/synapse/data-plane/dataset
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/synapse/data-plane/linked-service
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/synapse/data-plane/data-flow
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/synapse/data-plane/sql-script
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/synapse/data-plane/trigger
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/synapse/data-plane/spark-job-definition
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/synapse/data-plane/managed-private-endpoints
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/synapse/data-plane/integration-runtimes
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/synapse/data-plane/library
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/synapse/data-plane/git-integration
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/synapse/ip-firewall-rules
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/synapse/keys
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/synapse/private-endpoint-connections
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/synapse/private-link-hubs
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/synapse/kusto-pools
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/synapse/azure-ad-only-authentications
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/synapse/data-plane/spark-configuration
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/synapse/data-plane/data-flow-debug-session
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/synapse/data-plane/credential
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/synapse/data-plane/kql-script
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/synapse/data-plane/link-connection

Specifications

Schemas & Data

📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/microsoft-azure-synapse-analytics/refs/heads/main/json-schema/azure-synapse-analytics-workspace-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/microsoft-azure-synapse-analytics/refs/heads/main/json-schema/azure-synapse-analytics-sql-pool-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/microsoft-azure-synapse-analytics/refs/heads/main/json-schema/azure-synapse-analytics-spark-pool-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/microsoft-azure-synapse-analytics/refs/heads/main/json-schema/azure-synapse-analytics-pipeline-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/microsoft-azure-synapse-analytics/refs/heads/main/json-schema/azure-synapse-analytics-spark-batch-job-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/microsoft-azure-synapse-analytics/refs/heads/main/json-schema/azure-synapse-analytics-role-assignment-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/microsoft-azure-synapse-analytics/refs/heads/main/json-schema/azure-synapse-analytics-notebook-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/microsoft-azure-synapse-analytics/refs/heads/main/json-schema/azure-synapse-analytics-dataset-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/microsoft-azure-synapse-analytics/refs/heads/main/json-schema/azure-synapse-analytics-linked-service-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/microsoft-azure-synapse-analytics/refs/heads/main/json-schema/azure-synapse-analytics-trigger-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/microsoft-azure-synapse-analytics/refs/heads/main/json-schema/azure-synapse-analytics-firewall-rule-schema.json

Other Resources

OpenAPI Specification

microsoft-azure-synapse-analytics-sparksession-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Azure Synapse Analytics - Access Control AzureADOnlyAuthentications SparkSession API
  description: Manage role assignments, role definitions, and access control for Synapse workspace resources. Supports Synapse role-based access control for fine-grained permissions.
  version: '2020-12-01'
  contact:
    name: Microsoft Azure Support
    url: https://azure.microsoft.com/en-us/support/
  license:
    name: Microsoft
    url: https://azure.microsoft.com/en-us/support/legal/
servers:
- url: https://{workspaceName}.dev.azuresynapse.net
  description: Synapse Data Plane
  variables:
    workspaceName:
      description: The workspace name.
      default: myworkspace
security:
- azure_auth:
  - user_impersonation
tags:
- name: SparkSession
paths:
  /livyApi/versions/{sparkPoolName}/sessions:
    get:
      operationId: SparkSession_GetSparkSessions
      summary: Azure Synapse Analytics List Spark sessions
      description: List all Spark sessions running against the Spark pool.
      tags:
      - SparkSession
      parameters:
      - $ref: '#/components/parameters/SparkPoolNameParameter'
      - name: from
        in: query
        schema:
          type: integer
      - name: size
        in: query
        schema:
          type: integer
      - name: detailed
        in: query
        schema:
          type: boolean
      responses:
        '200':
          description: Successfully retrieved the list of sessions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SparkSessionCollection'
        default:
          description: Error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
    post:
      operationId: SparkSession_CreateSparkSession
      summary: Azure Synapse Analytics Create a Spark session
      description: Create new Spark session.
      tags:
      - SparkSession
      parameters:
      - $ref: '#/components/parameters/SparkPoolNameParameter'
      - name: detailed
        in: query
        schema:
          type: boolean
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SparkSessionOptions'
      responses:
        '200':
          description: Successfully created the session.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SparkSession'
        default:
          description: Error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /livyApi/versions/{sparkPoolName}/sessions/{sessionId}:
    get:
      operationId: SparkSession_GetSparkSession
      summary: Azure Synapse Analytics Get a Spark session
      description: Gets a single Spark session.
      tags:
      - SparkSession
      parameters:
      - $ref: '#/components/parameters/SparkPoolNameParameter'
      - name: sessionId
        in: path
        required: true
        schema:
          type: integer
      - name: detailed
        in: query
        schema:
          type: boolean
      responses:
        '200':
          description: Successfully retrieved the session.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SparkSession'
        default:
          description: Error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
    delete:
      operationId: SparkSession_CancelSparkSession
      summary: Azure Synapse Analytics Cancel a Spark session
      description: Cancels a running Spark session.
      tags:
      - SparkSession
      parameters:
      - $ref: '#/components/parameters/SparkPoolNameParameter'
      - name: sessionId
        in: path
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: Successfully cancelled the session.
        default:
          description: Error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /livyApi/versions/{sparkPoolName}/sessions/{sessionId}/statements:
    get:
      operationId: SparkSession_GetSparkStatements
      summary: Azure Synapse Analytics List Spark session statements
      description: Gets a list of statements within a Spark session.
      tags:
      - SparkSession
      parameters:
      - $ref: '#/components/parameters/SparkPoolNameParameter'
      - name: sessionId
        in: path
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: Successfully retrieved the statements.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SparkStatementCollection'
        default:
          description: Error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
    post:
      operationId: SparkSession_CreateSparkStatement
      summary: Azure Synapse Analytics Create a Spark statement
      description: Create a statement within a Spark session.
      tags:
      - SparkSession
      parameters:
      - $ref: '#/components/parameters/SparkPoolNameParameter'
      - name: sessionId
        in: path
        required: true
        schema:
          type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SparkStatementOptions'
      responses:
        '200':
          description: Successfully created the statement.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SparkStatement'
        default:
          description: Error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /livyApi/versions/{sparkPoolName}/sessions/{sessionId}/statements/{statementId}/cancel:
    post:
      operationId: SparkSession_CancelSparkStatement
      summary: Azure Synapse Analytics Cancel a Spark statement
      description: Kill a statement within a session.
      tags:
      - SparkSession
      parameters:
      - $ref: '#/components/parameters/SparkPoolNameParameter'
      - name: sessionId
        in: path
        required: true
        schema:
          type: integer
      - name: statementId
        in: path
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: Successfully cancelled the statement.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SparkStatementCancellationResult'
        default:
          description: Error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    SparkStatementOptions:
      type: object
      properties:
        code:
          type: string
          description: The code to execute.
        kind:
          type: string
          description: The language of the code.
          enum:
          - spark
          - pyspark
          - dotnetspark
          - sql
    SparkStatementCollection:
      type: object
      properties:
        total:
          type: integer
        statements:
          type: array
          items:
            $ref: '#/components/schemas/SparkStatement'
    SparkStatementCancellationResult:
      type: object
      properties:
        msg:
          type: string
          description: The cancellation message.
    SparkSessionCollection:
      type: object
      properties:
        from:
          type: integer
        total:
          type: integer
        sessions:
          type: array
          items:
            $ref: '#/components/schemas/SparkSession'
    SparkSessionOptions:
      type: object
      required:
      - name
      properties:
        name:
          type: string
        driverMemory:
          type: string
        driverCores:
          type: integer
        executorMemory:
          type: string
        executorCores:
          type: integer
        executorCount:
          type: integer
        conf:
          type: object
          additionalProperties:
            type: string
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
    SparkStatement:
      type: object
      properties:
        id:
          type: integer
        code:
          type: string
        state:
          type: string
        output:
          type: object
          properties:
            status:
              type: string
            executionCount:
              type: integer
            data:
              type: object
    SparkSession:
      type: object
      properties:
        livyInfo:
          type: object
          properties:
            currentState:
              type: string
        name:
          type: string
        workspaceName:
          type: string
        sparkPoolName:
          type: string
        submitterName:
          type: string
        state:
          type: string
        id:
          type: integer
        appId:
          type: string
        appInfo:
          type: object
          additionalProperties:
            type: string
        log:
          type: array
          items:
            type: string
  parameters:
    SparkPoolNameParameter:
      name: sparkPoolName
      in: path
      required: true
      description: Name of the Spark pool.
      schema:
        type: string
  securitySchemes:
    azure_auth:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: https://login.microsoftonline.com/common/oauth2/authorize
          scopes:
            user_impersonation: impersonate your user account