Upload
nikolai-blackie
View
360
Download
0
Embed Size (px)
Citation preview
DEV1 – How to Design, Build, Deploy and Manage API’s in Microsoft AzurePresented by Nikolai BlackieAdaptiv Integration3rd of October 2015
Code Camp Auckland 2015 Demo Scenario
• Adding an API• Leveraging Swagger• Continuous Integration• Composition via Logic Apps• Expose via API Management
Why API’s? What Microsoft AzureAPI tools & components
you can use?
APIs are the engines of growthMonetize data or services
Open new
channels
Innovate faster
Make product into a
platform
Common scenarios
Modernize legacy backendsPackage APIs into tiersEnforce usage limitsProvide support and receive feedback
Mobile enablement
Partner ecosystem
Optimize and secure backendAuthorize and throttle requestsGet visibility into usage and healthDrive developer adoption
Business agility
Normalize legacy backendsBuild the catalog of APIsAccept organizational IDRespect org structure
Software-defined Architecture for Applications
Software-defined Architecture for Applications – Microsoft Technologies
API ManagementApp Services
API AppsLogic Apps
Azure Service BusWebAPI & WCF
API APPSEasily build and
consume APIs in the cloud
WEB APPSWeb apps that scale with
your business
LOGIC APPSAutomate business
process across SaaS and on-premises
MOBILE APPSBuild Mobile apps for
any device
Integration Platform as a ServiceAzure App Services
Resource Group – App Service
API App Gateway
other Azure services…
Clients• Web • Mobile (iOS)• Flow 3rd party
SaaS
API Apps from Gallery
Salesforce Connector
Office 365 Connector
Custom Code
Mobile App (Data
Access)
Direct deployed
Logic Apps
On-premise
s
Logic App (also from gallery)
Logic App Definitions
Token Store
Azure AD
Twilio Connector
Consent Server
Facilitates SaaS login and token refresh
Azur
e AD
API Apps Architecture Scenario
Resource Group – App Service
API App Gateway
Clients• Web • Mobile (iOS)• Flow
API Apps from Gallery
HTTP Connector
Custom Code
Product API
Order API
Logic Apps
Logic App (also from gallery)
Logic App Definitions
API Apps Code Camp Demo Scenario
Logistics API
Build & Deploy
Source Control
App Insights
Azure API Apps provide a rich platform and ecosystem for building, consuming, and distributing APIs in the cloud and on-premises.
• Box• Chatter• Delay• Dropbox• Azure HD Insight• Marketo• Azure Media Services• OneDrive• SharePoint • SQL Server• Office 365• Oracle
• QuickBooks• SalesForce• Sugar CRM • SAP• Azure Service Bus• Azure Storage• Timer / Recurrence• Twilio• Twitter• IBM DB2 • Informix• Websphere MQ
• Azure Web Jobs• Yammer• Dynamics CRM• Dynamics AX• Hybrid Connectivity
• HTTP, HTTPS • File• Flat File• FTP, SFTP• POP3/IMAP• SMTP• SOAP + WCF
• Batching / Debatching
• Validate• Extract (XPath)• Transform
(+Mapper)• Convert (XML-JSON)• Convert (XML-FF)
• X12• EDIFACT• AS2• TPMOM• Rules Engine
Connectors
Protocols BizTalk Services
Built-in API Connectors
API App Settings for Custom Applications
1) URL for external access2) Host that contains API settings3) Shared Resource Group Gateway
Demo: API AppsHow to make your own
SwaggerDocument Generate
Swagger Configuration
1) Set XML documentation file ‘bin\XmlComments.xml’
Note All Configurations2) Update SwaggerConfig
IncludeXmlComments to string.Format(@"{0}\bin\XmlComments.xml",
System.AppDomain.CurrentDomain.BaseDirectory)
Swagger Document Access
1) WebAPI via web app URL /swagger/ui/index – UI documentation /swagger/docs/v1 – Swagger DOC
2) API App Download swagger API Host URL + /swagger/docs/v1 – Swagger DOC
Demo: SwaggerSpend more time coding, less time documenting
PRODUCT BACKLOG
RELEASE PIPELINE
Sprint Monitor
Define
Deliver
Operate
Sprint
Define
DeliverCUSTOMERS
Automate!ReleaseManagement
Visual Studio API Build Solution Configuration
MSBuild Arguments to support web deployment/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.stagingDirectory)"
Visual Studio API Deploy Solution Configuration
• Deploy automatically to slots or live• Web Deploy Package (based on MSBuild Arguments)
$(build.stagingDirectory)\**\AdtvDemo.WUS.WebAPI.Logistics.zip$(build.stagingDirectory)\**\AdtvDemo.WUS.API.Products.zip
Demo: API CI/CDHow to automate via TFS 2015 Online
Logic Apps for easy automation• No code designer for rapid creation
• Dozens of pre-built templates to get started
• Out of box support for popular SaaS and on-premises apps
• Use with custom API apps of your own
• Biztalk APIs for expert integration scenarios
Automate SaaS andon-premises systems
LOGIC APPS
App Logic Design Surface
App Logic Operational Insight
Demo: Logic AppsHow to make your own
WEB USERS
WEB SITE
YOUR ORGANIZATION
APP DEVELOPERS
USERS
MOBILE APPS
SOCIAL APPS
PARTNERS ANDAFFILIATES
API
AZURE API MANAGEMENT
DEVELOPER PORTALREGISTRATIONDOCUMENTATIONINTERACTIVE API CONSOLEDEVELOPER ANALYTICSAPP GALLERYFORUMSNEWSISSUESWIKI
API PROXYSCALINGCACHINGMONITORINGTRAFFIC MANAGEMENT
ADMIN PORTALAPI PUBLISHINGSUBSCRIPTION MANAGEMENTSECURITYMEDIATIONCONTENT PUBLISHINGSITE CUSTOMIZATIONISSUE MANAGEMENTANALYTICSREPORTS
Azure API Management
Azure API Management – Import Swagger
• Import API /WebAPI App via Swagger• /swagger/docs/v1 – Swagger DOC• Or download Swagger definition
• Add API to one or more API products
Azure API Management - Policies
• Utilise Policies to enforce security or modify API• Authentication• Format Conversion• Cache etc
Demo: Expose APIsHow to make your own
ResourcesFind out more
Swagger
Swashbuckle ASP NET WebAPI
documentation using Swagger Swashbuckle Customization Swagger & ASP NET WebAPI
TFS 2015 Builds
https://msdn.microsoft.com/Library/vs/alm/Build/overview
https://github.com/Microsoft/vso-agent-tasks/blob/master/README.md
Logic Apps
• Logic App EAI Tutorial• Author Logic App definitions• Logic App Workflow Definition Language
• Logic App Workflow Actions and Triggers
• Logic App Management API• Logic Apps Documentation
Azure Powershell
https://github.com/Azure/azure-powershell/releases
API Apps DocumentationAPI Apps
https://github.com/nikolaiblackie/AKL2015CodeCampAppServices/blob/master/README.md
Sample Code