Tuesday 10 July 2018

API Management by Microsoft Azure

Microsoft on Azure is one of several API management/governance vendors I evaluated.
“Publish, manage, secure, and analyze your APIs in minutes” is Microsoft’s tag line atMicrosoft’s API Management home page (Service Overview).
Microsoft’s service is based on its October 23, 2013 acquisition of APIphany (based in Wash. DC).
Documentation is published from markup text in a GitHub which directs people to theclassic portal at manage.windowsazure.com rather than the newer portal.azure.com site using Azure Resource Manager (ARM).
NOTE: There is no Issues tab in their GitHub.

Create Publisher portal

  1. Get a Microsoft Azure account
  2. Create a Resource (Free trial)
  3. Specify Scale: Developer or Standard.
    Standard tier can go up to 4 instances to handle 800 million calls/month. QUESTION: No auto-scaling?
  4. TODO: Custom SSL cert
  5. TODO: Custom domain (developer.itworks.com)

Create service

  1. Select service:
    azure-api-create-2154x508
  2. Click Create.
  3. Specify the prefix to .azure-api.net (such as itw1).
  4. Select subscription (Free Trial, etc.).
  5. Select Region.
  6. Specify Organization name.
  7. Specify Administrator Email.
  8. Click check icon.
  9. Use browser to visit the page, such as https://itw1.portal.azure-api.net
  10. Edit look and feel by clicking on the edit icon at the upper left.
    api-azure-styling
  11. TODO: Edit site title (instead of “Azure Api Management API”).
    api-azure-admin

Create Gateway

  1. Click Import API in publisher portal dashboard.
  2. Select From URL.
  3. Select Specification format: Swagger (no RAML).
  4. In Specification document URL field, paste http://calcapi.cloudapp.net/calcapi.json.
  5. Provide a Web API URL suffix, e.g. ‘calc’.
  6. Type ‘Starter’ in the products field to add your API to the ‘Starter’ product.
    NOTICE:
  7. Click Save.
  8. Click Operations tab.
    Notice the GET Add, Divide, Multiply, Substract two integers.

Policy scope

  • Policy statements
  • Allow cross domain calls
  • Authenticate with Basic
  • Authenticate with client certificate
  • Check HTTP header
  • Control flow
  • Convert JSON to XML
  • Convert XML to JSON
  • CORS
  • Find and replace string in body
  • Forward request to backend service
  • Get from cache
  • Get value from cache
  • JSONP
  • Limit call rate per key
  • Limit call rate per subscription
  • Log to EventHub
  • Mask URLs in content
  • Remove value from cache
  • Restrict caller IPs
  • Return response
  • Rewrite URL
  • Send one way request
  • Send request
  • Set backend service
  • Set body
  • Set context variable
  • Set HTTP header
  • Set query string parameter
  • Set request method
  • Set status code
  • Set usage quota per key
  • Set usage quota per subscription
  • Store to cache
  • Store value in cache
  • Validate JWT
  • Wait for…
Examples:
  • Hide response data based on product name.policy.xml
  • Pre-authorize requests using validate-jwt.policy.xml
  • Send context information to the backend service.policy.xml
  • Set cache duration using cache control header.policy.xml

Open the developer portal

  1. Click on APIs.
  2. Pick Calculator API from the list on the left.
  3. Click on Open Console for any API.
  4. In the console, enter values for the parameters and hit the HTTP button.
  5. Search
    NOTE: API Management is in category “Web + Mobile”.
“Take any API and publish it to developers and partners in minutes
  • Provide API documentation and an interactive console
  • Throttle, rate limit and quota your APIs
  • Monitor the health of your APIs and quickly identify errors
  • Bring modern formats like JSON and REST to existing APIs
  • Connect to on-premises systems and publish globally
  • Gain analytic insights on how your APIs are being used
  • Service Overview
  • Getting Started
  • Documentation
  1. Click Create to open a new window.
When created, the Echo API is created as a sample.

Authentication

Developer Portal Setup

  1. Add discussion board and ratings

Swagger import

A Swagger 2.0 doc can be imported, but the doc MUST contain Host, BasePath, Schemes properties. Otherwise, it won’t get imported: No message. It just hangs with “working..”.

Analytics:

In the Summary graph, detail for a point in time can be obtained with mouse-over:
  • Response time (in ms)
  • Bandwidth usage KB
  • Successful? Popular === Volume of calls.
  • Errors === Number of calls blocked due to limits?
Notice the pre-defined filters for Today, yesterday, Last 7 Days, Last 30 Days, Last 90 Days
Activity chart provides reports that drill down on the specific activity by developer, product, API, and operation.
What about:
  • Specific translations performed
  • Specific policies violated
  • metrics by geography
  • Correlation of two metrics (response time vs bandwidth scattergram)
  • Issues over time

Videos

