Azure Logic Apps and API management

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
>> Hi, my name is Matt Farmer. I'm a Program Manager in the Azure Integration Team. This session is to tell you a bit more about our services, Azure Logic Apps and Azure API Management. That's the products of this talk is all about, what does it really get you? This talk is actually called Be an integration genius with Logic Apps and API Management. So what does it take to be an integration genius? Well, six things we're going to talk about today. The first one is being able to wow people by doing complicated things in minutes, and we'll do a little demo that shows you something you could do to prove to yourself that you could do that complex thing in minutes. Second thing is connecting to anything, showing you how you can connect in applications into Logic Apps to build workflows. Thirdly, we want to talk about how to easily publish and protect your interfaces, your APIs, and then using the same tool, API Management. We're going to show you how you can give a legacy system, a SOAP system new life. We're going to look at how you can publish and allow people to discover and reuse the APIs and services you publish. Then finally, we're going to look at telemetry and how it's exposed in the services and a tool that can really bring your telemetry to life for your business uses. What's the background to this presentation? If you've heard the term digital transformation before, you probably wonder how it relates to these products. But we really think that these two services, Azure Logic Apps and Azure API Management, a core to digital transformation. What does it mean? Well, this is what it means to me. If you think about applications now these days are everywhere, consumed through mobile devices. They're available in IoT. They're available on your fridge. The data is being collected in all sorts of different places and is available in big data stores and can be used to really enhance and make the most of applications. But to really do digital transformation, you take those new ways of deploying applications and the vast amounts of data you collect and bring them together in a relevant way. Connecting everything together in a relevant way brings digital transformation. It's all about connecting data and devices. That's integration we're talking about. Integration is really the backbone of digital transformation. Logic Apps and API Management are two tools that can really help you do that integration. So let's go back to being an integration genius. What are we actually talking about? Let me give you a brief summary of these two products, and we're going to talk a bit more detail to explain what they are, and I'm going to do some demos to show you. API Management allows you to publish secure, transform your APIs and then engage developers with this developer portal and then monitor how they use those APIs, whether they are inside your organization or outside. As your Logic Apps allows you to build workflows and simplify the implementation of them, doing it in a scalable way and doing all in the cloud in the serverless technology. So, let's talk first a bit more about what Logic Apps actually is. So Logic Apps is a tool that allows you to build powerful integrations in a visual designer based either in a browser or within Visual Studio. You can create workflows based on triggers and actions and then augment them with actions and connectors to a myriad of different services. This is built for enterprise workloads. This isn't a toy. It's very much a mission-critical enterprise tool. You can create, manage and monitor these services with continuous integration tools and any other tool you might expect of an enterprise-class service. Logic Apps also, of note is serverless. So, when you deploy Logic App, you don't have to worry about what service it's running on or managing, patching or updates. You just create the workflow you want to run, and then run it. It gives you less DevOps to worry about. You're just worrying about the service itself. You can build and try out the service quickly, and you only build for what you use. So let's go to our first demo, which is how to wow people doing complex things in a few minutes with Logic Apps. So, let's go to the Azure portal for office demo. We're going to build a simple Logic App that does some powerful things. It's going to be a little bit fun, but just to emphasize, these are the templates you get when you first create a Logic App. They really are enterprise applications here. So, let's have a look with, for example, receive an X12 EAI document over AS2 and transform it to XML. These are really high-scale enterprise-level integrations. We're not going to do that kind of thing today. We're going to build a blank Logic App, and we're going to do something that looks for tweets on Twitter. So we're going to use the Twitter trigger. When the new tweet is posted, we're going to then perform an action, and we're going to look for a particular hashtag. We're going to do on an interval of one minute. The hashtag we're going to look for is #mstechsummitlogicapps. So when that hashtag is posted, we're then going to process the tweet and do something. And, again, we're using Twitter here. This could be your line of business system. This could be a SaaS service that you're using. It just makes it easy to demo using Twitter. So the next thing we're going to do is add an action, and we're going to look at the content of the tweet and see how positive or negative it is. We're going to use Microsoft Cognitive Services Text Analytics to do this. And again there's a pre-built connector within Logic Apps. We're going to detect the sentiment of the tweet. You notice here, when I create this action, I have a whole bunch of values or variables that I can post into this action. So I'm going to take the tweet text. So that variable is already created. I didn't have to write any code to do that. I'm going to detect the sentiment of the tweet text, and it's going to give me back a score. I'm going to analyze that score in the next step. So then we add a condition. So, when the score, which is what the sentiment analysis gives us, is greater than 0.5, so 0.5 is the dividing line between positive and negative or negative and positive, we're then going to perform an action. So, if the score is positive, we're going to do something. So if true, should make it a little smaller so we can say it. What we're going to do now is we're going to post Microsoft Teams because it's easy for me to show you that, but you could really do anything with it. You could send an email. You could create a messaging service PassCue. It's entirely up to you. So you see again the connector is allowing us to connect in services without writing any code. So what I'm going to do now is I'm going to post, if the Tweet was positive, I'm going to post a little message into a team with remarks of teams account, and I've created a channel that I'm going to do that. Cool Tweets, then I'm going to construct a message based upon what was in that. So, you've noticed that I've created the connector to teams, and I'm going to post a message, if the sentiment of the Tweet is positive saying that the person is happy and what the score was. You'll notice I'm not putting the text of the Tweet in, and I'm going to do the same quickly if the scores are negative, the person isn't happy at all so the score was then add the score, there we go. So just to go though quickly what we've done when a tweet is posted and we sent the tweets up looking for the tweet action looking for that hashtag in text is Logic Apps hashtag. We're going to do that every minute. We're going to detect the sentiment of the tweet text and then if the sentiment is positive we're going to post one kind of message. If it's negative we're going to post a different kind of message and we're going to post on teams. Now to test them out I started a running, and then on my phone in the background I'm going to post a tweet, and then we should hopefully see a message here. Okay so, I've sent a tweet with my phone while we've been waiting and I'm pretty happy. And you can see it now the Logic App has detected the tweet in the Twitter feed and it's analyzed my sentiment "I'm very happy" so it's posted a message to say how happy I am. So there we go we've built something that analyzes Twitter looks at the contents of the messages and sees the sentiment of it and then posts the message to another system when we've done that on a few minutes in Logic Apps. We haven't written any code we've done it purely with configuration. So the other thing to talk about with Logic Apps is connectors, and you saw that in the demo that I just did. Connectors is a really huge part of why logic Apps is so useful and productive, because logic apps allows you to connect to a huge number of different systems. These connectors are all prebuilt in the system and you just configure them and off you go. So if you're using software as a service, if you are using other services in Azure there's a whole bunch of different connectors for you. However, sometimes you want to connect to other things, and part of the benefit of using a to Logic Apps, you don't actually have to just use the connectors we've created. Let's say for example that you wanted to build a complex workflow around a line of business system within your business. What if you wanted to automate movement of data from one system to another system based upon events. Well, from that Logic Apps has the concept of a custom connector, and you can create connectors based upon standards things like open API and use those connectors to add your line of business systems into workflows. We're going to show you a kind of cheeky little demo of how you can do that right now. So this demo is called Traffic Trigger and going to need to suspend your disbelief a little bit. But imagine a scenario where you had a number of people in your field service team, and you wanted to communicate information to them based upon the traffic routes they were following. So we've taken that a little bit for them this Logic App uses two custom connectors one you see here for Bing traffic. There's no connector currently for that that's a custom connector using a Bing traffic API, and the line of business system that we are using. Again to suspend your disbelief a little bit is Spotify. So there's no Spotify connector, this is one that's been built using a logic App custom connector. Spotify has a very extensive set of open API that we have used to create the connector, and this is an example of how you can create that connect it give it the logo embedded within the Logic App and then use it to run a complex workflow. Walking through a little bit about what's actually going on here, when the workflow is triggered we're going to get a route, and for the moment we're doing a route that's between Portland and Siato. So, imagine some of your field people doing that route, what we're then going to do is get traffic information for it. And that traffic information is going to give us details of things going on on that route, and keywords. We then create the playlist within Spotify, and then for each of the traffic information values we're going to check for key phrases. So, there's going to be things within that traffic report like roadworks and we're going to look what those key phrases are in that traffic report. And that's another cognitive service from Microsoft that you can use to do that. And then finally, that key phrase We're going to use to search for a track within Spotify, and they could be almost anything. So, when we try this little demo we don't actually know what we're going to get in Spotify. And then based on conditions whether there is a value will add a track to the playlist. Again it's kind of fun doing it with Spotify but the idea here is to show you that you could take your line of business system, so your line of business system has it's own API build it connect with it and then run it within Logic Apps. And it's running, so let's jump across to Spotify, and in my Spotify account I've now got a new playlist called Songs about traffic and I genuinely don't know what's going to be in it. But you'll see, we've started to generate some traffic reports songs. So, there's things here like work it by Missy Elliott, perhaps waterfall, flooding problem at the moment perhaps, there's a bunch of other tracks here lots of roadworks I would assume because we get lots of Missy Elliott. All these tracks have been based upon the traffic reports we had. Just a simple silly demonstration about how you can use custom connectors in Logic apps. So that's Logic apps. Let's talk about Azure API Management. So, there's a whole bunch of Megatrends going on in technology environments, and it's amazing how many of them, I think you know where this is going, have APIs at the core of them, whether you doing Internet of Things, in mobile computing, even things like Blockchain are all API driven. And there's a bunch of real value for developing using an API-driven approach, and using APIs to extend your business. So, we see customers doing things like engaging users through mobile apps. Almost every mobile app you talk to is talking to an HTTP-based API at the backend, connecting between businesses and building business ecosystems so, creating new business with partners, providing data that perhaps you haven't provided outside your organization to create new ways of delivering value. And then Multi-speed IT which really means being able to iterate and innovate with business systems. So, you might have a line of business system that drives a huge amount of the core of your business, but there might be data in it that you would like to access, produce reports from, or iterate on to build new systems it gives you that agility. So, as your API Management, Microsoft service to manage and publish APIs is Cloud hosted, and is a fully managed solution, you don't have to manage VMs, it suffers the service effectively. You can have APIs running pretty much anywhere of customers who are using Cloud-Based APIs or Azure app service, or ones running in their existing environment on Premise. Abstracts protect and optimizes those APIs, it allows you complete control on what you project out to the API Collars, and provide security and protection to them. The API Management comes with a developer portal, so developers can engage with you, work at how to use your services, and do that in a self-service way. And it can provide analytics, insights, and governance on the API as you publish. So this slide just tells you a bit more about the core components of API Management and how they work. API administrators can publish their APIs, they can abstract them, change the the public interface that's exposed, other APIs publish them and allow people to get access to them. There's a mediation layer doing things like rate limiting, quota's, transformation and security, and users can then come in and consume those APIs, discover what they are, try them out, get documentation on them in a self-service way through the developer portal. At the heart of API Management is policies, allowing you to configure, and that programmability to the way in which those API calls, both the requests in, the responses out are managed, and there's a whole bunch of pre-created snippets that you can use to build up logic within that pipeline. So let's go in and have a look. A quick demo, some simple things you can do with API Management publishing an API. So, API Management exists within the Azure portal and has all the same user interface features that you know if you've used any other Azure service for configuration. The actual part where you go in and configure APIs is within there. This is what we're looking at now. So, if we want to go and add a new API, this is the add API screen. And if you want to create a new API, there's a number of different ways you can do it. You can create a new API from scratch. You can import things like WSDL for SOAP APIs, and we even have connectivity there for Logic apps, API apps, Function apps. So, you can create a public API of an existing Azure service without having to write any code. For this little demo, we're going to use an open API specification. So, I'm going to use one I've created earlier for the big conference API. We're going to give it the name, and you'll notice the URL comes up. So, the URL is the public URL of the API, you can configure that to be your own custom URL if you wish, This is just the URL of the service for now, and we're going to also add it to our unlimited product, which is one of the ones that comes automatically with the service, and that's how people can access it. So, those users with unlimited product access can access this service. I'm going to create it now, what's happening now, is the open API file is pointing to a backend service, and we're going to create effectively a facade copy of that API. So, the backend service still exists, a copy of the interface exists within Azure API management, and we will pass requests on to that backend service. So, if you look in the user interface now, you'll see how the User Interface represents the API. So, we have the front end definition of the API with the Query parameters that projected out, the head is projected out, what responses we could get back. We have an inbound processing laye. This is where we can apply policies to transform what comes in, and then we have the backend service that we're talking to. So, once the policies have been applied, we can send the request to that Backend service. Finally, we have the outbound processing, once the Backend service responds, we can then again transform that response before we send it back to the calling client. And just to show it works, we have a test interface so, we're going to go and test out this operation, Days_Get, and we're going to send a request. Here we go. We've got a response, and we can see what went on in that response that we've got back from the service. >> So, let's look at the some of the things we could do with that. The API management provides is value. Well, one of the things a lot of customers wish to do when they've created an API is apply a rate limit. So, rate limit allows you to ensure that people can't overload your service. API management stops requests going to you backend service greater than the amount you have marked. So, we do that with a policy. So, let's go in here to the "Code Editor". So, here's the policy at a term. We are going to add a policy for rate limiting for our "Days_Get" API. How do we do that? Well, we select from one of the existing policy definitions that we already had. I'll just scroll through them here. We have one for cause, authentication, validating a job policy if you're using a Warth and then a whole bunch of things like send request allowing you to create an HTTP request and send it off, et cetera. Transformation ones so JSON to XML. But let's say we're going to use a rate limit. So we're going to add the limit call rate by key policy. Now, there some optional parameters here, on these two lines that we don't need. We can set the number of calls to three seconds so three calls over 10 seconds. And then, we need to identify how we group our uses together to make sure we only rate limit an individual user. This is where we're going to use something called policy expressions. So here's an example of a policy. So this is the expression like, let's trim that down. So, we can use "context.Subscription.Id" and this is actually C#. If you've used [inaudible] on that you probably recognize that namespace. Effectively the HTTP context has an object in it called subscription, which is the user's key and we want the ID of that. We can use that ID to group requests together so that they can't overload the service. So that's a simple example of a policy. Let's save it. We've saved our policy. You can see in the inbound processing section and let's go and just test it out just to prove it works. So if we go into the test section, we can now make a request and the first time we get that back, we get 200 OK. Let's try it again 200 OK. Again. The fourth time, we get HTTP 429, too many requests. That's a standard HTTP response code for too many requests at once, try again later. So you'll see that the policy now has applied. If I try again, we get through as we've gone through the expiration window. So, the next thing we're going to talk about is giving legacy systems new life. This is another feature of Azure API management that you can use today to take an existing system and be able to use it in a new and exciting way. The example I quite often give of this is lots of customers have SOAP APIs. So, they have SOAP APIs that are old systems that have been running for a number of years. But now, as part of digital transformation, you may want to take the data in those systems and use them in new ways. So for example, you want to take a SOAP API and allow it to be easily used in a mobile application. Well if you want to do that, there might be a lot of coding involved because most mobile applications are optimized to use JSON based APIs. So how could API management help you with that? We've gone back to our API management instance and what we're going to do is create a SOAP API. Now, I have a WSDL, already precreated that we're going to use at this time. So I'll load that in orders, I need to select an interface on it. What we're going to do now is make a SOAP to rest transformation of this API. So, that means the backend service remains as SOAP. API management will take a request from a client in the form of JSON, use a template to transform a JSON into a SOAP envelope. Forward it onto the backend. The backend will respond with SOAP. We transform that back into JSON, send it to the client. So, we are going to call this API, Orders. Again, we're going to add it to "Unlimited" and now we're going to "Create". And there we go. We get the message that tells us we've created all restful frontend for SOAP API and we're done. Let's go and have a look at it. So orders API. You see we have a bunch of post messages all traffic in. SOAP is HTTP POST, we could transform it to a HTTP GET if you wish. But you'll notice that we're not parsing SOAP back and forth, we're parsing JSON. How are we doing that? If we go and have a look at the policy. Expand it out. You'll see the what we're doing here is creating a policy that uses a transformation and we do this core with what's called a liquid template. So Liquid is a templating language. It's first invented in Ruby. There's now.NET implementations of it for example and that's what we're using here. We using that template to transform on the inbound. You see we take the "body.getOpenOrders.cust" value which is in the JSON payload and inject it into this SOAP template. On the outbound we do the opposite. The great thing about this is if it doesn't do exactly what you need like for example you wanted to change HTTP post to HTTP get, you can absolutely do that with Azure API management with some simple editing of this setup. Let's just prove it works. We're going to edit the raw value that we parse in. So, I think, our order number with that we send the request and there we go. We got a response and the response is JSON. If we go and have a look of the trace however, we can see the template being applied and the output being a SOAP envelope that sent to the backend. So, that's the simple way in which you can take an older SOAP system, transform into JSON system, JSON based HTTP API using API management with a minimum of coding efforts, no rewriting, leaving the existing SOAP API where it was. The things I create can be discovered and reused easily. So, here's where API management and logic apps both provide value for you and come together. We're going to talk about the API management developer portal and also how you can use API management from logic apps. So here's the defaults API management developer portal. This it's default configuration that can be skinned and transformed to make to look any way you wish with the styling tools that come with it. But if we go and look at big conference API that we've created, you'll see that the API has been fully documented. We do this when we import the open API definition. So you can see all the different operations, you can see the request parameters of a particular operation, as well as example, samples and schemas. This particular service has also been integrated with discuss by dropping in some HTML and JavaScript so that you users can come in and comment on a particular API definition. You also see here we've got code samples that come out to the box so users can go and integrate their clients into this API. We also have the ability to download the open API definition or WADL file which is another different type of definition for an API and they can also try out just like I did a minute ago. They can also use our test console to get a result. So, if you got the API management developer portal, people who want to use those APIs. Either your developers or your your external users who are developing applications based on your API can come in here self-service, discover your APIs and use them. So, I've showed you the API management developer portal where developers can come in and discover your APIs and they might be internal to your organization or external. If you're publishing your APIs in API management to internal users who may then want to build workflows and things like that with the data in this APIs, API management and logic apps come together and make a really powerful story about how you can Orchestre API with workflows. So, I can search for an Azure API Management connection. >> And I can actually browse the APIs I've created. So, if I wanted to actually use an API within big conference API, I could use get-days that we were just working with earlier on, and I can now use this API within Logic Apps as another way to link my systems together, expose them, run workflows on them. So, just showing you how you can take and use this API as a valuable tool within building your workflows bringing this two technologies together. So, the final part of being an integration genius is being able to get telemetry. Being able to understand once you've created APIs, once you created business workflows in Logic Apps, what they're doing and how they work. And I'm going to show you the way in which all Azure services providing telemetry which is Azure Monitor through API Management, it was very, very similarly in Azure Logic Apps. But then, I'm going to show you another way in which you can provide telemetry through your Azure API Management particularly if your business users are starting to be interested in your APIs as a core part of your business. In many ways, customers who are a bit forward thinking and thinking about how APIs may change their business and be a core part of it see those APIs as almost a distillation of the parts of their business. In that case, the people within your business are going to want to get access to the data about how they're being used. And not in an IT sense, more in a business dashboard sense. So, this is Azure Monitor running in the Azure portal, and you'll see this is actually an API Management service. You can go and access this in your API Management service. And what Azure Monitor provides is a whole bunch of counters that you can access. So for example, we can look at the total number of requests going through a particular service. And we can change that to the last 24 hours or we can change that to a past week, for example, or we can make cross over the past week, it tends to look a little more flattened. We can add other requests so we can do a comparison, so I can look at failed requests, I can look at other requests that come in if I've had any, seems I'm doing pretty well in the service. But what you can do that's even better is add alerts. So, you notice we have a metric here called the capacity metric. And that measures the amount of compute available in that service. This is API management, there are different metrics Logic Apps. Again, Logic Apps being a server-less platform, it has a different approach but there are metrics here. I can go and add a metric alert. And this is where you can say, "Tell me if something happens" and this allows you to configure different values on that alert and then do something. So for example, I could say capacity and then when this service, when the capacity is greater than 80 percent over five-minute period, notify me, and you can send an email or interestingly, you can even run a Logic App from this alert. So, if I know that the capacity has reached section value and I maybe want to email something or log a ticket in my Internal Service Management System or even call someone, I could do that from a Logic App. So, this is Azure Monitor, it's standard across a whole bunch of Azure services. Once you know how to use this, you can use it in all those different Azure services and it integrates really well with things like a OMS, Operations Management Suite for managing your Azure services. So, you can get telemetry and analytics that way with both Logic Apps and API Management. The next thing I'm going to show you quickly is something a little bit different and this is if you wanted to provide data that maybe is important for your business users about APIs. So, this is the Power BI dashboard for Azure API Management. This is an example Power BI dashboard, but this shows you some business reports on how APIs are being used and because it's Power BI, if you've ever used Power BI before you'll know that these reports as things you can go in and effectively edit, add filters, and report updates. So, if you wanted to provide telemetry data to people who aren't managing your Azure subscription or aren't deeply involved in IT but want to get access to the business information about your APIs, this is a great way you can do. And it shows the power of bringing together a whole bunch of different Azure services to deliver value. So, we've gone through the six steps, the making integration genius in this presentation, wowing people in minutes by doing complex things. We created our simple Twittering Cognitive Sevices Logic App connecting to anything. We showed you how to use custom connectors within Logic Apps to connect to your line of business systems, or in our example, Spotify. Easily publishing and protecting your interfaces, I showed you how you can use your API management to take one of your existing APIs, import it into the service and apply rate limit policy. Giving legacy systems new life, taking an old soap service importing into Azure API Management, transforming it to rest to make it a modern rest-based API. Discoverability and reuse. So I showed you the Azure API Management developer portal where developers can come and get access and information about your APIs. And then I showed you how you can take APIs published within the API Management and reuse them within Logic Apps. And then finally, I gave you a quick demo of Azure monitor within the Azure portal. It's common to both Logic Apps and API Management. And I showed you the API Management Power BI dashboard that's an Add-on service to API Management allowing you to give business data about your APIs to users. We've only really scratched the surface of these services. There's a huge amount more to them. This is just a very high level presentation. But you'll see there's a whole bunch more that you can learn about them, a whole bunch more value they can deliver to your business if you're looking at doing integration in the cloud. So, what's next? We even get started with these services today. You can go and deploy an API Management Developer Tier service for a very minimal cost and try that yourself as all the features of our top rate premium tier. You can try a Logic App that's server-less so you don't even need to provision any service for them. You can go and try and build some Logic Apps today. You can try the Twitter example or anything else you think would be useful. Go and have a look at our documentation and blogs. And we're always happy to talk to customers and answer questions on Twitter and the handles there at the bottom. I hope you enjoyed our little talk through being an Integration genius today. Thank you very much.
Info
Channel: Microsoft Tech Summit
Views: 38,011
Rating: undefined out of 5
Keywords:
Id: FsF9m4-sYwg
Channel Id: undefined
Length: 43min 1sec (2581 seconds)
Published: Sat May 12 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.