/azure-qr-code

Serverless Azure Function that generates QR codes for provided URLs and stores them in Azure Blob Storage.

Primary LanguageJavaScriptMIT LicenseMIT

Azure QR Code Generator

Build and deploy

This repository contains the code for serverless Azure Function that generates QR codes for provided URLs and stores them in Azure Blob Storage. The function is written in JavaScript and can be triggered via HTTP requests.

Demo

Send a GET request to the Azure Function https://azure-qr-code.azurewebsites.net/api/GenerateQRCode with url as parameter.

curl example:

curl -X GET https://azure-qr-code.azurewebsites.net/api/GenerateQRCode -H "Content-Type: application/json" -d '{"url":"https://www.example.com"}'

Postman example: Azure QR Code Generator GIF Postman Example

Architecture

Azure QR Code Generator Architecture

Features

  • Serverless: Leverages Azure Functions for minimal infrastructure management.
  • QR Code Generation: Dynamically creates QR codes for any given URL.
  • Azure Blob Storage: Stores the generated QR codes in the cloud for easy access and management.

Prerequisites

Getting Started

1. Clone the Repository

git clone https://github.com/rishabkumar7//azure-qr-code.git
cd azure-qr-code/qrCodeGenerator

2. Install Dependencies

npm install

3. Local Configuration

Set up your local.settings.json file with the necessary configuration values:

{
    "IsEncrypted": false,
    "Values": {
        "AzureWebJobsStorage": "",
        "FUNCTIONS_WORKER_RUNTIME": "node",
	      "STORAGE_CONNECTION_STRING":"<YOUR_STORAGE_CONNECTION_STRING>"
    }
}

4. Running Locally

To start the function app locally, make sure you have Azure Functions Core Tools installed, then run:

func start

5. Deploy to Azure

Deploy your function app to Azure using the following command:

func azure functionapp publish <YOUR_FUNCTION_APP_NAME>

Usage

Send a GET request to your function's endpoint with a JSON payload containing the URL:

curl -X GET https://<YOUR_FUNCTION_URL>/api/GenerateQRCode -H "Content-Type: application/json" -d '{"url":"https://www.example.com"}'

Author