Close Menu
Peter Klapwijk – In The Cloud 24-7Peter Klapwijk – In The Cloud 24-7
    Facebook X (Twitter) Instagram
    Peter Klapwijk – In The Cloud 24-7Peter Klapwijk – In The Cloud 24-7
    • Home
    • Intune
    • Windows
      • Modern Workplace
    • macOS
    • Android
    • iOS
    • Automation
      • Logic Apps
      • Intune Monitoring
      • GitHub
    • Security
      • Passwordless
      • Security
    • Speaking
    • About me
    Peter Klapwijk – In The Cloud 24-7Peter Klapwijk – In The Cloud 24-7
    Home»Automation»Use Azure Key Vault to secure your Graph API connection in Power Automate
    Automation

    Use Azure Key Vault to secure your Graph API connection in Power Automate

    Peter KlapwijkBy Peter KlapwijkFebruary 14, 2021Updated:February 14, 20254 Mins Read

    I`ve been lately playing around with Power Automate and Logic Apps and connecting these to Graph API to get some (Intune/ Autopilot) stuff done. But as there are no build-in triggers to connect to the Graph directly, we need to set up a custom connector or use an HTTP trigger to get the job done. If we use for example an HTTP trigger to connect to the Graph, authentication is done using an Azure App registration and its client secret. Something I don’t like about this approach, the client secret is shown in plain-text in the HTTP trigger. With all the unintended consequences that this entails.

    But we can overcome this by using Azure Key Vault and securing the secret with an Azure Key Vault trigger in the flow.

    Let`s see how Azure Key Vault is setup and used in a flow.

    Create Azure Key Vault

    We`re able to securely store the client secret of our App Registration in an Key Vault in Azure. Follow below steps to setup the Key vault.

    • Sign in to the Azure portal
    • Open the service Key Vault
    • Click the Create key vault button
    • Choose the correct Subscription
    • Choose a Resource group (or create a new resource group)
    • Enter a Key vault name
    • Choose the Region
    • Choose the Pricing tier
    • Click Review + Create
    • Open the Key vault as soon as it`s created
    • Open the Secrets tab
    • Click Generate/ import
    • Choose Manual as Upload option
    • Enter a Name for the Secret
    • Enter the client secret of the App registration you use in your flow
    • Set Enabled to Yes
    • Click Create

    On the Access policies tab, you can create an Access policy and assign rights on the Key vault. By default, the user which created the vault is already added with default permissions.
    If you`re working with for example a service account, you can add that account on this tab and limit the permissions to only the permissions which are needed.

    The Secret permissions Get and List are enough for using in a flow.

    After setting the required permission, we`re ready to switch over to the Power Automate portal.

    Setup a flow using the Get secret trigger

    Now that we have saved our client secret in the Key Vault, it`s time to use it in a Power Automate (or Logic Apps) flow.

    • Sign in to the Power Automate portal
    • Open the Flow which contains the HTTP trigger you want to secure
    • Add a new action (one step before the HTTP trigger) and search for get secret
    • Select the Get secret (Azure Key Vault) action

    After adding the new action, you might see an Invalid connection error when you click on the three dots. Because of this, the name of the secret can`t be resolved.

    Switch to the Connections tab (under Data) shows a Parameter value missing error. Click on the three dots to edit the connection.

    Enter the Key Vault name and click Save.

    You might now see another error; Can`t sign in.
    Click Fix connection and sign-in with your (service) account.

    And the connection is successfully connected.

    Switch back to the flow. Choose the correct Key Vault name from the drop-down list, which holds your key.

    By default, the client secret is still shown in plain-text when running the flow. To resolve this we can use a preview feature to secure the input and output.
    Click on the three dots again and choose Settings. Switch Secure inputs and Secure outputs to On. Click Done.

    If you don`t want to use a preview function, you can also use additional actions in your flow. The Encrypt and Decrypt data with Key.

    Open the settings of the HTTP trigger. Remove the (plain-text) client secret, which we will replace with dynamic content.
    Search for secret and select value (value of the secret).

    That`s it!

    When we now run the flow with the HTTP trigger, the client secret isn`t shown any more.

    That`s it for my first Power Automate blog post. Hope you enjoyed it and more Power Automate posts might follow which can be found here 🙂

    Flow Graph Graph API Intune Logic Apps Microsoft 365 Power Automate PowerApps Security
    Share. Facebook Twitter LinkedIn Email WhatsApp
    Peter Klapwijk
    • Website
    • X (Twitter)
    • LinkedIn

    Peter is a Security (Intune) MVP since 2020 and is working as Modern Workplace Engineer at Wortell in The Netherlands. He has more than 15 years of experience in IT, with a strong focus on Microsoft technologies like Microsoft Intune, Windows, and (low-code) automation.

    Related Posts

    Windows Autopilot lifecycle automation with Logic Apps – Part2

    May 18, 2022

    MEM Monitoring: Get your Windows Autopilot deployment events in a Teams channel with Logic Apps – Part 1

    April 16, 2021

    Import Windows Autopilot devices with Logic Apps

    March 27, 2021
    Add A Comment
    Leave A Reply Cancel Reply

    Peter Klapwijk

    Hi! Welcome to my blog post.
    I hope you enjoy reading my articles.

    Hit the About Me button to get in contact with me or leave a comment.

    Awards
    Sponsor
    Latest Posts

    Create deployment ring groups for Microsoft Intune

    June 27, 2025

    Update Windows Defender during Windows Autopilot enrollments

    May 16, 2025

    Hide the “Turn on an ad privacy feature” pop-up in Chrome with Microsoft Intune

    April 19, 2025

    How to set Google as default search provider with Microsoft Intune

    April 18, 2025
    follow me
    • Twitter 4.8K
    • LinkedIn 6.1K
    • YouTube
    • Bluesky 1.5K
    Tags
    Administrative Templates Android Automation Autopilot Azure Azure AD Browser Conditional Access Edge EMS Exchange Online Feitian FIDO2 Flow Google Chrome Graph Graph API Identity Management Intune Intune Monitoring iOS KIOSK Logic Apps macOS MEM MEMMonitoring Microsoft 365 Microsoft Edge Microsoft Endpoint Manager Modern Workplace Office 365 OneDrive for Business Outlook Passwordless PowerApps Power Automate Security SharePoint Online Teams Windows Windows 10 Windows10 Windows 11 Windows Autopilot Windows Update
    Copy right

    This information is provided “AS IS” with no warranties, confers no rights and is not supported by the authors, or In The Cloud 24-7.

     

    Copyright © 2025 by In The Cloud 24-7/ Peter Klapwijk. All rights reserved, No part of the information on this web site may be reproduced or posted in any form or by any means without the prior written permission of the publisher.

    Shorthand; Don’t pass off my work as yours, it’s not nice.

    Recent Comments
    • Parth Savjadiya on Using Visual Studio with Microsoft Endpoint Privilege Management, some notes
    • Chris Johnson on Assign Deny Local Log On user right to an (Azure) AD group by using Microsoft Intune
    • Northernsky on Automatically wipe a Windows 10 device after a number of authentication failures
    • Henrik on Intune Driver update for Windows – Get applicable devices
    • Adam on Get notified on expiring Azure App Registration client secrets
    most popular

    Application installation issues; Download pending

    October 1, 2024

    Restrict which users can logon into a Windows 10 device with Microsoft Intune

    April 11, 2020

    How to change the Windows 11 language with Intune

    November 11, 2022

    Update Microsoft Edge during Windows Autopilot enrollments

    July 9, 2024
    Peter Klapwijk – In The Cloud 24-7
    X (Twitter) LinkedIn YouTube RSS Bluesky
    © 2025 ThemeSphere. Designed by ThemeSphere.

    Type above and press Enter to search. Press Esc to cancel.

    Manage Cookie Consent
    To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
    Functional Always active
    The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
    Preferences
    The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
    Statistics
    The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
    Marketing
    The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
    Manage options Manage services Manage {vendor_count} vendors Read more about these purposes
    View preferences
    {title} {title} {title}