### Navigate to Project, Install Dependencies, and Start Function App (npm) Source: https://learn.microsoft.com/en-us/azure/azure-functions/scenario-real-time-events-processing Navigates to the 'src' project folder, installs dependencies using npm, and then starts the function app. ```bash cd src npm install npm start ``` -------------------------------- ### Install Dependencies and Start Function App (npm) Source: https://learn.microsoft.com/en-us/azure/azure-functions/scenario-real-time-events-processing Installs project dependencies using npm and then starts the function app using the npm start script. ```bash npm install npm start ``` -------------------------------- ### Install Dependencies, Build, and Start MCP Server Source: https://learn.microsoft.com/en-us/azure/azure-functions/functions-mcp-tutorial This sequence of commands installs project dependencies, builds the project, and then starts the MCP server locally. ```shell npm install npm run build func start ``` -------------------------------- ### Install Dependencies and Build Project Source: https://learn.microsoft.com/en-us/azure/azure-functions/scenario-host-mcp-server-sdks Installs project dependencies and builds the project before starting the server. Run these commands in the root directory. ```Bash npm install npm run build ``` -------------------------------- ### Start Local MCP Server with Virtual Environment Source: https://learn.microsoft.com/en-us/azure/azure-functions/scenario-host-mcp-server-sdks Creates a virtual environment, installs dependencies, and starts the MCP server locally. Execute this command from the root directory. ```Bash uv run func start ``` -------------------------------- ### Setup Go Workload for Azure Functions CLI Source: https://learn.microsoft.com/en-us/azure/azure-functions/functions-cli-develop-local Installs the host, Go language worker, extension bundles, Go stack workload, and templates workload in one step. ```bash func setup --features go ``` -------------------------------- ### Setup .NET Workload for Azure Functions CLI Source: https://learn.microsoft.com/en-us/azure/azure-functions/functions-cli-develop-local Installs the host, .NET language worker, extension bundles, .NET stack workload, and templates workload in one step. ```bash func setup --features dotnet ``` -------------------------------- ### Install and Start Node.js Functions Locally Source: https://learn.microsoft.com/en-us/azure/azure-functions/functions-run-local Install npm dependencies and start your Node.js Azure Functions project locally. This command must be run within a virtual environment. ```bash npm install npm start ``` -------------------------------- ### List Available Quickstart Templates Source: https://learn.microsoft.com/en-us/azure/azure-functions/functions-core-tools-reference Lists available templates in the quickstart template catalog. ```bash func quickstart list ``` -------------------------------- ### Run Node.js Application Source: https://learn.microsoft.com/en-us/azure/azure-functions/create-first-function-azure-developer-cli Installs Node.js dependencies and starts a Node.js application. ```console npm install npm start ``` -------------------------------- ### Local Runtime Output Example Source: https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference-python When starting the function app locally, Core Tools displays the discovered functions and their local endpoints. ```Output Functions: http_trigger: http://localhost:7071/api/http_trigger ``` -------------------------------- ### Show Quickstart Template Details Source: https://learn.microsoft.com/en-us/azure/azure-functions/functions-core-tools-reference Shows details about a specific template in the quickstart template catalog. ```bash func quickstart info ``` -------------------------------- ### Example Local Functions Host Output Source: https://learn.microsoft.com/en-us/azure/azure-functions/functions-run-local Observe the output when the Functions host starts locally, which includes a list of functions and their HTTP trigger URLs. ```text Found the following functions: Host.Functions.MyHttpTrigger Job host started Http Function MyHttpTrigger: http://localhost:7071/api/MyHttpTrigger ``` -------------------------------- ### Initialize Python project skipping documentation Source: https://learn.microsoft.com/en-us/azure/azure-functions/functions-core-tools-reference Skips the generation of 'Getting Started' documentation files when initializing a Python project. This can speed up project creation when documentation is not immediately needed. ```bash func init MyPythonApp --no-docs ``` -------------------------------- ### Setup Node.js Workload for Azure Functions CLI Source: https://learn.microsoft.com/en-us/azure/azure-functions/functions-cli-develop-local Installs the host, Node.js language worker, extension bundles, Node.js stack workload, and templates workload in one step. ```bash func setup --features node ``` -------------------------------- ### Create a function app in a local Linux container Source: https://learn.microsoft.com/en-us/azure/azure-functions/functions-how-to-custom-container This example provides a complete guide on creating a local containerized function app using the command line and subsequently publishing its image to a container registry. ```bash func init "MyFunctionProj" --docker --worker-runtime node ``` -------------------------------- ### Install binding extensions using Azure Functions Core Tools Source: https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-register Use the `func extensions install` command to generate the `extensions.csproj` file for manually installing binding extensions in your local project. ```bash func extensions install ``` -------------------------------- ### Navigate to Tutorial Folder Source: https://learn.microsoft.com/en-us/azure/azure-functions/functions-machine-learning-tensorflow Change the current directory to the cloned tutorial repository folder. ```bash cd functions-python-tensorflow-tutorial ``` -------------------------------- ### Import and Use Requests in a Python Azure Function Source: https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-triggers-python After installing dependencies from requirements.txt, import and use packages like 'requests' within your function code. This example shows making an HTTP GET request and returning the status code. ```python import azure.functions as func import requests def main(req: func.HttpRequest) -> func.HttpResponse: r = requests.get("https://api.github.com") return func.HttpResponse(f"Status: {r.status_code}") ``` -------------------------------- ### Scaffold a Go HTTP API quickstart Source: https://learn.microsoft.com/en-us/azure/azure-functions/functions-cli-develop-local Browses and scaffolds a complete sample app for a Go HTTP API. This command helps in quickly setting up a sample Go Functions project. ```bash func quickstart --stack go --resource http ``` -------------------------------- ### Start AWS Lambda to Azure Functions Migration with Copilot Source: https://learn.microsoft.com/en-us/azure/azure-functions/migration/migrate-aws-lambda-to-azure-functions Initiates the migration workflow in GitHub Copilot for migrating an AWS Lambda application to Azure Functions. This prompt guides the process through assessment, code migration, and infrastructure setup. ```bash Help me migrate my Lambda app to Azure Functions ``` -------------------------------- ### Scaffold a .NET HTTP API quickstart Source: https://learn.microsoft.com/en-us/azure/azure-functions/functions-cli-develop-local Browses and scaffolds a complete sample app for a .NET HTTP API. Use this to quickly set up a sample project for testing. ```bash func quickstart --stack dotnet --resource http ``` -------------------------------- ### Get BlobClient from Storage Blob Trigger Source: https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference-node This example demonstrates how to obtain a BlobClient from a Storage Blob trigger and access its full SDK capabilities, such as getting blob properties and downloading content. ```typescript import "@azure/functions-extensions-blob"; // This is the mandatory first import for SDK binding import { StorageBlobClient } from "@azure/functions-extensions-blob"; import { app, InvocationContext } from "@azure/functions"; export async function storageBlobTrigger( blobStorageClient: StorageBlobClient, // SDK binding provides this client context: InvocationContext ): Promise { context.log(`Blob trigger processing: ${context.triggerMetadata.name}`); // Access to full SDK capabilities const blobProperties = await blobStorageClient.blobClient.getProperties(); context.log(`Blob size: ${blobProperties.contentLength}`); // Download blob content const downloadResponse = await blobStorageClient.blobClient.download(); context.log(`Content: ${downloadResponse}`); } // Register the function app.storageBlob("storageBlobTrigger", { path: "snippets/{name}", connection: "AzureWebJobsStorage", sdkBinding: true, // Enable SDK binding handler: storageBlobTrigger, }); ``` -------------------------------- ### Initialize Go project with Docker support Source: https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference-go Initialize a new Go project with Docker support using `func init --worker-runtime go --docker`. This command generates a `Dockerfile` along with standard project files. ```console func init --worker-runtime go --docker ``` -------------------------------- ### Run Azure Functions with Node.js Source: https://learn.microsoft.com/en-us/azure/azure-functions/create-first-function-azure-developer-cli Installs Node.js dependencies and starts the Azure Functions host. ```console npm install func start ``` -------------------------------- ### Trigger HTTP Function with GET Request Source: https://learn.microsoft.com/en-us/azure/azure-functions/functions-run-local Use this cURL command to trigger an HTTP function with a GET request and pass a parameter in the query string. Ensure the port and function name match your local setup. ```bash curl --get http://localhost:7071/api/MyHttpTrigger?name=Azure%20Rocks ``` -------------------------------- ### Example requirements.txt for Custom Dependencies Source: https://learn.microsoft.com/en-us/azure/azure-functions/python-build-options This snippet shows how to specify custom local packages or wheels within a `requirements.txt` file for deployment with Azure Functions. It includes examples for installing a wheel file and a local package from a specified path. ```text # Installing a custom wheel .whl # Installing a local package path/to/my/package ``` -------------------------------- ### Install Azure SQL extension preview for in-process model Source: https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-azure-sql Add the --prerelease flag to install a preview version of the Microsoft.Azure.WebJobs.Extensions.Sql NuGet package. ```Bash dotnet add package Microsoft.Azure.WebJobs.Extensions.Sql --prerelease ``` -------------------------------- ### Clone Sample Azure Functions Project Source: https://learn.microsoft.com/en-us/azure/azure-functions/functions-create-first-java-gradle Clone the sample Java Azure Functions project from GitHub to get started. Navigate into the triggers-bindings directory. ```Bash git clone https://github.com/Azure-Samples/azure-functions-samples-java.git cd azure-functions-samples-java/triggers-bindings ``` -------------------------------- ### Start Local HTTP Server (Bash) Source: https://learn.microsoft.com/en-us/azure/azure-functions/machine-learning-pytorch Start a local HTTP server using Python in a Bash environment. Navigate to the '_frontend' folder and activate the virtual environment first. ```Bash python -m http.server ``` -------------------------------- ### Install Publishing Tools Source: https://learn.microsoft.com/en-us/azure/azure-functions/develop-python-worker-extensions Install the necessary tools, `twine` and `wheel`, for packaging and publishing your Python extension. It's recommended to do this in a virtual environment. ```bash pip install twine wheel ``` -------------------------------- ### Python Warmup Trigger (_function.json) Source: https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-warmup This Python example uses a separate _function.json file to define the warmup trigger, compatible with Python function setups. ```json { "bindings": [ { "type": "warmupTrigger", "direction": "in", "name": "warmupContext" } ] } ``` ```python import logging import azure.functions as func def main(warmupContext: func.Context) -> None: logging.info('Function App instance is warm.') ``` -------------------------------- ### Scaffold a Node.js HTTP API quickstart Source: https://learn.microsoft.com/en-us/azure/azure-functions/functions-cli-develop-local Browses and scaffolds a complete sample app for a Node.js HTTP API. This is useful for quickly setting up a sample Node.js project. ```bash func quickstart --stack node --resource http ``` -------------------------------- ### Get Azure Function App Hostname Source: https://learn.microsoft.com/en-us/azure/azure-functions/functions-mcp-tutorial Use the Azure CLI to retrieve the default hostname of your Function App. This is needed for manual server connection setup. ```shell az functionapp show --name --resource-group --query "defaultHostName" --output tsv ``` -------------------------------- ### Quickstart Azure Functions Project Source: https://learn.microsoft.com/en-us/azure/azure-functions/functions-core-tools-reference Browses and scaffolds complete function apps from the Azure Functions quickstart template catalog. Use options to specify stack, language, template, and more. ```bash func quickstart [] [options] ``` -------------------------------- ### TypeScript Warmup Trigger (_function.json) Source: https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-warmup This TypeScript example uses a separate _function.json file to define the warmup trigger, compatible with various TypeScript function setups. ```json { "bindings": [ { "type": "warmupTrigger", "direction": "in", "name": "warmupContext" } ] } ``` -------------------------------- ### Add Custom Configuration Sources in Startup.cs Source: https://learn.microsoft.com/en-us/azure/azure-functions/functions-dotnet-dependency-injection Override `ConfigureAppConfiguration` to add JSON files and environment variables as configuration sources. Use `FunctionsHostBuilderContext` to access environment-specific settings and application root path. ```csharp using System.IO; using Microsoft.Azure.Functions.Extensions.DependencyInjection; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; [assembly: FunctionsStartup(typeof(MyNamespace.Startup))] namespace MyNamespace; public class Startup : FunctionsStartup { public override void ConfigureAppConfiguration(IFunctionsConfigurationBuilder builder) { FunctionsHostBuilderContext context = builder.GetContext(); builder.ConfigurationBuilder .AddJsonFile(Path.Combine(context.ApplicationRootPath, "appsettings.json"), optional: true, reloadOnChange: false) .AddJsonFile(Path.Combine(context.ApplicationRootPath, $"appsettings.{context.EnvironmentName}.json"), optional: true, reloadOnChange: false) .AddEnvironmentVariables(); } public override void Configure(IFunctionsHostBuilder builder) { } } ``` -------------------------------- ### JavaScript Warmup Trigger (_function.json) Source: https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-warmup This JavaScript example uses a separate _function.json file to define the warmup trigger, suitable for older JavaScript function setups. ```json { "bindings": [ { "type": "warmupTrigger", "direction": "in", "name": "warmupContext" } ] } ``` ```javascript module.exports = async function (warmupContext, context) { context.log('Function App instance is warm.'); }; ``` -------------------------------- ### Scaffold a Python HTTP API quickstart Source: https://learn.microsoft.com/en-us/azure/azure-functions/functions-cli-develop-local Browses and scaffolds a complete sample app for a Python HTTP API. Use this to quickly generate a sample Python Functions project. ```bash func quickstart --stack python --resource http ``` -------------------------------- ### Clone the sample repository Source: https://learn.microsoft.com/en-us/azure/azure-functions/tutorial-ffmpeg-processing-azure-files Clone the GitHub repository containing the sample code for this tutorial. This repository includes the function app code, Bicep template for resource provisioning, and a post-deployment script for uploading the FFmpeg binary. ```Bash git clone https://github.com/Azure-Samples/Azure-Functions-Flex-Consumption-with-Azure-Files-OS-Mount-Samples.git ``` -------------------------------- ### C# Isolated Worker Model - Retrieve Secret Source: https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-dapr-input-secret Example of a C# function using the Dapr secret input binding with a DaprServiceInvocationTrigger. Ensure the Dapr SDK is installed. ```csharp using System.Collections.Generic; using Microsoft.Azure.WebJobs; using Microsoft.Extensions.Logging; [FunctionName("RetrieveSecret")] public static void Run( [DaprServiceInvocationTrigger] object args, [DaprSecret("kubernetes", "my-secret", Metadata = "metadata.namespace=default")] IDictionary secret, ILogger log) { log.LogInformation("C# function processed a RetrieveSecret request from the Dapr Runtime."); } ``` -------------------------------- ### Complete host.json Configuration (v2.x+) Source: https://learn.microsoft.com/en-us/azure/azure-functions/functions-host-json A sample host.json file for version 2.x+ showing all possible options, excluding internal-use-only settings. ```json { "version": "2.0", "aggregator": { "batchSize": 1000, "flushTimeout": "00:00:30" }, "concurrency": { "dynamicConcurrencyEnabled": true, "snapshotPersistenceEnabled": true }, "extensions": { "blobs": {}, "cosmosDb": {}, "durableTask": {}, "eventHubs": {}, "http": {}, "queues": {}, "sendGrid": {}, "serviceBus": {} }, "extensionBundle": { "id": "Microsoft.Azure.Functions.ExtensionBundle", "version": "[4.0.0, 5.0.0)" }, "functions": [ "QueueProcessor", "GitHubWebHook" ], "functionTimeout": "00:05:00", "healthMonitor": { "enabled": true, "healthCheckInterval": "00:00:10", "healthCheckWindow": "00:02:00", "healthCheckThreshold": 6, "counterThreshold": 0.80 }, "logging": { "fileLoggingMode": "debugOnly", "logLevel": { "Function.MyFunction": "Information", "default": "None" }, "applicationInsights": { "samplingSettings": { "isEnabled": true, "maxTelemetryItemsPerSecond" : 20, "evaluationInterval": "01:00:00", "initialSamplingPercentage": 100.0, "samplingPercentageIncreaseTimeout" : "00:00:01", "samplingPercentageDecreaseTimeout" : "00:00:01", "minSamplingPercentage": 0.1, "maxSamplingPercentage": 100.0, "movingAverageRatio": 1.0, "excludedTypes" : "Dependency;Event", "includedTypes" : "PageView;Trace" }, "dependencyTrackingOptions": { "enableSqlCommandTextInstrumentation": true }, "enableLiveMetrics": true, "enableDependencyTracking": true, "enablePerformanceCountersCollection": true, "httpAutoCollectionOptions": { "enableHttpTriggerExtendedInfoCollection": true, "enableW3CDistributedTracing": true, "enableResponseHeaderInjection": true }, "snapshotConfiguration": { "agentEndpoint": null, "captureSnapshotMemoryWeight": 0.5, "failedRequestLimit": 3, "handleUntrackedExceptions": true, "isEnabled": true, "isEnabledInDeveloperMode": false, "isEnabledWhenProfiling": true, "isExceptionSnappointsEnabled": false, "isLowPrioritySnapshotUploader": true, "maximumCollectionPlanSize": 50, "maximumSnapshotsRequired": 3, "problemCounterResetInterval": "24:00:00", "provideAnonymousTelemetry": true, "reconnectInterval": "00:15:00", "shadowCopyFolder": null, "shareUploaderProcess": true, "snapshotInLowPriorityThread": true, "snapshotsPerDayLimit": 30, "snapshotsPerTenMinutesLimit": 1, "tempFolder": null, "thresholdForSnapshotting": 1, "uploaderProxy": null } } }, "managedDependency": { "enabled": true }, "singleton": { "lockPeriod": "00:00:15", "listenerLockPeriod": "00:01:00", "listenerLockRecoveryPollingInterval": "00:01:00", "lockAcquisitionTimeout": "00:01:00", "lockAcquisitionPollingInterval": "00:00:03" }, "telemetryMode": "OpenTelemetry", "watchDirectories": [ "Shared", "Test" ], "watchFiles": [ "myFile.txt" ] } ``` -------------------------------- ### Get ContainerClient from HTTP Trigger Input Binding Source: https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference-node This example shows how to retrieve a ContainerClient from a Storage Blob input binding within an HTTP trigger to list blobs in a container. ```typescript import "@azure/functions-extensions-blob"; // This is the mandatory first import for SDK binding import { StorageBlobClient } from "@azure/functions-extensions-blob"; import { app, HttpRequest, HttpResponseInit, input, InvocationContext, } from "@azure/functions"; const blobInput = input.storageBlob({ path: "snippets", connection: "AzureWebJobsStorage", sdkBinding: true, }); export async function listBlobs( request: HttpRequest, context: InvocationContext ): Promise { // Get input binding for a specific container const storageBlobClient = context.extraInputs.get( blobInput ) as StorageBlobClient; // List all blobs in the container const blobs = []; for await (const blob of storageBlobClient.containerClient.listBlobsFlat()) { blobs.push(blob.name); } return { jsonBody: { blobs } }; } app.http("listBlobs", { methods: ["GET"], authLevel: "function", extraInputs: [blobInput], handler: listBlobs, }); ``` -------------------------------- ### Navigate to Project and Start Function App (CLI) Source: https://learn.microsoft.com/en-us/azure/azure-functions/scenario-real-time-events-processing Navigates to the 'src' project folder and starts the Azure Functions host using the Azure Functions Core Tools. ```bash cd src func start ``` -------------------------------- ### Setup Python Workload for Azure Functions CLI Source: https://learn.microsoft.com/en-us/azure/azure-functions/functions-cli-develop-local Installs the host, Python language worker, extension bundles, Python stack workload, and templates workload in one step. ```bash func setup --features python ``` -------------------------------- ### Set up APT Source List for Ubuntu Source: https://learn.microsoft.com/en-us/azure/azure-functions/functions-run-local Configures the APT package manager to include the Microsoft package repository for Ubuntu distributions. ```bash sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-$(lsb_release -cs 2>/dev/null)-prod $(lsb_release -cs 2>/dev/null) main" > /etc/apt/sources.list.d/dotnetdev.list' ``` -------------------------------- ### Register services with FunctionsStartup Source: https://learn.microsoft.com/en-us/azure/azure-functions/functions-dotnet-dependency-injection Register services like HttpClient, custom singletons, and logger providers by creating a Startup class that inherits from FunctionsStartup and overrides the Configure method. This method receives an IFunctionsHostBuilder to configure services. ```csharp using Microsoft.Azure.Functions.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection; [assembly: FunctionsStartup(typeof(MyNamespace.Startup))] namespace MyNamespace; public class Startup : FunctionsStartup { public override void Configure(IFunctionsHostBuilder builder) { builder.Services.AddHttpClient(); builder.Services.AddSingleton((s) => { return new MyService(); }); builder.Services.AddSingleton(); } } ``` -------------------------------- ### Initialize a project with a specific extension bundle channel Source: https://learn.microsoft.com/en-us/azure/azure-functions/functions-core-tools-reference Specifies the release channel for extension bundles (`GA`, `Preview`, or `Experimental`). The default is `GA`. ```bash func init --bundles-channel Preview ``` -------------------------------- ### Accessing Trigger Metadata Source: https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference-powershell Access the `sys` property within the `$TriggerMetadata` parameter to get information about the function trigger, such as the UTC timestamp, method name, and a unique execution GUID. ```powershell $TriggerMetadata.sys ``` -------------------------------- ### Build the project for release Source: https://learn.microsoft.com/en-us/azure/azure-functions/functions-identity-based-connections-tutorial-2 Locally generate the deployment package by running the `dotnet publish` command with the `--configuration Release` flag. ```bash dotnet publish --configuration Release ``` -------------------------------- ### Get Environment Variables in C# Source: https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference-csharp C# code example demonstrating how to retrieve environment variables or app settings using System.Environment.GetEnvironmentVariable. This is useful for accessing configuration values like AzureWebJobsStorage. ```csharp public static void Run(TimerInfo myTimer, ILogger log) { log.LogInformation($"C# Timer trigger function executed at: {DateTime.Now}"); log.LogInformation(GetEnvironmentVariable("AzureWebJobsStorage")); log.LogInformation(GetEnvironmentVariable("WEBSITE_SITE_NAME")); } public static string GetEnvironmentVariable(string name) { return name + ": " + System.Environment.GetEnvironmentVariable(name, EnvironmentVariableTarget.Process); } ``` -------------------------------- ### Configure Newtonsoft.Json Serialization Source: https://learn.microsoft.com/en-us/azure/azure-functions/dotnet-isolated-process-guide Switch to Newtonsoft.Json for serialization by installing the Microsoft.Azure.Core.NewtonsoftJson package and configuring WorkerOptions in Program.cs. This example sets up camel case property names and ignores null values. ```csharp using Microsoft.Azure.Functions.Worker; using Microsoft.Azure.Functions.Worker.Builder; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; var builder = FunctionsApplication.CreateBuilder(args); builder.ConfigureFunctionsWebApplication(); builder.Services.Configure(workerOptions => { var settings = NewtonsoftJsonObjectSerializer.CreateJsonSerializerSettings(); settings.ContractResolver = new CamelCasePropertyNamesContractResolver(); settings.NullValueHandling = NullValueHandling.Ignore; workerOptions.Serializer = new NewtonsoftJsonObjectSerializer(settings); }); builder.Build().Run(); ``` -------------------------------- ### Initialize a Go Azure Functions project Source: https://learn.microsoft.com/en-us/azure/azure-functions/how-to-create-function-azure-cli Use the `func init` command to create a new Go functions project. This command generates a project folder with essential configuration and entry point files. ```bash func init MyGoFunctionApp --worker-runtime go ``` -------------------------------- ### Generate Embeddings from Raw Text (Python) Source: https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-openai-embeddings-input Python example for generating embeddings from raw text using Azure Functions input bindings. This snippet shows the decorator setup for the function. ```Python @app.function_name("GenerateEmbeddingsHttpRequest") @app.route(route="embeddings", methods=["POST"]) @app.embeddings_input( arg_name="embeddings", ``` -------------------------------- ### Initialize project with host configuration profile Source: https://learn.microsoft.com/en-us/azure/azure-functions/functions-core-tools-reference Initializes a project with a specific host configuration profile. This option is currently in preview and allows for advanced configuration of the function host. ```bash func init MyProject --configuration-profile MyProfile ``` -------------------------------- ### Project Structure Example Source: https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference-node Illustrates a typical project folder structure for an Azure Function with a separate script file. ```text / | - node_modules/ | - myFirstFunction/ | | - function.json | - lib/ | | - sayHello.js | - host.json | - package.json ``` -------------------------------- ### List Eligible Apps for Migration with GitHub Copilot Source: https://learn.microsoft.com/en-us/azure/azure-functions/migration/migrate-plan-consumption-to-flex Use this prompt to get a list of eligible Linux Consumption apps for Flex Consumption migration without starting the interactive migration process. ```plaintext list my linux consumption apps eligible for flex consumption migration ``` -------------------------------- ### Register HTTP Function Source: https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference-go Register an HTTP function with specified methods and authorization level using the `app.HTTP` method. This example registers `myHandler` to accept GET and POST requests with anonymous authentication. ```Go app.HTTP("myApi", myHandler, sdk.WithMethods("GET", "POST"), sdk.WithAuth("anonymous"), ) ``` -------------------------------- ### Initialize .NET MCP SDK Functions Hosting Project Source: https://learn.microsoft.com/en-us/azure/azure-functions/scenario-host-mcp-server-sdks Use this command to initialize a .NET sample project for hosting MCP SDK servers on Azure Functions. The `-e` flag sets an environment name for deployment context. ```Bash azd init --template mcp-sdk-functions-hosting-dotnet -e mcpsdkserver-dotnet ``` -------------------------------- ### Define Python Dependencies with requirements.txt Source: https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-triggers-python List external Python packages required by your Azure Functions app in the requirements.txt file. This ensures they are installed during deployment. Example shows including the 'requests' library. ```plaintext requests==2.31.0 ```