Coder Social home page Coder Social logo

olsoro0 / saas-metered-demo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from msalemcode/saas-metered-demo

0.0 0.0 0.0 710 KB

Demo for Azure Marketplace Simple Landing page with Metered function enabled

C# 67.60% HTML 27.46% CSS 4.36% JavaScript 0.58%

saas-metered-demo's Introduction

SaaS-Metered-Demo

This is a simple demo for Azure OCR scanning function with Landing page capability as a Microsoft Azure Marketplace SaaS offer with Metered feature enables.

This code exists to show exercising the client library used.

Demo Diagram

SaaS Metered

The demo consist of the following componets

  1. Azure Web App: To demo Azure OCR scanning function and Landing code
  2. Azure CosmosDB: To store OCR transcations in database
  3. Azure Function: TO emit metered data to Azure Marketplace

Prerequisites

  1. Create Azure Compute Vision Account
  2. Create Azure CosmosDB

Running Locally

Before running the application locally the following configuration should be in place.

  1. MeteredPage: update the appsettings.json with the following configuration for ApplicationID and Secrets, Cosmosdb configuration and Azure OCR configuration
{
  "AzureAd": {
    "Instance": "https://login.microsoftonline.com/",
    "Domain": "YOUR_DOMAIN",
    "TenantId": "TENANT_ID",
    "ClientId": "CLIENT_ID",
    "ClientSecret": "CLIENT_SECRET",
    "CallbackPath": "/signin-oidc",
    "SignedOutCallbackPath ": "/signout-callback-oidc"
  },
  "MarketplaceApi": {
    "ClientId": "CLIENT_ID",
    "ClientSecret": "CLIENT_SECRET",
    "TenantId": "YOUR_TENANT_ID"
  },
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft": "Warning",
      "Microsoft.Hosting.Lifetime": "Information"
    }
  },
  "AllowedHosts": "*",
  "subscriptionKey": "AZURE_OCR_SUB_KEY",
  "ocrEndPoint": "AZURE_OCR_END_POINT_URI",
  "CosmosDb": {
    "Account": "AZURE_COSMOSDB_ACCOUNT_END_POINT_URI",
    "Key": "AZURE_COSMOSDB_ACCOUNT_KEY",
    "DatabaseName": "AZURE_COSMOSDB_DATABASE",
    "ContainerName": "AZURE_COSMOSDB_CONTAINER"
  }
}
  1. AzureFunction:
  • Rename local.settings-RenameMe.json to local.settings.json
  • Update the file with the following configuration
    "IsEncrypted": false,
    "Values": {
        "AzureWebJobsStorage": "UseDevelopmentStorage=true",
        "FUNCTIONS_WORKER_RUNTIME": "dotnet",
        
        "CosmosDb_Key": "AZURE_COSMOSDB_ACCOUNT_KEY",
        "CosmosDb_Uri": "AZURE_COSMOSDB_ACCOUNT_END_POINT_URI",
        "CosmosDb_Database": "AZURE_COSMOSDB_DATABASE",
        "CosmosDb_Collection": "AZURE_COSMOSDB_CONTAINER",

        "TenantId": "TENANT_ID",
        "ClientId": "CLIENT_ID",
        "ClientSecret": "CLIENT_SECRET",
        "Scope": "20e940b3-4c77-4b0b-9a53-9e16a1b010a7/.default"
    }

saas-metered-demo's People

Contributors

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