Create Power Apps application to query data in Azure Data Explorer (preview)

Azure Data Explorer is a fast, fully managed data analytics service for real-time analysis of large volumes of data streaming from applications, websites, IoT devices, and more.

Power Apps is a suite of apps, services, connectors, and data platform that provides a rapid application development environment to build custom apps that connect to your business data. The Power Apps connector is particularly useful if you have a large and growing collection of streaming data in Azure Data Explorer and want to build a low code, highly functional app to make use of this data. In this article, you will create a Power Apps application to query Azure Data Explorer data. During this process, you will see the steps of data parameterization, retrieval, and presentation.

Prerequisites

Connect to Azure Data Explorer Connector

  1. Navigate to https://make.preview.powerapps.com/ and sign-in.

  2. Select Connections in the left-hand menu.

  3. Select + New connection.

    Create a new connection in Power Apps.

  4. Search for Azure Data Explorer in the search bar. Select Azure Data Explorer from the resulting options.

    Search and select Azure Data Explorer connection in Power Apps.

  5. Select Create on the Azure Data Explorer popup. Provide credentials as required.

    Create connector to Azure Data Explorer - popup window.

Create App

  1. Navigate to Power Apps and select Apps in the left-hand menu.

  2. Select + New app in the menu bar.

  3. Select Canvas from the resulting dropdown.

    Create a new app and canvas - Power Apps connector to Azure Data Explorer.

  4. In the Blank app section, select Tablet layout.

    Start with a blank canvas in tablet layout - Power Apps connector to Azure Data Explorer.

Add Connector

  1. Click on the Data icon on the left-hand navigation.

  2. Expand Connectors.

  3. Select Azure Data Explorer in the resulting options.

    Add a connector to Azure Data Explorer in Power Apps.

You will see a new area called In your app with Azure Data Explorer now included.

Azure Data Explorer now appears in In your app area in Power Apps.

Save Your App

  1. Select File in the menu bar.

  2. Select Save in the left-hand navigation.

    Save your app to Power Apps.

  3. Enter a meaningful name for your app. Click the Save button in the lower right.

Advanced Settings

  1. Select Settings in the left-hand menu.

  2. Select Advanced settings.

  3. Select Dynamic schema from resulting options. Enable this feature.

    Turn on dynamic schema setting in Power Apps - connection to Azure Data Explorer.

  4. Search for the Data row limit for non-delegable queries setting. Set your returned records limit.

    Set return results limit in Power Apps - Azure Data Explorer.

    Note

    The default limit is 500, with a maximum of 2,000 returned records.

Important

Save your app again and restart as required.

Add Dropdown

  1. Select Insert in the menu bar.

  2. Select Input in the resulting sub menu bar.

  3. Select Drop down in the resulting dropdown.

  4. Click on the Advanced tab in the right-hand popout.

  5. Populate the Items input box with: ["CALIFORNIA","MICHIGAN"]

    Populate items in dropdown menu.

  6. With the dropdown still selected, select OnChange from the Property dropdown in the formula bar.

  7. Enter the following formula:

    ClearCollect(
    Results,
    AzureDataExplorer.listKustoResultsPost(
    "https://help.kusto.windows.net",
    "Samples",
    "StormEvents | where State == '" & Dropdown1.SelectedText.Value & "' | take 15"
    ).value
    )
    
  8. Click the Capture schema button. Allow time for processing.

    Select capture schema button in dropdown menu.

Add Data Table

  1. Select Insert in the menu bar.

  2. Select Data table in the resulting sub menu bar.

  3. Reposition the data table and consider adding a border for visibility.

  4. Select the Properties tab in the right-hand popout. Select Results from the Data Source dropdown.

  5. Select Edit fields link.

  6. Select + Add field in the resulting popout.

    Reposition table and add border.

  7. Select desired fields and click Add button. A preview of the selected data table appears.

    Preview of the table populated with data.

Validate

  1. Click the Preview the app button in the upper right of the screen.

  2. Try the dropdown, scroll through the data table, and confirm successful data retrieval and presentation.

    Preview the new app in Power Apps with data from Azure Data Explorer .

Limitations

  • Power Apps has a limit of up to 2,000 results records returned to the client. The overall memory for those records can't exceed 64 MB and a time of seven minutes to run.
  • The connector doesn't support the fork and facet operators.
  • Timeout exceptions: The connector has a timeout limitation of 7 minutes. To avoid potential timeout issue, make your query more efficient so that it runs faster, or separate it into chunks. Each chunk can run on a different part of the query. For more information, see Query best practices.

Next steps