Azure Databricks · Arazzo Workflow

Azure Databricks Create a Directory and Import a Notebook

Version 1.0.0

Make a workspace directory, import a notebook into it, then verify it.

1 workflow 1 source API 1 provider
View Spec View on GitHub AnalyticsApache SparkBig DataData EngineeringMachine LearningArazzoWorkflows

Provider

microsoft-azure-databricks

Workflows

create-directory-and-import-notebook
Create a workspace directory, import a notebook, and list to verify.
Calls createWorkspaceDirectory, importWorkspaceObject, then listWorkspaceObjects to confirm the notebook landed.
3 steps inputs: content, directoryPath, language, notebookPath, token outputs: directoryPath, notebookPath, objects
1
createDirectory
createWorkspaceDirectory
Create the workspace directory and all necessary parent directories recursively.
2
importNotebook
importWorkspaceObject
Import the base64-encoded notebook content into a path under the new directory, overwriting any existing object.
3
listDirectory
listWorkspaceObjects
List the directory contents to confirm the imported notebook is present.

Source API Descriptions

Arazzo Workflow Specification

azure-databricks-create-directory-and-import-notebook-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Azure Databricks Create a Directory and Import a Notebook
  summary: Make a workspace directory, import a notebook into it, then verify it.
  description: >-
    Scaffolds a workspace folder and seeds it with a notebook. The workflow
    creates the directory recursively, imports base64-encoded notebook content
    into a path under that directory, and lists the directory to confirm the
    notebook is present. Every step spells out its request inline so the flow
    can be read and executed without opening the underlying OpenAPI
    description.
  version: 1.0.0
sourceDescriptions:
- name: azureDatabricksApi
  url: ../openapi/azure-databricks-openapi.yml
  type: openapi
workflows:
- workflowId: create-directory-and-import-notebook
  summary: Create a workspace directory, import a notebook, and list to verify.
  description: >-
    Calls createWorkspaceDirectory, importWorkspaceObject, then
    listWorkspaceObjects to confirm the notebook landed.
  inputs:
    type: object
    required:
    - token
    - directoryPath
    - notebookPath
    - content
    - language
    properties:
      token:
        type: string
        description: Databricks personal access token for the Authorization header.
      directoryPath:
        type: string
        description: Absolute path of the workspace directory to create.
      notebookPath:
        type: string
        description: Absolute path (under the directory) to import the notebook to.
      content:
        type: string
        description: Base64-encoded notebook source content (max 10 MB).
      language:
        type: string
        description: Notebook language, one of SCALA, PYTHON, SQL, or R.
  steps:
  - stepId: createDirectory
    description: >-
      Create the workspace directory and all necessary parent directories
      recursively.
    operationId: createWorkspaceDirectory
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.token
    requestBody:
      contentType: application/json
      payload:
        path: $inputs.directoryPath
    successCriteria:
    - condition: $statusCode == 200
  - stepId: importNotebook
    description: >-
      Import the base64-encoded notebook content into a path under the new
      directory, overwriting any existing object.
    operationId: importWorkspaceObject
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.token
    requestBody:
      contentType: application/json
      payload:
        path: $inputs.notebookPath
        format: SOURCE
        language: $inputs.language
        content: $inputs.content
        overwrite: true
    successCriteria:
    - condition: $statusCode == 200
  - stepId: listDirectory
    description: >-
      List the directory contents to confirm the imported notebook is present.
    operationId: listWorkspaceObjects
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.token
    - name: path
      in: query
      value: $inputs.directoryPath
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      objects: $response.body#/objects
  outputs:
    directoryPath: $inputs.directoryPath
    notebookPath: $inputs.notebookPath
    objects: $steps.listDirectory.outputs.objects