Code Monkey home page Code Monkey logo

azurefunction-sql-crud's Introduction

Azure Function SQL CRUD

This project demonstrates how to create a simple Azure Function to perform CRUD (Create, Read, Update, Delete) operations on a SQL database using HTTP triggers.

Overview

The project consists of an Azure Function called StockAPI which provides an HTTP endpoint to create a new stock entry in the database. The function receives a JSON payload containing the details of the stock to be added, validates it, and then inserts the data into the SQL database.

Functionality

The StockAPI function has the following features:

  • Create-Stock Endpoint: An HTTP POST endpoint (Create-Stock) is exposed to create a new stock entry.
  • Input Validation: The function validates the incoming payload to ensure it contains the necessary data.
  • Database Interaction: The function interacts with a SQL database to insert the new stock entry.

Prerequisites

Before running this Azure Function, ensure the following:

  • Azure subscription
  • Azure Function App created
  • SQL Database provisioned
  • Connection string to the SQL Database available in the Azure Function environment variables

Setup

  1. Clone this repository to your local machine.
  2. Configure the Azure Function App settings with the required connection string to the SQL Database.
  3. Deploy the Azure Function to your Azure Function App.

Usage

To use the Create-Stock endpoint:

  1. Send an HTTP POST request to the endpoint URL with a JSON payload containing the details of the stock to be added.
  2. The function will validate the payload and insert the data into the SQL Database.
  3. Upon successful insertion, the function will return a 200 OK response with the details of the newly created stock entry.

Example payload:

{
  "StockName": "Example Stock",
  "Price": 10.5
}

azurefunction-sql-crud's People

Contributors

rahulmule avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.