diff --git a/samples/azure-http-key-vault/README.md b/samples/azure-http-key-vault/README.md new file mode 100644 index 00000000..cb7e6829 --- /dev/null +++ b/samples/azure-http-key-vault/README.md @@ -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.** + + \ No newline at end of file diff --git a/samples/azure-http-key-vault/assets/AppRegistration.png b/samples/azure-http-key-vault/assets/AppRegistration.png new file mode 100644 index 00000000..c424a0de Binary files /dev/null and b/samples/azure-http-key-vault/assets/AppRegistration.png differ diff --git a/samples/azure-http-key-vault/assets/AzurePermissionConfiguration.png b/samples/azure-http-key-vault/assets/AzurePermissionConfiguration.png new file mode 100644 index 00000000..3e3e6a2f Binary files /dev/null and b/samples/azure-http-key-vault/assets/AzurePermissionConfiguration.png differ diff --git a/samples/azure-http-key-vault/assets/AzurePermissionRequest.png b/samples/azure-http-key-vault/assets/AzurePermissionRequest.png new file mode 100644 index 00000000..b17310c4 Binary files /dev/null and b/samples/azure-http-key-vault/assets/AzurePermissionRequest.png differ diff --git a/samples/azure-http-key-vault/assets/HttpConnectorAutorizationToken.png b/samples/azure-http-key-vault/assets/HttpConnectorAutorizationToken.png new file mode 100644 index 00000000..c12eaf88 Binary files /dev/null and b/samples/azure-http-key-vault/assets/HttpConnectorAutorizationToken.png differ diff --git a/samples/azure-http-key-vault/assets/InvokingKeyVault.png b/samples/azure-http-key-vault/assets/InvokingKeyVault.png new file mode 100644 index 00000000..e10a7519 Binary files /dev/null and b/samples/azure-http-key-vault/assets/InvokingKeyVault.png differ diff --git a/samples/azure-http-key-vault/assets/flow.png b/samples/azure-http-key-vault/assets/flow.png new file mode 100644 index 00000000..fa2bac7a Binary files /dev/null and b/samples/azure-http-key-vault/assets/flow.png differ diff --git a/samples/azure-http-key-vault/assets/sample.json b/samples/azure-http-key-vault/assets/sample.json new file mode 100644 index 00000000..604adc92 --- /dev/null +++ b/samples/azure-http-key-vault/assets/sample.json @@ -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" + } + ] + } +] diff --git a/samples/azure-http-key-vault/solution/azure-http-key-vault.zip b/samples/azure-http-key-vault/solution/azure-http-key-vault.zip new file mode 100644 index 00000000..28a12dc7 Binary files /dev/null and b/samples/azure-http-key-vault/solution/azure-http-key-vault.zip differ diff --git a/samples/azure-http-key-vault/sourcecode/Other/Customizations.xml b/samples/azure-http-key-vault/sourcecode/Other/Customizations.xml new file mode 100644 index 00000000..f1966605 --- /dev/null +++ b/samples/azure-http-key-vault/sourcecode/Other/Customizations.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + 1033 + + \ No newline at end of file diff --git a/samples/azure-http-key-vault/sourcecode/Other/Solution.xml b/samples/azure-http-key-vault/sourcecode/Other/Solution.xml new file mode 100644 index 00000000..6499c93f --- /dev/null +++ b/samples/azure-http-key-vault/sourcecode/Other/Solution.xml @@ -0,0 +1,89 @@ + + + + azurehttpkeyvault + + + + + + + 1.0.0.0 + 0 + + Microsoft_365_and_Power_Platform_Community + + + + + + + + https://pnp.github.io/ + pnp + 89378 + +
+ 1 + 1 + + + + + + + + + + + + + + + + 1 + + + + + + + + +
+
+ 2 + 1 + + + + + + + + + + + + + + + + 1 + + + + + + + + +
+
+
+ + + + +
+
\ No newline at end of file diff --git a/samples/azure-http-key-vault/sourcecode/Workflows/KeyVaults-D65CAE56-B9A3-F011-BBD3-0022480B4618.json b/samples/azure-http-key-vault/sourcecode/Workflows/KeyVaults-D65CAE56-B9A3-F011-BBD3-0022480B4618.json new file mode 100644 index 00000000..0c017780 --- /dev/null +++ b/samples/azure-http-key-vault/sourcecode/Workflows/KeyVaults-D65CAE56-B9A3-F011-BBD3-0022480B4618.json @@ -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=&scope=https://vault.azure.net/.default&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" +} \ No newline at end of file diff --git a/samples/azure-http-key-vault/sourcecode/Workflows/KeyVaults-D65CAE56-B9A3-F011-BBD3-0022480B4618.json.data.xml b/samples/azure-http-key-vault/sourcecode/Workflows/KeyVaults-D65CAE56-B9A3-F011-BBD3-0022480B4618.json.data.xml new file mode 100644 index 00000000..067bbe78 --- /dev/null +++ b/samples/azure-http-key-vault/sourcecode/Workflows/KeyVaults-D65CAE56-B9A3-F011-BBD3-0022480B4618.json.data.xml @@ -0,0 +1,27 @@ + + + /Workflows/KeyVaults-D65CAE56-B9A3-F011-BBD3-0022480B4618.json + 1 + 0 + 5 + 0 + 4 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 1 + 1 + 1.0.0.0 + 1 + 0 + 1 + 0 + none + + + + \ No newline at end of file