Coder Social home page Coder Social logo

jpalo / gatsby-source-azure-storage Goto Github PK

View Code? Open in Web Editor NEW

This project forked from danieloliver/gatsby-source-azure-storage

0.0 0.0 0.0 1.26 MB

Source plugin for pulling data into Gatsby from Azure Storage.

Home Page: https://www.npmjs.com/package/gatsby-source-azure-storage

License: MIT License

JavaScript 100.00%

gatsby-source-azure-storage's Introduction

gatsby-source-azure-storage

Source plugin for pulling data into Gatsby from Azure Storage. Wrapper around Azure-Storage-Node

How to use

// In your gatsby-config.js
module.exports = {
  plugins: [
    {
      resolve: "gatsby-source-azure-storage",
      options: {
        tables: [
          {
            name: "<tableName1>"
          },
          {
            name: "<tableName2>",
            type: "<tableNameTypeLabel2>"
          }
        ],
        containers: [
          {
            name: "<containerName1>",
            // If defined, downloads the blobs in this container to this folder.
            localFolder: 'test2'
          }
        ],
        // If defined, downloads the blobs in all containers above (unless overriden on the container) to this folder.
        containerLocalFolder: 'test'
      },
    }
  ],
}

Environment variables

  • AZURE_STORAGE_ACCOUNT and AZURE_STORAGE_ACCESS_KEY
  • or
  • AZURE_STORAGE_CONNECTION_STRING.

Example: reading table from Azure Storage

screenshot

gatsby-config.js looks like this:

module.exports = {
  plugins: [
    {
      resolve: "gatsby-source-azure-storage",
      options: {
        tables: [
          {
            name: "meetup"
          },
          {
            name: "events",
            type: "eventTypeName"
          }
        ],
        containers: [
          {
            name: "container1",
            // If defined, downloads the files in this container to this folder.
            localFolder: 'test2'
          }
        ],
        // If defined, downloads the files in all containers (unless overriden on the container) to this folder.
        containerLocalFolder: 'test'
      },
    }
  ]
}

Below is a sample query for fetching the above table's rows, as well as the other metadata available.

query exampleQuery {
  allMeetup {
    edges {
      node {
        PartitionKey
        RowKey
        LastEventsQueriedUTC
        LastQueriedUTC
        Timestamp
        FullName
        MembersCount
        City
        State
        Country
        Timezone
        Link
        id
      }
    }
  }
  allAzureContainer {
    edges {
      node {
        id
        name
        localFolder
      }
    }
  }
  allAzureTable {
    edges {
      node {
        name
        type
        id
      }
    }
  }
  allAzureBlob {
    edges {
      node {
        id
        localPath
        name
        container
        contentMD5
        blobType
        creationTime
        lastModified
      }
    }
  }
}

gatsby-source-azure-storage's People

Contributors

danieloliver avatar jpalo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.