This is an Azure Function App that provides a simple HTTP API endpoint.
- Node.js (version 18 or later)
- Azure Functions Core Tools
- Azure CLI (for deployment)
- Install dependencies:
npm install- Install Azure Functions Core Tools globally (if not already installed):
npm install -g azure-functions-core-tools@4 --unsafe-perm trueTo run the function locally:
npm startor
func startThe function will be available at: http://localhost:7071/api/hello
Returns a simple greeting message.
Response:
hello manish and aslam
Example:
curl http://localhost:7071/api/hello- Login to Azure:
az login- Create a resource group (if needed):
az group create --name myResourceGroup --location eastus- Create a storage account:
az storage account create --name mystorageaccount --location eastus --resource-group myResourceGroup --sku Standard_LRS- Create a function app:
az functionapp create --resource-group myResourceGroup --consumption-plan-location eastus --runtime node --runtime-version 18 --functions-version 4 --name myFunctionApp --storage-account mystorageaccount- Deploy the function:
func azure functionapp publish myFunctionApp├── src/
│ └── functions/
│ └── hello.js # Main HTTP trigger function
├── host.json # Function app configuration
├── local.settings.json # Local development settings
├── package.json # Node.js dependencies
└── README.md # This file