Skip to main content Explore View all products (200+) Microsoft Foundry Azure Copilot GitHub Copilot Azure Kubernetes Service (AKS) Azure Cosmos DB Azure Database for PostgreSQL Azure Arc Microsoft Fabric Linux virtual machines in Azure Foundry Models Foundry Agent Service Foundry IQ Foundry Tools Foundry Control Plane Observability in Foundry Control Plane Azure OpenAI in Foundry Models Azure Speech in Foundry Tools Azure Machine Learning View all databases Azure Cosmos DB Azure DocumentDB Azure SQL Azure Database for PostgreSQL Azure Managed Redis Microsoft Fabric Azure Databricks Linux virtual machines in Azure Windows Server on Azure Azure Functions Azure Virtual Machine Scale Sets Azure API Management Azure Container Apps Azure Kubernetes Service (AKS) Azure Kubernetes Fleet Manager Azure Container Registry Azure Red Hat OpenShift Azure Container Instances Azure Container Storage Azure Arc Azure Local Microsoft Defender for Cloud Azure Monitor Microsoft Sentinel Azure Migrate View all solutions (40+) Cloud solutions for small and medium businesses Cloud migration and modernization center Data analytics for AI Azure Databases AI apps and agents Microsoft Marketplace Microsoft Sovereign Cloud AI apps and agents Responsible AI with Azure AI Infrastructure Data analytics for AI Machine learning operations (MLOps) Low-code application development on Azure Integration Services Serverless computing DevOps Migration and modernization center .NET apps migration Databases on Azure Linux on Azure Oracle on Azure SAP on the Microsoft Cloud Adaptive cloud High-performance computing (HPC) Infrastructure as a service (IaaS) Resiliency Azure Essentials Frontier Accelerate for Azure FinOps on Azure Microsoft Marketplace Azure pricing overview Create an Azure account Free Azure services Flexible purchase options Pricing calculator FinOps on Azure Maximize ROI from AI Azure savings plans Azure reservations Azure Hybrid Benefit Virtual Machines Azure SQL Microsoft Foundry Microsoft Fabric Azure Kubernetes Service (AKS) Microsoft Defender for Cloud View more Software Development Companies Microsoft Marketplace Find a partner Resources for Azure partners Get started with Azure Customer stories Analyst reports, white papers, and e-books Videos Learn more about cloud computing Documentation Explore Azure portal Developer resources Quickstart templates Resources for startups Developer community Students Azure for partners Blog Events and Webinars Learn Support Contact Sales Get started with Azure Sign in
Unlock the Future of Azure IoT through Power Platform

In 2021, each month there will be a monthly blog covering the webinar of the month for the low-code application development (LCAD) on Azure solution. LCAD on Azure is a solution to demonstrate the robust development capabilities of integrating low-code Microsoft Power Apps and the Azure products you may be familiar with.  

This month’s webinar is “Unlock the Future of Azure IoT through Power Platform.” In this blog, I will briefly recap LCAD on Azure, provide an overview of IoT on Azure and Azure Functions, how to pull an Azure Function into Microsoft Power Automate, and how to integrate your Power Automate flow into Power Apps.

What is LCAD on Azure? 

LCAD on Azure was created to help developers build business applications faster with less code. Utilizing Microsoft Power Platform, and more specifically Power Apps, helps developers scale and extend their Power Apps with Azure services. For example, a pro developer who works for a manufacturing company would need to build a line-of-business (LOB) application to help warehouse employees track incoming inventory. That application would take months to build, test, and deploy. Using Power Apps, it can take only hours to build—saving time and resources. 

However, say the warehouse employees want the application to automatically place procurement orders for additional inventory when current inventory hits a determined low. In the past, the development team would require another heavy lift to rework their previous application iteration. Due to the integration of Power Apps and Azure, a professional developer can build an API in Visual Studio (VS) Code, publish it to their Azure portal, and export the API to Power Apps, integrating it into their application as a custom connector.

Afterward, that same API is reusable indefinitely in the Power Apps’ studio for future use with other applications, saving the company and developers more time and resources.

IoT on Azure and Azure Functions

This webinar aims to understand how to use Azure IoT Hub and Power Apps to control an IoT device. To start, one would write the code in Azure IoT Hub to send commands directly to your IoT device. In this webinar, Samuel wrote in Node for Azure IoT Hub and wrote two basic commands: toggle fan on and off.

The commands are sent through the code in Azure IoT Hub, which at first run locally. Once tested and confirmed to be running correctly, the next question is how can one rapidly call the API from anywhere across the globe? The answer is to create a flow in Power Automate and connect that flow to Power Apps, which will be a complete dashboard that controls the IoT device from anywhere in the world. To accomplish this task, you have to first create an Azure Function, which will then be pulled into Power Automate using a Get function creating the flow.

Once you’ve built the Azure Function, run and test it locally first, test the on and off states through the Azure Function URL. To build a trigger for the Azure Function, in this case, a Power Automate flow, you need to create an Azure resources group to check the Azure Function and test its local capabilities. If the test fails it could potentially be that you did not create or have an access token for the IoT device. To connect a device, IoT, or otherwise to the cloud, you need to have an access token.

In the webinar, Samuel added two application settings to his function for the on and off commands. After adding these access tokens and adjusting the settings of the IoT device, Samuel was able to run his Azure Function successfully.

Azure Function automated with Power Automate

After building the Azure Function, you can build your Power Automate flow to start building your globally accessible dashboard to operate your IoT device. Samuel starts by building a basic Power Automate framework, then flow, and demonstrates how to test the flow once complete. He starts with an HTTP request and implements a Get command. From there, it is a straightforward process to test and get the IoT device to run.

Power Automate flow into Power Apps

After building your Power Automate flow, you develop a simple UI to toggle the fan on and off. Do this by building a canvas Power App and importing the Power Automate flow into the app.

To start, create a blank canvas app, and name it. In the Power Apps ribbon, you select button, and pick the button’s source, selecting Power Automate and add a flow. Select the flow that is connected to the Azure IoT device—its name should be reflected in the selection menu. If everything is running correctly, your IoT device will turn on. In the webinar, Samuel is running out of time, so he creates a new Power Automate flow, which he imports into the canvas app.

Learn more

WE ARE MICROSOFT

Explore Microsoft Foundry

The future of AI starts here. Envision your next great AI app with the latest technologies. Get started with Azure.