Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 88 additions & 0 deletions samples/azure-http-key-vault/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Azure HTTP Key Vault

## Summary

A HTTP Request via Graph API to Azure Key Vault

![picture of the flow](assets/flow.png)

## Applies to

![Power Apps](https://img.shields.io/badge/Power%20Apps-No-red "No")
![Power Automate](https://img.shields.io/badge/Power%20Automate-Yes-green "Yes")
![Power BI](https://img.shields.io/badge/Power%20BI-No-red "No")
![Power Pages](https://img.shields.io/badge/Power%20Pages-No-red "No")
![Power Virtual Agents](https://img.shields.io/badge/Power%20Virtual%20Agents-No-red "No")
![Dataverse](https://img.shields.io/badge/Dataverse-No-red "No")
![AI Builder](https://img.shields.io/badge/AI%20Builder-No-red "No")
![Custom Connectors](https://img.shields.io/badge/Custom%20Connectors-No-red "No")
![Power Fx](https://img.shields.io/badge/Power%20Fx-No-red "No")

## Compatibility

![Premium License](https://img.shields.io/badge/Premium%20License-Required-green.svg "Premium license required")
![Experimental Features](https://img.shields.io/badge/Experimental%20Features-No-red.svg "Does not rely on experimental features")

## Contributors

* [Divya Akula](https://github.com/divya-akula)



## Version history

Version|Date|Comments
-------|----|--------
1.0|Sep 18, 2022|Initial release
2.0|October 07, 2025|Migration from powerapps-samples repository with solution repacking by [Jan Chlebek](https://github.com/jan-chlebek)

## Minimal Path to Awesome
* [Download](./solution/azure-http-key-vault.zip) the `.zip` from the `solution` folder
* Within **Power Automate**, import the solution `.zip` file using **Solutions** > **Import Solution** and select the `.zip` file you just packed.

## Features

Azure Key vault helps us to securely store passwords ,Power Automate has an inbuilt connector that helps us to retrieve the passwords safely, but when moving the flows across tenants , we might need to reconfigure the flow for appropriate credentials. To prevent this we can go with the graphapi invocation to azure using the HTTP connector.

This pattern also helps to understand the OAuth way of invoking a Azure or any other resource that supports OAuth.

Prerequisites:
As the app uses HTTP way to connect to Azure platform , the connector would need appropriate permissions to invoke an Azure Resource.To do this
1. User has to navigate to [Azure Portal](https://portal.azure.com)
2. Create new App registration as shown in the below screenshot

![picture of the flow](assets/AppRegistration.png)

3. Once the application is registered,navigate to the **API Permissions** > **Add Permission** > **Select Microsoft Graph** > **APIConnectors.Read.All**

![picture of the flow](assets/AzurePermissionRequest.png)

4. Once the permissions are requested , the administrator has to give the consent before using the HTTP connector

![picture of the flow](assets/AzurePermissionConfiguration.png)



## Help

We do not support samples, but this community is always willing to help, and we want to improve these samples. We use GitHub to track issues, which makes it easy for community members to volunteer their time and help resolve issues.

If you encounter any issues while using this sample, you can [create a new issue](https://github.com/pnp/powerapps-samples/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&template=bug-report.yml&sample=azure-http-key-vault&authors=@divya-akula&title=azure-http-key-vault%20-%20).

For questions regarding this sample, [create a new question](https://github.com/pnp/powerapps-samples/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&template=question.yml&sample=azure-http-key-vault&authors=@divya-akula&title=azure-http-key-vault%20-%20).

Finally, if you have an idea for improvement, [make a suggestion](https://github.com/pnp/powerapps-samples/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&template=suggestion.yml&sample=azure-http-key-vault&authors=@divya-akula&title=azure-http-key-vault%20-%20).


## For more information

- [Create your first flow](https://docs.microsoft.com/en-us/power-automate/getting-started#create-your-first-flow)
- [Microsoft Power Automate documentation](https://docs.microsoft.com/en-us/power-automate/)



## Disclaimer

**THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.**

<img src="https://m365-visitor-stats.azurewebsites.net/powerplatform-samples/samples/azure-http-key-vault" aria-hidden="true" />
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added samples/azure-http-key-vault/assets/flow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
75 changes: 75 additions & 0 deletions samples/azure-http-key-vault/assets/sample.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
[
{
"name": "pnp-powerplatform-samples-azure-http-key-vault",
"source": "pnp",
"title": "Leveraging Graph API to get password from Azure Key Vault",
"shortDescription": "A sample for getting the keyvault details using graph api",
"url": "https://github.com/pnp/powerplatform-samples/tree/main/samples/azure-http-key-vault",
"downloadUrl": "https://pnp.github.io/download-partial/?url=https://github.com/pnp/powerplatform-samples/tree/main/samples/azure-http-key-vault",
"longDescription": [
"The sample provides details on can you leverage the graph api to connect to azure platform along with the authentication details."
],
"creationDateTime": "2022-09-16",
"updateDateTime": "2025-10-07",
"products": [
"Power Automate",
"PowerPlatform-samples"
],
"tags": [
"PATTERNS", "EXCEPTION-HANDLING"
],
"categories": [
"CLOUD-FLOW"
],
"metadata": [
{
"key": "POWERAPPS-EXPERIMENTAL",
"value": "No"
},
{
"key": "POWERAPPS-PREMIUM",
"value": "Yes"
},
{
"key": "POWERAPPS-ONPREM",
"value": "No"
},
{
"key": "POWERAPPS-CUSTOMCONNECTOR",
"value": "No"
}
],
"thumbnails": [
{
"type": "image",
"order": 100,
"url": "https://github.com/pnp/powerplatform-samples/raw/main/samples/azure-http-key-vault/assets/flow.png?raw=true",
"alt": "Preview PNG"
}
],
"authors": [
{
"gitHubAccount": "divya-akula",
"name": "Divya Akula",
"pictureUrl": "https://avatars.githubusercontent.com/u/9211327?v=4"
}
],
"references": [
{
"name": "Create your first flow",
"description": "Anyone from a basic business user to an IT professional can create automated processes using Power Automate's no-code/low-code platform.",
"url": "https://docs.microsoft.com/en-us/power-automate/getting-started#create-your-first-flow"
},
{
"name": "Microsoft Power Automate documentation",
"description": "Power Automate is a service that helps you create automated workflows between your favorite apps and services to synchronize files, get notifications, collect data, and more.",
"url": "https://docs.microsoft.com/en-us/power-automate/"
},
{
"name": "Application Registration in Azure",
"description": "Application registration would be needed whenever we are trying to access any of the graph APIs",
"url": "https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-configure-app-access-web-apis"
}
]
}
]
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"properties": {
"connectionReferences": {},
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"$authentication": {
"defaultValue": {},
"type": "SecureObject"
}
},
"triggers": {
"manual": {
"metadata": {
"operationMetadataId": "08397e2f-9fff-455d-863a-d9ce43908b8d"
},
"type": "Request",
"kind": "Button",
"inputs": {
"schema": {
"type": "object",
"properties": {},
"required": []
}
}
}
},
"actions": {
"AuthorizationToken": {
"runAfter": {},
"metadata": {
"operationMetadataId": "cd28a01b-8008-4075-8d68-71461fa23ab0"
},
"type": "Http",
"inputs": {
"method": "POST",
"uri": "https://login.microsoftonline.com/c09030dd-81e0-44af-a342-68c9358c43dd/oauth2/v2.0/token",
"headers": {
"Content-Type": "application/x-www-form-urlencoded"
},
"body": "client_id=<client_id>&scope=https://vault.azure.net/.default&client_secret=<client_secret>&grant_type=client_credentials"
}
},
"InvokeKeyVault": {
"runAfter": {
"AuthorizationToken": [
"Succeeded"
]
},
"metadata": {
"operationMetadataId": "fbbadc42-0136-46d3-a39f-67f2c91fc405"
},
"type": "Http",
"inputs": {
"method": "GET",
"uri": "https://cognitiveapivault.vault.azure.net/secrets/UnoKey/087b33200a8d482aafbb58f20fb863c9?api-Version=7.3",
"headers": {
"Authorization": "@{concat('Bearer ',body('AuthorizationToken')?['access_token'])}"
}
}
}
}
},
"templateName": null
},
"schemaVersion": "1.0.0.0"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?xml version="1.0" encoding="utf-8"?><Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="xml" ContentType="application/octet-stream" /><Default Extension="json" ContentType="application/octet-stream" /></Types>
43 changes: 43 additions & 0 deletions samples/azure-http-key-vault/sourcecode/customizations.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<ImportExportXml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" OrganizationVersion="9.2.25093.138" OrganizationSchemaType="Full" CRMServerServiceabilityVersion="9.2.25095.00139">
<Entities></Entities>
<Roles></Roles>
<Workflows>
<Workflow WorkflowId="{d65cae56-b9a3-f011-bbd3-0022480b4618}" Name="KeyVaults">
<JsonFileName>/Workflows/KeyVaults-D65CAE56-B9A3-F011-BBD3-0022480B4618.json</JsonFileName>
<Type>1</Type>
<Subprocess>0</Subprocess>
<Category>5</Category>
<Mode>0</Mode>
<Scope>4</Scope>
<OnDemand>0</OnDemand>
<TriggerOnCreate>0</TriggerOnCreate>
<TriggerOnDelete>0</TriggerOnDelete>
<AsyncAutodelete>0</AsyncAutodelete>
<SyncWorkflowLogOnFailure>0</SyncWorkflowLogOnFailure>
<StateCode>0</StateCode>
<StatusCode>1</StatusCode>
<RunAs>1</RunAs>
<IsTransacted>1</IsTransacted>
<IntroducedVersion>1.0.0.0</IntroducedVersion>
<IsCustomizable>1</IsCustomizable>
<BusinessProcessType>0</BusinessProcessType>
<IsCustomProcessingStepAllowedForOtherPublishers>1</IsCustomProcessingStepAllowedForOtherPublishers>
<ModernFlowType>0</ModernFlowType>
<PrimaryEntity>none</PrimaryEntity>
<LocalizedNames>
<LocalizedName languagecode="1033" description="KeyVaults" />
</LocalizedNames>
</Workflow>
</Workflows>
<FieldSecurityProfiles></FieldSecurityProfiles>
<Templates />
<EntityMaps />
<EntityRelationships />
<OrganizationSettings />
<optionsets />
<CustomControls />
<EntityDataProviders />
<Languages>
<Language>1033</Language>
</Languages>
</ImportExportXml>
88 changes: 88 additions & 0 deletions samples/azure-http-key-vault/sourcecode/solution.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<ImportExportXml version="9.2.25093.138" SolutionPackageVersion="9.2" languagecode="1033" generatedBy="CrmLive" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" OrganizationVersion="9.2.25093.138" OrganizationSchemaType="Full" CRMServerServiceabilityVersion="9.2.25095.00139">
<SolutionManifest>
<UniqueName>azurehttpkeyvault</UniqueName>
<LocalizedNames>
<LocalizedName description="azure-http-key-vault" languagecode="1033" />
</LocalizedNames>
<Descriptions>
<Description description="A HTTP Request via Graph API to Azure Key Vault" languagecode="1033" />
</Descriptions>
<Version>1.0.0.0</Version>
<Managed>0</Managed>
<Publisher>
<UniqueName>Microsoft_365_and_Power_Platform_Community</UniqueName>
<LocalizedNames>
<LocalizedName description="Microsoft 365 &amp; Power Platform Community" languagecode="1033" />
</LocalizedNames>
<Descriptions>
<Description description="Microsoft community sample publisher" languagecode="1033" />
</Descriptions>
<EMailAddress xsi:nil="true"></EMailAddress>
<SupportingWebsiteUrl>https://pnp.github.io/</SupportingWebsiteUrl>
<CustomizationPrefix>pnp</CustomizationPrefix>
<CustomizationOptionValuePrefix>89378</CustomizationOptionValuePrefix>
<Addresses>
<Address>
<AddressNumber>1</AddressNumber>
<AddressTypeCode>1</AddressTypeCode>
<City xsi:nil="true"></City>
<County xsi:nil="true"></County>
<Country xsi:nil="true"></Country>
<Fax xsi:nil="true"></Fax>
<FreightTermsCode xsi:nil="true"></FreightTermsCode>
<ImportSequenceNumber xsi:nil="true"></ImportSequenceNumber>
<Latitude xsi:nil="true"></Latitude>
<Line1 xsi:nil="true"></Line1>
<Line2 xsi:nil="true"></Line2>
<Line3 xsi:nil="true"></Line3>
<Longitude xsi:nil="true"></Longitude>
<Name xsi:nil="true"></Name>
<PostalCode xsi:nil="true"></PostalCode>
<PostOfficeBox xsi:nil="true"></PostOfficeBox>
<PrimaryContactName xsi:nil="true"></PrimaryContactName>
<ShippingMethodCode>1</ShippingMethodCode>
<StateOrProvince xsi:nil="true"></StateOrProvince>
<Telephone1 xsi:nil="true"></Telephone1>
<Telephone2 xsi:nil="true"></Telephone2>
<Telephone3 xsi:nil="true"></Telephone3>
<TimeZoneRuleVersionNumber xsi:nil="true"></TimeZoneRuleVersionNumber>
<UPSZone xsi:nil="true"></UPSZone>
<UTCOffset xsi:nil="true"></UTCOffset>
<UTCConversionTimeZoneCode xsi:nil="true"></UTCConversionTimeZoneCode>
</Address>
<Address>
<AddressNumber>2</AddressNumber>
<AddressTypeCode>1</AddressTypeCode>
<City xsi:nil="true"></City>
<County xsi:nil="true"></County>
<Country xsi:nil="true"></Country>
<Fax xsi:nil="true"></Fax>
<FreightTermsCode xsi:nil="true"></FreightTermsCode>
<ImportSequenceNumber xsi:nil="true"></ImportSequenceNumber>
<Latitude xsi:nil="true"></Latitude>
<Line1 xsi:nil="true"></Line1>
<Line2 xsi:nil="true"></Line2>
<Line3 xsi:nil="true"></Line3>
<Longitude xsi:nil="true"></Longitude>
<Name xsi:nil="true"></Name>
<PostalCode xsi:nil="true"></PostalCode>
<PostOfficeBox xsi:nil="true"></PostOfficeBox>
<PrimaryContactName xsi:nil="true"></PrimaryContactName>
<ShippingMethodCode>1</ShippingMethodCode>
<StateOrProvince xsi:nil="true"></StateOrProvince>
<Telephone1 xsi:nil="true"></Telephone1>
<Telephone2 xsi:nil="true"></Telephone2>
<Telephone3 xsi:nil="true"></Telephone3>
<TimeZoneRuleVersionNumber xsi:nil="true"></TimeZoneRuleVersionNumber>
<UPSZone xsi:nil="true"></UPSZone>
<UTCOffset xsi:nil="true"></UTCOffset>
<UTCConversionTimeZoneCode xsi:nil="true"></UTCConversionTimeZoneCode>
</Address>
</Addresses>
</Publisher>
<RootComponents>
<RootComponent type="29" id="{d65cae56-b9a3-f011-bbd3-0022480b4618}" behavior="0" />
</RootComponents>
<MissingDependencies />
</SolutionManifest>
</ImportExportXml>