How to Build an Asset Management API with Azure Functions and Power Apps (Step-by-Step)

How to Build an Asset Management API with Azure Functions and Power Apps

Managing assets efficiently is a core challenge for businesses of every size. In this step-by-step guide, you'll learn how to create a fully functional asset management API using Azure Functions — and connect it seamlessly to Power Apps. Whether you're a developer exploring serverless architecture or a Power Platform enthusiast looking to extend your apps with custom APIs, this tutorial has you covered.

No production-grade infrastructure required — we'll build a clean, working mock API that demonstrates the core concepts you need to get started. By the end, you'll have a reusable pattern you can adapt for real-world asset tracking, inventory management, and more. Interested in how this fits into a broader Power Platform development strategy? Read on.

What You'll Learn

Prerequisites

Before you begin, make sure you have the following in place:

Step 1: Set Up Your Azure Functions Project

Start by creating a new Azure Functions project in Visual Studio Code. Open the Command Palette (Ctrl+Shift+P) and select Azure Functions: Create New Project. Choose your preferred language (JavaScript or C# are most common for Power Platform integrations), and select HTTP trigger as your function template.

Name your function GetAssets and set the authorization level to Function for now — you can tighten this up for production later.

Step 2: Define Your Asset Data Model

For this tutorial, we'll work with a simple asset object. Each asset will have the following properties:

In a production scenario, this data would live in Dataverse, Azure SQL, or Cosmos DB. For this walkthrough, we'll use an in-memory mock dataset to keep things simple and focused on the API structure.

Step 3: Create the Core API Functions

You'll need at least four HTTP-triggered functions to cover the basic CRUD operations for your asset management API:

GET /assets — Retrieve All Assets

This function returns the full list of assets. It should respond with a 200 OK status and a JSON array of asset objects. Add optional query string support for filtering by category or status to make it more useful from Power Apps.

GET /assets/{id} — Retrieve a Single Asset

This function accepts an asset ID as a route parameter and returns the matching asset object. If no match is found, return a 404 Not Found response with a clear error message.

POST /assets — Create a New Asset

This function reads a JSON body from the request and adds a new asset to the dataset. Generate a new GUID for the id field server-side. Return the created asset with a 201 Created status.

PATCH /assets/{id} — Update an Existing Asset

This function accepts an asset ID and a partial JSON body, then updates the matching asset's fields. Return the updated asset with a 200 OK status, or 404 if the asset doesn't exist.

Step 4: Enable CORS for Power Apps

Power Apps canvas apps make requests from the browser, so your Azure Function must have Cross-Origin Resource Sharing (CORS) configured correctly. In the Azure Portal, navigate to your Function App, select CORS under the API section, and add the Power Apps origin:

During development, you can use * as a wildcard, but remove this before going to production.

Step 5: Deploy Your Azure Function

Once your functions are working locally (use func start to test), deploy to Azure directly from VS Code using the Azure Functions: Deploy to Function App command. Make a note of your function's base URL and function key — you'll need both when connecting to Power Apps.

Step 6: Connect Your API to Power Apps

Now for the exciting part — wiring up your new API to a Power Apps canvas app:

  1. Open Power Apps Studio and create or open a canvas app.
  2. Go to Data > Add data > Custom connectors and create a new custom connector pointing to your Azure Function base URL.
  3. Add your function key as an API key header (x-functions-key).
  4. Define the operations matching your HTTP functions (GetAssets, GetAsset, CreateAsset, UpdateAsset).
  5. Test each operation directly in the custom connector wizard before saving.
  6. Add the connector to your canvas app and use it in galleries, forms, and buttons.

For more advanced integration patterns, explore our guide on Power Platform development and how custom APIs can supercharge your apps.

Step 7: Test End-to-End

With everything connected, test your asset management app thoroughly:

Taking It Further

This tutorial covers the fundamentals, but there's plenty of room to grow. Here are some natural next steps:

Conclusion

You've now built a working asset management API with Azure Functions and connected it to Power Apps. This serverless approach gives you flexibility, scalability, and minimal infrastructure overhead — a winning combination for modern business applications built on the Microsoft Power Platform.

Whether you're building internal tools, extending Dynamics 365, or creating customer-facing apps, custom APIs with Azure Functions are a powerful pattern to have in your toolkit.

Need Help Building Your Power Platform Solution?

Our team of certified Power Platform and Azure experts at CRMONCE can help you design, build, and deploy custom API integrations, canvas apps, and end-to-end solutions tailored to your business needs.

Talk to a Power Platform Expert →  View Our Consulting Services