Een inleiding tot Azure FunctionsIntroduction to Azure Functions
Azure Functions is een serverloze oplossing waarmee u minder code hoeft te schrijven, minder infrastructuur hoeft te onderhouden en kunt besparen op kosten.Azure Functions is a serverless solution that allows you to write less code, maintain less infrastructure, and save on costs. In plaats van u zorgen te maken over het implementeren en onderhouden van servers, biedt de cloudinfrastructuur alle bijgewerkte resources die nodig zijn om uw toepassingen uit te voeren.Instead of worrying about deploying and maintaining servers, the cloud infrastructure provides all the up-to-date resources needed to keep your applications running.
U richt zich op de stukken code die voor u het belangrijkst zijn en Azure Functions doet de rest.You focus on the pieces of code that matter most to you, and Azure Functions handles the rest.
We bouwen vaak systemen om te reageren op een reeks kritieke gebeurtenissen.We often build systems to react to a series of critical events. Of u nu een web-API bouwt, reageert op wijzigingen in de database, IoT-gegevensstromen verwerkt of berichtenwachtrijen beheert, elke toepassing heeft een methode nodig om code uit te voeren wanneer deze gebeurtenissen optreden.Whether you're building a web API, responding to database changes, processing IoT data streams, or even managing message queues - every application needs a way to run some code as these events occur.
Azure Functions biedt twee belangrijke methoden voor 'berekeningen op aanvraag' om aan deze behoefte te voldoen.To meet this need, Azure Functions provides "compute on-demand" in two significant ways.
Ten eerste kunt u met Azure Functions de logica van uw systeem implementeren in direct beschikbare codeblokken.First, Azure Functions allows you to implement your system's logic into readily available blocks of code. Deze codeblokken worden 'functies' genoemd.These code blocks are called "functions". Verschillende functies kunnen op elk gewenst moment worden uitgevoerd om te reageren op kritieke gebeurtenissen.Different functions can run anytime you need to respond to critical events.
Ten tweede kunt u, als het aantal aanvragen toeneemt, met Azure Functions aan de vraag voldoen met zo veel resources en functie-instanties als nodig, maar alleen zolang dat nodig is.Second, as requests increase, Azure Functions meets the demand with as many resources and function instances as necessary - but only while needed. Wanneer het aantal aanvragen afneemt, worden alle extra resources en toepassingsexemplaren automatisch weer verwijderd.As requests fall, any extra resources and application instances drop off automatically.
Waar komen alle rekenresources vandaan?Where do all the compute resources come from? Azure Functions biedt zo veel of zo weinig rekenresources als nodig is om te voldoen aan de vraag van uw toepassing.Azure Functions provides as many or as few compute resources as needed to meet your application's demand.
Het leveren van rekenresources op aanvraag is de essentie van serverloze computing in Azure Functions.Providing compute resources on-demand is the essence of serverless computing in Azure Functions.
Scenario'sScenarios
In veel gevallen kan een functie worden geïntegreerd met een matrix van cloudservices om implementaties met uitgebreide functies te bieden.In many cases, a function integrates with an array of cloud services to provide feature-rich implementations.
Hier volgt een veelvoorkomende, maar geen volledige set scenario's voor Azure Functions.The following are a common, but by no means exhaustive, set of scenarios for Azure Functions.
Als u dit wilt...If you want to... | moet u...then... |
---|---|
Een web-API bouwenBuild a web API | Een eindpunt voor uw webtoepassingen implementeren met de HTTP-triggerImplement an endpoint for your web applications using the HTTP trigger |
Uploads van bestanden verwerkenProcess file uploads | Code uitvoeren wanneer een bestand wordt geüpload of gewijzigd in blob-opslagRun code when a file is uploaded or changed in blob storage |
Een serverloze werkstroom makenBuild a serverless workflow | Een reeks functies koppelen met behulp van duurzame functiesChain a series of functions together using durable functions |
Reageren op wijzigingen in de databaseRespond to database changes | Aangepaste logica uitvoeren wanneer een document wordt gemaakt of bijgewerkt in Cosmos DBRun custom logic when a document is created or updated in Cosmos DB |
Geplande taken uitvoerenRun scheduled tasks | Code uitvoeren op vaste tijdstippenExecute code at set times |
Betrouwbare berichtenwachtrijsystemen makenCreate reliable message queue systems | Berichtenwachtrijen verwerken met behulp van Queue Storage, Service Bus of Event HubsProcess message queues using Queue Storage, Service Bus, or Event Hubs |
IoT-gegevensstromen analyserenAnalyze IoT data streams | Gegevens van IoT-apparaten verzamelen en verwerkenCollect and process data from IoT devices |
Gegevens in realtime verwerkenProcess data in real time | Functions en Signal R gebruiken om in realtime op gegevens te reagerenUse Functions and SignalR to respond to data in the moment |
Voor het bouwen van functies zijn de volgende opties en resources beschikbaar:As you build your functions, you have the following options and resources available:
Uw voorkeurstaal gebruiken: Schrijf functies in C#, Java, JavaScript, PowerShell of Python of gebruik een aangepaste handler om vrijwel elke andere taal te kunnen gebruiken.Use your preferred language: Write functions in C#, Java, JavaScript, PowerShell, or Python, or use a custom handler to use virtually any other language.
Implementatie automatiseren: Bij een op hulpprogramma's gebaseerde benadering voor het gebruik van externe pijplijnen zijn er talloze implementatieopties beschikbaar.Automate deployment: From a tools-based approach to using external pipelines, there's a myriad of deployment options available.
Problemen met een functie oplossen: Gebruik controlehulpprogramma's en teststrategieën om inzicht te krijgen in uw apps.Troubleshoot a function: Use monitoring tools and testing strategies to gain insights into your apps.
Flexibele prijsopties: Bij het Verbruiksabonnement betaalt u alleen voor uw functies wanneer deze worden uitgevoerd. De Premium- en App Service-abonnementen bieden functies voor speciale behoeften.Flexible pricing options: With the Consumption plan, you only pay while your functions are running, while the Premium and App Service plans offer features for specialized needs.