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
- How to scaffold a basic Azure Functions project
- How to create HTTP-triggered functions to handle CRUD operations
- How to structure asset data for use in Power Apps
- How to connect your Azure Function API to a Power Apps canvas app
- Best practices for securing and testing your API endpoints
Prerequisites
Before you begin, make sure you have the following in place:
- An active Azure subscription (free tier works fine for this tutorial)
- Visual Studio Code with the Azure Functions extension installed
- Node.js (v18+) or .NET 8 depending on your preferred language
- A Power Apps environment with maker access
- Basic familiarity with REST APIs and HTTP methods
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:
- id — Unique identifier (string/GUID)
- name — Asset name (e.g., "Laptop - Dell XPS 15")
- category — Asset category (e.g., "Hardware", "Software", "Furniture")
- status — Current status (e.g., "Active", "In Repair", "Retired")
- assignedTo — Name or ID of the person/team the asset is assigned to
- purchaseDate — ISO 8601 date string
- value — Monetary value of the asset (number)
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:
https://make.powerapps.comhttps://apps.powerapps.com- Your specific environment URL if known
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:
- Open Power Apps Studio and create or open a canvas app.
- Go to Data > Add data > Custom connectors and create a new custom connector pointing to your Azure Function base URL.
- Add your function key as an API key header (
x-functions-key). - Define the operations matching your HTTP functions (GetAssets, GetAsset, CreateAsset, UpdateAsset).
- Test each operation directly in the custom connector wizard before saving.
- 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:
- Load the app and verify the asset gallery populates correctly
- Filter assets by category or status using dropdown controls
- Submit a new asset via a form and confirm it appears in the list
- Update an asset's status and verify the change persists
- Check the browser console and Azure Function logs for any errors
Taking It Further
This tutorial covers the fundamentals, but there's plenty of room to grow. Here are some natural next steps:
- Persist data — Replace the in-memory mock with Azure Cosmos DB, Azure SQL, or Dataverse for real storage
- Add authentication — Integrate Azure AD / Entra ID for secure, identity-aware access
- Automate workflows — Use Power Automate to trigger notifications when asset status changes
- Add logging and monitoring — Connect Application Insights to track API performance and errors
- Extend the data model — Add fields for maintenance schedules, depreciation tracking, and document attachments
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.
- ✅ Custom connector development
- ✅ Azure Functions architecture & deployment
- ✅ Power Apps canvas & model-driven app development
- ✅ Dataverse and Dynamics 365 integration
Talk to a Power Platform Expert → View Our Consulting Services