My recommendation for the sequence to view videos about API Management
  1. Introducing Azure API Management TechEd North America 2014 by Josh Twist (@joshtwist)
    • Business models
    • Engaging developers: Time to First Successful call
    • Make legacy API (SOAP XML) modern (REST JSON)
    • Understand their behavior with monitoring
  2. Microsoft Azure API Management Master Class: In Depth for Fun and Profit at TechEd North America 2014 by Anton Babadjanov | antonba@ | @antonbaa | https://www.linkedin.com/in/anton-babadjanov-44501b9 and Vlaimir Vinogradsky | vlvinogr@
    This explores the end-to-end workflow of launching a “treasure hunt” API and play a game with it. We’ll also take a peek at what the future holds for this exciting new Azure service.
  3. Azure Api Management by Ajay Solanki
  4. Response: { “statusCode”: 404, “message”: “Resource not found” }
  5. Configure your API Management instance using Git 03-12-2016 by Anton Babadjanov | @antonbaa | https://www.linkedin.com/in/anton-babadjanov-44501b9 Access and modify the configuration of your API Management instance using Git. Configure Security > Configuration: This enables scenarios:
    • Managing multiple configuration versions
    • Syncing the configuration of multiple tenants
    • Utilizing the Git workflow for collaborative editing
    • Text-file based configuration for flexibility
  6. API or No API - On Cloud Feb 23, 2016 By: Lachezar Arabadzhiev, Jef King Take reads off data store. Have a worker rule read out From a SQL database every 30 secs to stick into blob storage with CDN fed to users.
  7. API Management in under 5 minutes 06-16-2014 Shows the classic portal to https://wellmark1.portal.azure-api.net/ This video shows how Wellmark Blue Cross & Blue Shield use Azure API Management to accelerate their partners in adopting the Wellmark API,
  8. In this episode Chris Risner is joined by Vlad Vinogradsky, Principal Program Manager on the Azure API Management Team. Vlad joins us to talk about some of the latest features…
  9. In this episode Chris Risner and Haishi Bai are joined by Stephen Siciliano, Program Manager on Azure App Service. Stephen joins us to demonstrate Logic Apps.
  10. Getting Started with Azure API Management REST API 12-01-2014 Azure API Management provides a REST API for performing operations on selected entities, such as APIs, users, groups, products, and subscriptions. The API can be used fo…
  11. Integrate Azure API Management with Event Hubs Nov 09, 2015 at 2:01PM By: Miao Jiang This video demonstrates how to use the log-to-eventhub policy to build a custom dashboard with Azure Stream Analytics and PowerBI.

Social media:

Conferences

#integrate2016 conference

Partners

@KloudSolutions
{version}/{entity-set}/{id}/{property}

V1/user/cd1311/files
APIMatic
AutoRest
@infront
@SixPivot

Scalability

Pricing

Stars

Jorge Arteiro
Matthew Snider [masnider@MSFT]

App Fabric Instead

Build your own.
Microsoft Service Fabric (in GA April 2016) has several free “party” clusters that last for less than 4 hours each.
Service Fabric programming model focus on:
  • Reliable Actors,
  • Reliable Services,
  • custom application orchestration, and
  • Service Fabric management tasks.
In order to build and run Azure Service Fabric applications on your development machine, you need to install the runtime, SDK, and tools. You also need to enable execution of the Windows PowerShell 3.0 scripts included in the SDK.
To use Service Fabric PowerShell cmdlets on Windows 7, which includes Windows PowerShell 2.0 by default, download the Windows Management Framework 5.0 which includes PowerShell 3.0 as well as Desired State Configuration (DSC), Windows Remote Management (WinRM), Windows Management Instrumentation (WMI). See http://go.microsoft.com/fwlink/?LinkID=717903
Not AzurePS
The local cluster manager :
“C:\Program Files\Microsoft SDKs\Service Fabric\Tools\ServiceFabricLocalClusterManager\ServiceFabricLocalClusterManager.exe”
Pin this to the taskbar.
Microsoft Service Fabric is about more than API management. Its features and patterns for application development, including:
  1. Stateful Reliable Services with Reliable Collections.
  2. Dependency injection and unit testing with Reliable Services.
  3. How to use Service Fabric configuration packages, both the built-in Settings.xml config and custom JSON configuration, with rolling updates without restarting services.
  4. How to encrypt sensitive data in Service Fabric configuration packages.
  5. Inter-service communication using the Service Fabric remoting stack.
  6. Diagnostics with Elastic Search through ETW event sources.
  7. How to write a stateless Web API front-end service.

Logic Apps

Resources

  • PowerShell Deployment Toolkit (PDT) is a set of scripts and knowledge for automated deployment of System Center 2012 SP1/R2, including SQL and all prerequisites, and all automatable post-setup integration.

More on DevOps

This is one of a series on DevOps:
  1. DevOps_2.0
  2. ci-cd (Continuous Integration and Continuous Delivery)
  3. Git and GitHub vs File Archival
  4. Git Commands and Statuses
  5. Git Commit, Tag, Push
  6. Git Utilities
  7. Data Security GitHub
  8. GitHub API
  9. Choices for DevOps Technologies
  10. Java DevOps Workflow
  11. AWS DevOps (CodeCommit, CodePipeline, CodeDeploy)
  12. Digital Ocean
  13. Cloud regions
  14. AWS Virtual Private Cloud
  15. Azure Cloud Onramp
  16. Azure Cloud
  17. Packer automation to build Vagrant images
  18. Terraform multi-cloud provisioning automation
  19. Powershell Ecosystem
  20. Powershell on MacOS
  21. Jenkins Server Setup
  22. Jenkins Plug-ins
  23. Jenkins Freestyle jobs
  24. Dockerize apps
  25. Docker Setup
  26. API Management Microsoft
  27. Scenarios for load

More on APIs

This page is one of a series about APIs:

No comments:

Post a Comment