Skip to content
/ aka Public
forked from kzu/aka

An Azure function implementing a URL shortening service backed by Azure blob storage

License

Notifications You must be signed in to change notification settings

sukesh-ak/aka

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Azure serverless URL shortening service

An Azure function implementing a URL shortening service backed by Azure blob storage in the fewest lines of code possible (~70 LoC).

Read the announcement

Installing

  1. Fork the repo
  2. Create an Azure Functions app for it
  3. Add an X-Authorization setting containing a shared key used for creating the short links
  4. Add automated deployment from the repo

The short URLs will be persisted in the same Azure storage account used by the app, in a table named Aka.

Usage

The function provides a REST API for URL shortening, as well as the resolving itself. All mutating operations (POST, PUT, DELETE) require the client providing an X-Authorization value that needs to match the setting configured server-side (that is, a shared key/secret).

Usage is trivial: just POST or PUT to the desired short URL you want, passing the target URL in the body, like so:

# create or update shortlink
curl -d [TARGET_URL] -H "X-Authorization: [SHARED_SECRET]" https://[FUNCTION_APP_URL]/[SHORT_ALIAS]

The X-Authorization must match what you specified in step 3 during install/configuration.

That's it.

Example redirection stats badge:

redirects badge

About

An Azure function implementing a URL shortening service backed by Azure blob storage

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%