/demo-apimanagement

Demo Repository for API Management

Primary LanguageShellMIT LicenseMIT

Definition: A service capability that allows api's to be published, managed, secured, and analyzed in minutes.

Use Cases: The most common Uses Cases for the the Service.

  1. Enterprise API Catalog -- Expose API's for internal/external developers and provide them with a place to discover, learn and consume your API's.
  2. Customer and Partner Integration -- Expose API's to customer/partners and create a digital ecosystem that benefits the business
  3. Mobile Enablement and IoT -- Expose API's "securely" to millions of devices and protect them from misuse and abuse.
  4. API's as a business -- API's may be the sole product sold. Discover, usage stats and monetization.
  5. Microservice Gateway -- API gateway to decouple a frontend from microservices and do things like HTTPS offloading, request orchestration and API transformation. Portal)

Customer Story:

EarthNetworks - Making weather data available to customers through cloud-based applications and application programming interfaces.

Developer Portal - https://developer.earthnetworks.com

  1. Developer Portal

    • Read Documentation
    • Interact with API's
    • Accounts and API Keys
    • ANalytics on personal usage
  2. Gateway

    • Receives API calls and routes them.
    • Vaidates Keys and Tokens
    • Enforce quotas and limits
    • Transforms definitions real time
    • Caches responses
    • Logging
  3. Publisher Portal (Azure Portal)

    • Define API's
    • Package API's into logical groupings
    • Set policies
    • Analytics
    • Manage Users of API's

API Source Code Samples

OpenSpec API Sample Code PreCompiled CRUD Serverless Function Sample Code

Deploy API Management:

Deploy API Samples:

# Set Variables up
# ----------------

Resource_Group="demo"
Prefix="75098"
Registry="danielscholl"
Code="https://github.com/danielscholl/demo-apimanagement-funcapp.git"


# API in Container
# ----------------

az container create --name "${Prefix}-api" \
	--resource-group ${Resource_Group} \
	--image "${Registry}/demoapi" \
	--dns-name-label "${Prefix}-api" \
	--ports 80


# API in Function App
# --------------------

az storage account create --name "${Prefix}storage" \
    --resource-group ${Resource_Group} \
    --sku Standard_LRS \
    --location eastus2 

az functionapp create --name "${Prefix}-funcapp" \
    --resource-group ${Resource_Group} \
    --storage-account  "${Prefix}storage" \
    --deployment-source-url ${Code}  \
    --consumption-plan-location eastus2

az functionapp config appsettings set --name "${Prefix}-funcapp" \
    --resource-group ${Resource_Group} \
    --settings FUNCTIONS_EXTENSION_VERSION=beta

Test API Samples:

# Set Variables up
# ----------------
API="https://${Prefix}-funcapp.azurewebsites.net/api"

# Test Ping/Pong
curl ${API}/ping

# Test TODO
curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X POST -d "{'tododescription': 'hello-world'}" ${API}/todo
curl ${API}/todo