For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
      • AstroFully-managed data operations, powered by Apache Airflow.
      • Astro Private CloudRun Airflow-as-a-service in your environment.
      • Professional ServicesExpert Airflow services for your enterprise's success.
    • Tools
      • Cosmos
      • Orbiter
      • CLI
      • AI SDK
      • Agents
      • Blueprint
      • UpdatesThe State of Airflow 2026See the insights from over 5,800 data practitioners in the full report. Download Now ➔
  • Customers
  • Docs
    • Insights
      • Blog
      • Webinars
      • Resource Library
      • Events
    • Education
      • Academy
      • What is Airflow?
  • Pricing
Get Started Free
    • Overview
      • Overview
          • DAG factory
          • PyCharm local development
          • VS Code local development
          • Object storage tutorial
          • SQL data quality
          • Custom Airflow UI docs tutorial
          • Operator extra link tutorial
          • Cloud IDE tutorial
          • ETL datasets
      • Glossary
    • Glossary

Product

  • Platform Overview
  • Astro
  • Astro Observe
  • Astro Private Cloud
  • Security & Trust
  • Pricing

Tools & Services

  • Cosmos
  • Docs
  • Professional Services
  • Product Updates

Use Cases

  • AI Ops
  • Data Observability
  • ETL/ELT
  • ML Ops
  • Operational Analytics
  • All Use Cases

Industries

  • Financial Services
  • Gaming
  • Retail
  • Manufacturing
  • Healthcare
  • All Industries

Resources

  • Academy
  • eBooks & Guides
  • Blog
  • Webinars
  • Events
  • The Data Flowcast Podcast
  • All Resources

Airflow

  • What is Airflow
  • Airflow on Astro
  • Airflow 3.0
  • Airflow Upgrades
  • Airflow Use Cases
  • Airflow 2.x End of Life

Company

  • Our Story
  • Customers
  • Newsroom
  • Careers
  • Contact

Support

  • Knowledge Base
  • Status
  • Contact Support
GitHubYouTubeLinkedInx
  • Legal
  • Privacy
  • Terms of Service
  • Consent Preferences

  • Do Not Sell or Share My Personal information
  • Limit the Use Of My Sensitive Personal Information

Apache Airflow®, Airflow, and the Airflow logo are trademarks of the Apache Software Foundation. Copyright © Astronomer 2026. All rights reserved.

LogoLogo
On this page
  • Before you start
  • Write Airflow code with VS Code
  • See also
Airflow 2.xTutorialsWrite DAGs

Develop Airflow DAGs locally with VS Code

Edit this page
Built with

This example shows how to set up VS Code for local development with Airflow and the Astro CLI. Setting up a local development environment allows you to iterate more quickly when developing DAGs by taking advantage of IDE features like code autocompletion, identifying deprecated or unused imports, and error and warning syntax highlighting.

Before you start

Before trying this example, make sure you have:

  • VS Code
  • The Dev Containers VS Code extension
  • The Astro CLI
  • An Astro project running locally on your computer. See Getting started with the Astro CLI

Write Airflow code with VS Code

Follow these steps to start writing your DAGs in VS Code.

  1. Open the folder containing your Astro Project in VS Code. In the bottom left corner of your VS Code window, click the green containers icon and select Open Folder in Container...

    Open Folder

  2. The Finder/File Explorer will open prompting you to select the project folder. Ensure that your Astro project is selected and click Open, then From ‘Dockerfile’.

    A new VS Code window appears. Note in the lower left corner of the window that your IDE is now pointing to that running Docker container.

  3. Install the Python Extension to your new session of VS Code. Go to the Extensions nav bar option, search for Python, and the first result should be the extension published by Microsoft. Install it by clicking the button Install in Container <your container name>.

    Extension

  4. Ensure the Python interpreter is configured properly by opening the dags/example_dag_basic.py file in your Astro project dags/ folder and start writing some Python.

After you configure the integration, VScode starts showing warnings and autocompletion suggestions for Airflow. In the example below, you can see that the Python interpreter is attempting to auto-complete the import line.

Code

See also

  • Develop with PyCharm
  • Debug interactively with dag.test()