Creating an HTTP Request Trigger in Azure Logic Apps
Tags: azureapril, azure, serverless
Published: 2019-04-29 15:49:07

---
title: Creating an HTTP Request Trigger in Azure Logic Apps
published: true
description: 
tags: azureapril, azure, serverless
series: Azure April
cover_image: https://thepracticaldev.s3.amazonaws.com/i/pblyvmtj4y8bdqisyzey.jpeg
---

*Thank you to [Michael Crump](https://twitter.com/mbcrump) for creating this content!*

**Don't have Azure?** [Grab a free subscription](https://azure.microsoft.com/en-us/free?&WT.mc_id=azureapril_devto-blog-cxa). 

----

[Logic Apps](https://azure.microsoft.com/en-us/services/logic-apps/?&WT.mc_id=azureapril_devto-blog-cxa) are a service in Azure that allow you to connect various SaaS services within Azure and beyond to automate tasks. Any business process or workflow can be designed and executed.

Check out [Cecil Phillip's](https://twitter.com/cecilphillip) and [Michael Crump's](https://twitter.com/mbcrump) video tutorial on setting up a logic app.

{% youtube oIwDgJPmVCg %}

# Setting up a Logic App

Go to the [Azure Portal](https://azure.microsoft.com/en-us/features/azure-portal/?&WT.mc_id=azureapril_devto-blog-cxa) and create a new Logic App.

![logic app](https://d33wubrfki0l68.cloudfront.net/6782239348324f7520457dedd2b0b665222ba084/2f037/files/logicappblog1.png)

After the resource is ready, we’re are going to need to trigger an action when an HTTP request comes in. 

Thankfully, this is one of the Common Triggers and we can select it to begin.

![triggers](https://d33wubrfki0l68.cloudfront.net/3fa183a604baef5fe34ff9e234d49a107adcda51/2b6cf/files/logicappblog2.png)

> The URL isn’t generated until we provide the parameters.

![http request](https://d33wubrfki0l68.cloudfront.net/cd0167fb8d44e18b730ce3caff64c1deff35b85a/144bf/files/logicappblog3.png)

Go ahead and press `Edit` and paste in a JSON schema the request should expect. Here's an example. 

```
{
  "$schema": "http://json-schema.org/draft-06/schema#", 
  "definitions": {}, 
  "id": "http://example.com/example.json", 
  "properties": {
    "csv": {
      "id": "/properties/csv", 
      "type": "string"
    }, 
    "filename": {
      "id": "/properties/filename", 
      "type": "string"
    }, 
    "gpx": {
      "id": "/properties/gpx", 
      "type": "string"
    }, 
    "kml": {
      "id": "/properties/kml", 
      "type": "string"
    }
  }, 
  "type": "object"
}
```

> You can use the `Use sample payload to generate schema` option, but I prefer the additional metadata that JSON Schema can provide.


# Upload Files 

We've set up an Azure Logic App to receive an HTTP Request which included a JSON payload.

Now let's integrate with OneDrive to automatically upload files. 

![onedrive](https://d33wubrfki0l68.cloudfront.net/8f13001b19adce434c017eb452330a0441b9b5f6/12359/files/onedriveblog1.png)

Typically, you’ll add an `Action` or `Condition` to trigger once the HTTP request is complete.

We’ll select an `Action` as we want it to run every time. A `Condition` would use `If...then` logic after the HTTP request comes in. 

Select `Action` and search for `upload file to onedrive` and you’ll see the following is available to use.

![select](https://d33wubrfki0l68.cloudfront.net/332c654679d3a13dade6015abb5ff09deb250caa/68938/files/onedriveblog2.png)

You’ll have to sign in to your OneDrive account.

Now you can pull the fields that we captured and use them as dynamic content. 

For example, a GPX file contains a full URL, so we can just use that dynamic field. For the destination URL, we’ll construct where we want it to go in our OneDrive account. 

![upload](https://d33wubrfki0l68.cloudfront.net/ad4de42a4a9bd0e9cb68a2dff93a16130204350b/7c73a/files/onedriveblog3.png)

This is just one idea You can integrate with dozens of everyday tools with [Azure Logic Apps]. 



**Ready to set up your Logic App?** [Check out our stellar documentation.](https://azure.microsoft.com/en-us/services/logic-apps/?&WT.mc_id=azureapril_devto-blog-cxa)

----
We'll be posting articles every day in April, so stay tuned! Or jump ahead and check out more tips and tricks [now](http://azuredev.tips).