GithubHelp home page GithubHelp logo

invoiceman's Introduction

InvoiceMan

This demonstrates how to read the list of invoices from an Azure subscription

InvoiceMan can be deployed outside the subscription where invoices are read since it uses a Service Principal to retrieve invoices.

The list of invoices retrieved are limited to Azure Web-Direct subscriptions

Running Locally

Download the code and dependencies

git clone [email protected]:jasoncabot-ms/invoiceman.git
npm install

Ensure you have set up a service principal and entered ClientID and ClientSecret in the application settings

Create a local.settings.json file in the root of the project with appropriate values, for example:

{
  "IsEncrypted": false,
  "Values": {
    "FUNCTIONS_WORKER_RUNTIME": "node",
    "AzureWebJobsStorage": "{AzureWebJobsStorage}",
    "TenantDomain": "******",
    "SubscriptionID": "******",
    "ClientID": "******",
    "ClientSecret": "******"
  }
}

Start the development server

npm start

Navigate to http://localhost:7071/api/GetInvoiceStatus

This will attempt to read the list of invoices in the SubscriptionID authenticated in the TenantDomain using the Service Principal ClientID and ClientSecret

Running in Production

The following commands will create a production build

git clone [email protected]:jasoncabot-ms/invoiceman.git
npm install
npm package

This will output the following structure which can be uploaded to a function app in Azure Functions

./dist/
  └── GetInvoiceStatus
      ├── function.json
      └── index.js

Subscription Setup

InvoiceMan consists of two (or more) subscriptions.

The first owns the resources used to read the invoice data from multiple other subscriptions and is known as the Reader

The second is the subscription that owns the invoices that will be read and is known as the Generator

In order for the Reader to access the invoices in the Generator, you must create a Service Principal associated with the Billing Reader role inside the Generator subscription.

Create a Service Principal with access to Invoices

invoiceman's People

Contributors

dependabot[bot] avatar jasoncabot-ms avatar

Watchers

 avatar  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.