All Projects → JeremyLikness → Serverless Url Shortener

JeremyLikness / Serverless Url Shortener

Licence: mit
Azure Function for a URL shortening website. Uses serverless functions, Azure Table Storage and Application Insights.

Projects that are alternatives of or similar to Serverless Url Shortener

Developing Solutions Azure Exam
This repository contains resources for the Exam AZ-203: Developing Solutions for Microsoft Azure. You can find direct links to resources and and practice resources to test yourself ☁️🎓📚
Stars: ✭ 59 (-47.79%)
Mutual labels:  azure, azure-functions, azure-storage
Serverless Graphql Workshop
GraphQL and Serverless workshop
Stars: ✭ 70 (-38.05%)
Mutual labels:  serverless, azure, azure-functions
Azure Function Express
⚡️Allows Express.js usage with Azure Functions
Stars: ✭ 146 (+29.2%)
Mutual labels:  serverless, azure, azure-functions
Serverlesslibrary
Source code for the Azure Serverless Community Library
Stars: ✭ 119 (+5.31%)
Mutual labels:  serverless, azure, azure-functions
25 Days Of Serverless
Repository responsible for 25 days of Serverless challenges
Stars: ✭ 400 (+253.98%)
Mutual labels:  serverless, azure, azure-functions
Serverless Azure Functions
Serverless Azure Functions Plugin – Add Azure Functions support to the Serverless Framework
Stars: ✭ 213 (+88.5%)
Mutual labels:  serverless, azure, azure-functions
Batch Shipyard
Simplify HPC and Batch workloads on Azure
Stars: ✭ 240 (+112.39%)
Mutual labels:  serverless, azure, azure-functions
Jazz
Platform to develop and manage serverless applications at an enterprise scale!
Stars: ✭ 254 (+124.78%)
Mutual labels:  serverless, azure, azure-functions
Serverless Microservices Reference Architecture
This reference architecture walks you through the decision-making process involved in designing, developing, and delivering a serverless application using a microservices architecture through hands-on instructions for configuring and deploying all of the architecture's components along the way. The goal is to provide practical hands-on experience in working with several Azure services and the technologies that effectively use them in a cohesive and unified way to build a serverless-based microservices architecture.
Stars: ✭ 270 (+138.94%)
Mutual labels:  serverless, azure-functions, azure-storage
Azure Functions Python Samples
Azure Functions Python Sample Codes
Stars: ✭ 266 (+135.4%)
Mutual labels:  serverless, azure, azure-functions
Cadscenario personalisation
This is a end to end Personalisation business scenario
Stars: ✭ 10 (-91.15%)
Mutual labels:  serverless, azure, azure-functions
Azure Readiness Checklist
This checklist is your guide to the best practices for deploying secure, scalable, and highly available infrastructure in Azure. Before you go live, go through each item, and make sure you haven't missed anything important!
Stars: ✭ 457 (+304.42%)
Mutual labels:  azure, azure-functions, azure-storage
Azure For Developers Workshop
The Azure cloud is huge and the vast service catalog may appear daunting at first, but it doesn’t have to be!
Stars: ✭ 38 (-66.37%)
Mutual labels:  azure, azure-functions, azure-storage
Pulumi
Pulumi - Developer-First Infrastructure as Code. Your Cloud, Your Language, Your Way 🚀
Stars: ✭ 10,887 (+9534.51%)
Mutual labels:  serverless, azure
Hexa
Hexa: The ultimate companion for Azure. Setup and deploy in seconds
Stars: ✭ 56 (-50.44%)
Mutual labels:  serverless, azure
Serverless
⚡ Serverless Framework – Build web, mobile and IoT applications with serverless architectures using AWS Lambda, Azure Functions, Google CloudFunctions & more! –
Stars: ✭ 41,584 (+36700%)
Mutual labels:  serverless, azure-functions
Examples
Infrastructure, containers, and serverless apps to AWS, Azure, GCP, and Kubernetes... all deployed with Pulumi
Stars: ✭ 1,085 (+860.18%)
Mutual labels:  serverless, azure
Functions Csharp Eventhub Ordered Processing
Example of processing events in order with the Azure Functions Event Hubs trigger
Stars: ✭ 60 (-46.9%)
Mutual labels:  serverless, azure-functions
Hunt
Hunt is a virtual scavenger hunt app where players can join a game, select a team and solve hints to acquire treasure. The team with the most points wins.
Stars: ✭ 65 (-42.48%)
Mutual labels:  azure-functions, application-insights
Azure Functions Billing
Azure Functions v2 with .NET Core - billing in serverless architecture.
Stars: ✭ 49 (-56.64%)
Mutual labels:  serverless, azure-functions

Azure Functions App for URL Shortening

This project represents a fully serverless implementation for a URL shortening utility implemented with Azure Functions and Azure Table Storage. The project as deployed will enable you to create short URLs and provides an endpoint for redirecting the short URL to the target URL. It uses proxies to allow redirection from the root of the domain.

Free Azure Account Get your Free Azure Account

Deploy to Azure

This project leverages Azure Resource Management Templates to make it easy to provision with a single click.

NOTE: this represents an early version of development. The latest source code is available in the jlik.me repository.

Getting Started

This section is walkthrough to deploy and test the application. Click on the link below to watch a video that demonstrates the following steps.

Video Walk-through

For a comprehensive explanation of the source code and how the application was built, read: Build a Serverless Link Shortener with Analytics Faster than Finishing Your Latte.

Simply click on the deploy button to get started. The first dialog prompts for information needed to generate the resources.

Initial Form for Deploying to Azure

If you have multiple directories and subscriptions, choose the correct one. Pick a resource group and give your app a name. The fallback URL is the URL the service will redirect to when an invalid short URL is provided. The "UTM Source" is used for tagging social media campaigns. Both values will be updated to the application settings for the function app and may be changed at a later date. Choose the storage option (the default should be fine). Keep the default URL for the repository unless you forked the code for your own.

Note: sometimes the deployment may fail with a random error. If it does this, choose the option to try again. In my experience it will often succeed on the second try, especially if the error is related to source code (there appear to be some sporadic issues with fetching the code from GitHub).

This is what a successful screen looks like:

List of Deployment Steps

Once the project has deployed, click or tap "Manage" to navigate to the resource group in the Azure portal. Click on the function app name.

Resource List

Next, tap on the UrlIngest function to create your first short URL. Tab the "Test" tab on the right to enter a request body and specify the following:

{
    input: "https://blog.jeremylikness.com/"
}

(You can choose your own URL).

Select UrlIngest Function

Tap the "Run" button and you should receive a list of results with your shortened URL.

Short URL Response

You can either copy the "ShortUrl" property from the JSON returned, or build the link yourself from the short url. Open a browser, and paste the URL. This example assumes the app name "jrlshorturl" was used.

http://jrlshorturl-function.azurewebsites.net/2q

The site should redirect to the URL you set up in the previous step. Your URL is ready to go! To view analytics, tap on the Function App name then click the Application Insights feature.

Selecting Application Insights

You should immediately begin to see data generated from your functions app.

Client Web Tool

For your convenience, you can also create a lightweight Docker image to run a small client to make it easier to generate URLs without logging into the portal. First, navigate to the "UrlIngest" function and click "Get function URL."

Get the Function URL

Copy the value. This should include your secret function key. Next, navigate to the webApp directory and replace the value for apiRoot in first line of index.js with the URL you just copied.

const apiRoot = "https://<hostname>.azurewebsites.net/api/UrlIngest?code=<funcAppKey>";

Save the file and build the Docker image:

docker build -t shortener .

Once the image has built, run it. This example maps it from the default web port 80 to 8888.

docker run -d -p 8888:80 shortener

Navigate to http://localhost:8888 to run the app.

Shortener App

Important note about CORS: in order for the function URL to be accessible from your local browser, it must be configured with a Cross-Origin Rresource Sharing (CORS) entry in the function app. Learn how to with this link: How to manage a function app in the Azure portal.

Choose whether or not to add the configured source and redirect to the various mediums, then paste the long URL and tap "Shorten" to generate the short URLs.

Follw me on Twitter: @JeremyLikness

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].