Created
July 4, 2023 12:06
-
-
Save amirlehmam/851d8a6ed1f193b60347e43fbf21cc17 to your computer and use it in GitHub Desktop.
LogicApps
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "definition": { | |
| "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#", | |
| "actions": { | |
| "Analyser_JSON": { | |
| "inputs": { | |
| "content": "@body('HTTP_2__Workspaces')", | |
| "schema": { | |
| "properties": { | |
| "@@odata.context": { | |
| "type": "string" | |
| }, | |
| "@@odata.count": { | |
| "type": "integer" | |
| }, | |
| "value": { | |
| "items": { | |
| "properties": { | |
| "capacityId": { | |
| "type": "string" | |
| }, | |
| "id": { | |
| "type": "string" | |
| }, | |
| "isOnDedicatedCapacity": { | |
| "type": "boolean" | |
| }, | |
| "isReadOnly": { | |
| "type": "boolean" | |
| }, | |
| "name": { | |
| "type": "string" | |
| }, | |
| "type": { | |
| "type": "string" | |
| } | |
| }, | |
| "required": [ | |
| "id", | |
| "isReadOnly", | |
| "isOnDedicatedCapacity", | |
| "type", | |
| "name" | |
| ], | |
| "type": "object" | |
| }, | |
| "type": "array" | |
| } | |
| }, | |
| "type": "object" | |
| } | |
| }, | |
| "runAfter": { | |
| "HTTP_2__Workspaces": [ | |
| "Succeeded" | |
| ] | |
| }, | |
| "type": "ParseJson" | |
| }, | |
| "Créer_un_fichier": { | |
| "inputs": { | |
| "body": "@body('HTTP__Dataflows')", | |
| "host": { | |
| "connection": { | |
| "name": "@parameters('$connections')['sharepointonline']['connectionId']" | |
| } | |
| }, | |
| "method": "post", | |
| "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://loreal.sharepoint.com/sites/-FR-POWERBIFACTORY'))}/files", | |
| "queries": { | |
| "folderPath": "/Documents partages/LogicApps/Listes_PowerBI", | |
| "name": "liste_dataflows_AMF.json", | |
| "queryParametersSingleEncoded": true | |
| } | |
| }, | |
| "runAfter": { | |
| "HTTP__Dataflows": [ | |
| "Succeeded" | |
| ] | |
| }, | |
| "runtimeConfiguration": { | |
| "contentTransfer": { | |
| "transferMode": "Chunked" | |
| } | |
| }, | |
| "type": "ApiConnection" | |
| }, | |
| "Créer_un_fichier_2": { | |
| "inputs": { | |
| "body": "@body('HTTP_2__Workspaces')", | |
| "host": { | |
| "connection": { | |
| "name": "@parameters('$connections')['sharepointonline']['connectionId']" | |
| } | |
| }, | |
| "method": "post", | |
| "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://loreal.sharepoint.com/sites/-FR-POWERBIFACTORY'))}/files", | |
| "queries": { | |
| "folderPath": "/Documents partages/LogicApps/Listes_PowerBI", | |
| "name": "liste_workspace.json", | |
| "queryParametersSingleEncoded": true | |
| } | |
| }, | |
| "runAfter": { | |
| "HTTP_2__Workspaces": [ | |
| "Succeeded" | |
| ] | |
| }, | |
| "runtimeConfiguration": { | |
| "contentTransfer": { | |
| "transferMode": "Chunked" | |
| } | |
| }, | |
| "type": "ApiConnection" | |
| }, | |
| "HTTP": { | |
| "inputs": { | |
| "authentication": { | |
| "audience": "https://analysis.windows.net/powerbi/api", | |
| "clientId": "defa6c02-9757-41f3-85c2-9247d28c2d9e", | |
| "secret": "-G98Q~Vo3Dsq3hmrIGCjaQ.PSkZbYdM9CyiXeaYF", | |
| "tenant": "e4e1abd9-eac7-4a71-ab52-da5c998aa7ba", | |
| "type": "ActiveDirectoryOAuth" | |
| }, | |
| "method": "POST", | |
| "uri": "https://api.powerbi.com/v1.0/myorg/groups/65ad7bd1-3139-4bc5-9cf8-e2f96485aa06/datasets/659ecbdb-34ff-4024-9f6a-ed8a61c8805c/refreshes" | |
| }, | |
| "runAfter": { | |
| "Pour_chaque_2": [ | |
| "Succeeded", | |
| "TimedOut", | |
| "Skipped", | |
| "Failed" | |
| ] | |
| }, | |
| "type": "Http" | |
| }, | |
| "HTTP_2__Workspaces": { | |
| "inputs": { | |
| "authentication": { | |
| "audience": "https://analysis.windows.net/powerbi/api", | |
| "clientId": "defa6c02-9757-41f3-85c2-9247d28c2d9e", | |
| "secret": "-G98Q~Vo3Dsq3hmrIGCjaQ.PSkZbYdM9CyiXeaYF", | |
| "tenant": "e4e1abd9-eac7-4a71-ab52-da5c998aa7ba", | |
| "type": "ActiveDirectoryOAuth" | |
| }, | |
| "method": "GET", | |
| "uri": "https://api.powerbi.com/v1.0/myorg/groups" | |
| }, | |
| "runAfter": { | |
| "Créer_un_fichier": [ | |
| "Succeeded" | |
| ] | |
| }, | |
| "type": "Http" | |
| }, | |
| "HTTP__Dataflows": { | |
| "inputs": { | |
| "authentication": { | |
| "audience": "https://analysis.windows.net/powerbi/api", | |
| "clientId": "defa6c02-9757-41f3-85c2-9247d28c2d9e", | |
| "secret": "-G98Q~Vo3Dsq3hmrIGCjaQ.PSkZbYdM9CyiXeaYF", | |
| "tenant": "e4e1abd9-eac7-4a71-ab52-da5c998aa7ba", | |
| "type": "ActiveDirectoryOAuth" | |
| }, | |
| "method": "GET", | |
| "uri": "https://api.powerbi.com/v1.0/myorg/groups/fc478a8a-880c-4751-962d-46fb1af0b718/dataflows" | |
| }, | |
| "runAfter": { | |
| "Until__Sourcing": [ | |
| "Succeeded" | |
| ] | |
| }, | |
| "type": "Http" | |
| }, | |
| "Initialiser_la_variable": { | |
| "inputs": { | |
| "variables": [ | |
| { | |
| "name": "Taille_boucle", | |
| "type": "integer", | |
| "value": 0 | |
| } | |
| ] | |
| }, | |
| "runAfter": { | |
| "Pour_chaque_5": [ | |
| "Succeeded" | |
| ] | |
| }, | |
| "type": "InitializeVariable" | |
| }, | |
| "Obtenir_les_fichiers_(propriétés_uniquement)_2__Dataflows": { | |
| "inputs": { | |
| "host": { | |
| "connection": { | |
| "name": "@parameters('$connections')['sharepointonline']['connectionId']" | |
| } | |
| }, | |
| "method": "get", | |
| "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://loreal.sharepoint.com/sites/-FR-POWERBIFACTORY'))}/tables/@{encodeURIComponent(encodeURIComponent('ec0a8754-35f3-4630-b9df-bf8420f0db0d'))}/getfileitems", | |
| "queries": { | |
| "folderPath": "/Documents partages/LogicApps/Dataflows" | |
| } | |
| }, | |
| "runAfter": { | |
| "Pour_chaque": [ | |
| "Succeeded" | |
| ] | |
| }, | |
| "type": "ApiConnection" | |
| }, | |
| "Obtenir_les_fichiers_(propriétés_uniquement)_3__Datasets": { | |
| "inputs": { | |
| "host": { | |
| "connection": { | |
| "name": "@parameters('$connections')['sharepointonline']['connectionId']" | |
| } | |
| }, | |
| "method": "get", | |
| "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://loreal.sharepoint.com/sites/-FR-POWERBIFACTORY'))}/tables/@{encodeURIComponent(encodeURIComponent('ec0a8754-35f3-4630-b9df-bf8420f0db0d'))}/getfileitems", | |
| "queries": { | |
| "folderPath": "/Documents partages/LogicApps/Datasets" | |
| } | |
| }, | |
| "runAfter": { | |
| "Pour_chaque_3": [ | |
| "Succeeded" | |
| ] | |
| }, | |
| "type": "ApiConnection" | |
| }, | |
| "Obtenir_les_fichiers_(propriétés_uniquement)__Listes_PowerBI": { | |
| "inputs": { | |
| "host": { | |
| "connection": { | |
| "name": "@parameters('$connections')['sharepointonline']['connectionId']" | |
| } | |
| }, | |
| "method": "get", | |
| "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://loreal.sharepoint.com/sites/-FR-POWERBIFACTORY'))}/tables/@{encodeURIComponent(encodeURIComponent('ec0a8754-35f3-4630-b9df-bf8420f0db0d'))}/getfileitems", | |
| "queries": { | |
| "folderPath": "/Documents partages/LogicApps/Listes_PowerBI" | |
| } | |
| }, | |
| "runAfter": {}, | |
| "type": "ApiConnection" | |
| }, | |
| "Pour_chaque": { | |
| "actions": { | |
| "Supprimer_le_fichier": { | |
| "inputs": { | |
| "host": { | |
| "connection": { | |
| "name": "@parameters('$connections')['sharepointonline']['connectionId']" | |
| } | |
| }, | |
| "method": "delete", | |
| "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://loreal.sharepoint.com/sites/-FR-POWERBIFACTORY'))}/files/@{encodeURIComponent(items('Pour_chaque')?['{Identifier}'])}" | |
| }, | |
| "runAfter": {}, | |
| "type": "ApiConnection" | |
| } | |
| }, | |
| "foreach": "@body('Obtenir_les_fichiers_(propriétés_uniquement)__Listes_PowerBI')?['value']", | |
| "runAfter": { | |
| "Obtenir_les_fichiers_(propriétés_uniquement)__Listes_PowerBI": [ | |
| "Succeeded" | |
| ] | |
| }, | |
| "type": "Foreach" | |
| }, | |
| "Pour_chaque_2": { | |
| "actions": { | |
| "Analyser_JSON_3": { | |
| "inputs": { | |
| "content": "@body('HTTP_4__datasets')", | |
| "schema": { | |
| "properties": { | |
| "@@odata.context": { | |
| "type": "string" | |
| }, | |
| "value": { | |
| "items": { | |
| "properties": { | |
| "addRowsAPIEnabled": { | |
| "type": "boolean" | |
| }, | |
| "configuredBy": { | |
| "type": "string" | |
| }, | |
| "createReportEmbedURL": { | |
| "type": "string" | |
| }, | |
| "createdDate": { | |
| "type": "string" | |
| }, | |
| "id": { | |
| "type": "string" | |
| }, | |
| "isEffectiveIdentityRequired": { | |
| "type": "boolean" | |
| }, | |
| "isEffectiveIdentityRolesRequired": { | |
| "type": "boolean" | |
| }, | |
| "isOnPremGatewayRequired": { | |
| "type": "boolean" | |
| }, | |
| "isRefreshable": { | |
| "type": "boolean" | |
| }, | |
| "name": { | |
| "type": "string" | |
| }, | |
| "qnaEmbedURL": { | |
| "type": "string" | |
| }, | |
| "targetStorageMode": { | |
| "type": "string" | |
| }, | |
| "upstreamDatasets": { | |
| "type": "array" | |
| }, | |
| "users": { | |
| "type": "array" | |
| }, | |
| "webUrl": { | |
| "type": "string" | |
| } | |
| }, | |
| "required": [ | |
| "id", | |
| "name", | |
| "webUrl", | |
| "addRowsAPIEnabled", | |
| "isRefreshable", | |
| "isEffectiveIdentityRequired", | |
| "isEffectiveIdentityRolesRequired", | |
| "isOnPremGatewayRequired", | |
| "targetStorageMode", | |
| "createdDate", | |
| "createReportEmbedURL", | |
| "qnaEmbedURL", | |
| "upstreamDatasets", | |
| "users" | |
| ], | |
| "type": "object" | |
| }, | |
| "type": "array" | |
| } | |
| }, | |
| "type": "object" | |
| } | |
| }, | |
| "runAfter": { | |
| "Créer_un_fichier_4": [ | |
| "Succeeded" | |
| ] | |
| }, | |
| "type": "ParseJson" | |
| }, | |
| "Créer_un_fichier_10": { | |
| "inputs": { | |
| "body": "@body('HTTP_2_TOUS_LES_DF')", | |
| "host": { | |
| "connection": { | |
| "name": "@parameters('$connections')['sharepointonline']['connectionId']" | |
| } | |
| }, | |
| "method": "post", | |
| "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://loreal.sharepoint.com/sites/-FR-POWERBIFACTORY'))}/files", | |
| "queries": { | |
| "folderPath": "/Documents partages/LogicApps/All_DF", | |
| "name": "listesDF__@{items('Pour_chaque_2')?['name']}.json", | |
| "queryParametersSingleEncoded": true | |
| } | |
| }, | |
| "runAfter": { | |
| "HTTP_2_TOUS_LES_DF": [ | |
| "Succeeded" | |
| ] | |
| }, | |
| "runtimeConfiguration": { | |
| "contentTransfer": { | |
| "transferMode": "Chunked" | |
| } | |
| }, | |
| "type": "ApiConnection" | |
| }, | |
| "Créer_un_fichier_3": { | |
| "inputs": { | |
| "body": "@body('HTTP_3__LienDataflows')", | |
| "host": { | |
| "connection": { | |
| "name": "@parameters('$connections')['sharepointonline']['connectionId']" | |
| } | |
| }, | |
| "method": "post", | |
| "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://loreal.sharepoint.com/sites/-FR-POWERBIFACTORY'))}/files", | |
| "queries": { | |
| "folderPath": "/Documents partages/LogicApps/Dataflows", | |
| "name": "DFLOW__@{items('Pour_chaque_2')?['name']}.json", | |
| "queryParametersSingleEncoded": true | |
| } | |
| }, | |
| "runAfter": { | |
| "HTTP_3__LienDataflows": [ | |
| "Succeeded" | |
| ] | |
| }, | |
| "runtimeConfiguration": { | |
| "contentTransfer": { | |
| "transferMode": "Chunked" | |
| } | |
| }, | |
| "type": "ApiConnection" | |
| }, | |
| "Créer_un_fichier_4": { | |
| "inputs": { | |
| "body": "@body('HTTP_4__datasets')", | |
| "host": { | |
| "connection": { | |
| "name": "@parameters('$connections')['sharepointonline']['connectionId']" | |
| } | |
| }, | |
| "method": "post", | |
| "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://loreal.sharepoint.com/sites/-FR-POWERBIFACTORY'))}/files", | |
| "queries": { | |
| "folderPath": "/Documents partages/LogicApps/Datasets", | |
| "name": "DSET__@{items('Pour_chaque_2')?['name']}.json", | |
| "queryParametersSingleEncoded": true | |
| } | |
| }, | |
| "runAfter": { | |
| "HTTP_4__datasets": [ | |
| "Succeeded" | |
| ] | |
| }, | |
| "runtimeConfiguration": { | |
| "contentTransfer": { | |
| "transferMode": "Chunked" | |
| } | |
| }, | |
| "type": "ApiConnection" | |
| }, | |
| "Créer_un_fichier_7": { | |
| "inputs": { | |
| "body": "@body('HTTP_2_Rapports')", | |
| "host": { | |
| "connection": { | |
| "name": "@parameters('$connections')['sharepointonline']['connectionId']" | |
| } | |
| }, | |
| "method": "post", | |
| "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://loreal.sharepoint.com/sites/-FR-POWERBIFACTORY'))}/files", | |
| "queries": { | |
| "folderPath": "/Documents partages/LogicApps/Rapports", | |
| "name": "REP__@{items('Pour_chaque_2')?['name']}.json", | |
| "queryParametersSingleEncoded": true | |
| } | |
| }, | |
| "runAfter": { | |
| "HTTP_2_Rapports": [ | |
| "Succeeded" | |
| ] | |
| }, | |
| "runtimeConfiguration": { | |
| "contentTransfer": { | |
| "transferMode": "Chunked" | |
| } | |
| }, | |
| "type": "ApiConnection" | |
| }, | |
| "HTTP_2_Rapports": { | |
| "inputs": { | |
| "authentication": { | |
| "audience": "https://analysis.windows.net/powerbi/api", | |
| "clientId": "defa6c02-9757-41f3-85c2-9247d28c2d9e", | |
| "secret": "-G98Q~Vo3Dsq3hmrIGCjaQ.PSkZbYdM9CyiXeaYF", | |
| "tenant": "e4e1abd9-eac7-4a71-ab52-da5c998aa7ba", | |
| "type": "ActiveDirectoryOAuth" | |
| }, | |
| "method": "GET", | |
| "uri": "https://api.powerbi.com/v1.0/myorg/groups/@{items('Pour_chaque_2')?['id']}/reports" | |
| }, | |
| "runAfter": { | |
| "Créer_un_fichier_10": [ | |
| "Succeeded" | |
| ] | |
| }, | |
| "type": "Http" | |
| }, | |
| "HTTP_2_TOUS_LES_DF": { | |
| "inputs": { | |
| "authentication": { | |
| "audience": "https://analysis.windows.net/powerbi/api", | |
| "clientId": "defa6c02-9757-41f3-85c2-9247d28c2d9e", | |
| "secret": "-G98Q~Vo3Dsq3hmrIGCjaQ.PSkZbYdM9CyiXeaYF", | |
| "tenant": "e4e1abd9-eac7-4a71-ab52-da5c998aa7ba", | |
| "type": "ActiveDirectoryOAuth" | |
| }, | |
| "method": "GET", | |
| "uri": "https://api.powerbi.com/v1.0/myorg/groups/@{items('Pour_chaque_2')?['id']}/dataflows" | |
| }, | |
| "runAfter": { | |
| "Créer_un_fichier_3": [ | |
| "Succeeded" | |
| ] | |
| }, | |
| "type": "Http" | |
| }, | |
| "HTTP_3__LienDataflows": { | |
| "inputs": { | |
| "authentication": { | |
| "audience": "https://analysis.windows.net/powerbi/api", | |
| "clientId": "defa6c02-9757-41f3-85c2-9247d28c2d9e", | |
| "secret": "-G98Q~Vo3Dsq3hmrIGCjaQ.PSkZbYdM9CyiXeaYF", | |
| "tenant": "e4e1abd9-eac7-4a71-ab52-da5c998aa7ba", | |
| "type": "ActiveDirectoryOAuth" | |
| }, | |
| "method": "GET", | |
| "uri": "https://api.powerbi.com/v1.0/myorg/groups/@{items('Pour_chaque_2')?['id']}/datasets/upstreamDataflows" | |
| }, | |
| "runAfter": {}, | |
| "type": "Http" | |
| }, | |
| "HTTP_4__datasets": { | |
| "inputs": { | |
| "authentication": { | |
| "audience": "https://analysis.windows.net/powerbi/api", | |
| "clientId": "defa6c02-9757-41f3-85c2-9247d28c2d9e", | |
| "secret": "-G98Q~Vo3Dsq3hmrIGCjaQ.PSkZbYdM9CyiXeaYF", | |
| "tenant": "e4e1abd9-eac7-4a71-ab52-da5c998aa7ba", | |
| "type": "ActiveDirectoryOAuth" | |
| }, | |
| "method": "GET", | |
| "uri": "https://api.powerbi.com/v1.0/myorg/groups/@{items('Pour_chaque_2')?['id']}/datasets" | |
| }, | |
| "runAfter": { | |
| "Créer_un_fichier_7": [ | |
| "Succeeded" | |
| ] | |
| }, | |
| "type": "Http" | |
| }, | |
| "Pour_chaque_4": { | |
| "actions": { | |
| "Analyser_JSON_2": { | |
| "inputs": { | |
| "content": "@body('HTTP_2_last_refresh')", | |
| "schema": { | |
| "properties": { | |
| "@@odata.context": { | |
| "type": "string" | |
| }, | |
| "value": { | |
| "items": { | |
| "properties": { | |
| "endTime": { | |
| "type": "string" | |
| }, | |
| "id": { | |
| "type": "integer" | |
| }, | |
| "refreshType": { | |
| "type": "string" | |
| }, | |
| "requestId": { | |
| "type": "string" | |
| }, | |
| "serviceExceptionJson": { | |
| "type": "string" | |
| }, | |
| "startTime": { | |
| "type": "string" | |
| }, | |
| "status": { | |
| "type": "string" | |
| } | |
| }, | |
| "required": [ | |
| "requestId", | |
| "id", | |
| "refreshType", | |
| "startTime", | |
| "endTime", | |
| "status" | |
| ], | |
| "type": "object" | |
| }, | |
| "type": "array" | |
| } | |
| }, | |
| "type": "object" | |
| } | |
| }, | |
| "runAfter": { | |
| "HTTP_2_last_refresh": [ | |
| "Succeeded", | |
| "Failed", | |
| "Skipped", | |
| "TimedOut" | |
| ] | |
| }, | |
| "type": "ParseJson" | |
| }, | |
| "Créer_un_fichier_5": { | |
| "inputs": { | |
| "body": "@body('HTTP_2_refreshhist')", | |
| "host": { | |
| "connection": { | |
| "name": "@parameters('$connections')['sharepointonline']['connectionId']" | |
| } | |
| }, | |
| "method": "post", | |
| "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://loreal.sharepoint.com/sites/-FR-POWERBIFACTORY'))}/files", | |
| "queries": { | |
| "folderPath": "/Documents partages/LogicApps/RefreshHistory", | |
| "name": "RFSH__@{items('Pour_chaque_2')?['name']}__@{items('Pour_chaque_4')?['name']}.json", | |
| "queryParametersSingleEncoded": true | |
| } | |
| }, | |
| "runAfter": { | |
| "HTTP_2_refreshhist": [ | |
| "Succeeded", | |
| "Skipped", | |
| "TimedOut", | |
| "Failed" | |
| ] | |
| }, | |
| "runtimeConfiguration": { | |
| "contentTransfer": { | |
| "transferMode": "Chunked" | |
| } | |
| }, | |
| "type": "ApiConnection" | |
| }, | |
| "HTTP_2_last_refresh": { | |
| "inputs": { | |
| "authentication": { | |
| "audience": "https://analysis.windows.net/powerbi/api", | |
| "clientId": "defa6c02-9757-41f3-85c2-9247d28c2d9e", | |
| "secret": "-G98Q~Vo3Dsq3hmrIGCjaQ.PSkZbYdM9CyiXeaYF", | |
| "tenant": "e4e1abd9-eac7-4a71-ab52-da5c998aa7ba", | |
| "type": "ActiveDirectoryOAuth" | |
| }, | |
| "method": "GET", | |
| "uri": "https://api.powerbi.com/v1.0/myorg/groups/@{items('Pour_chaque_2')?['id']}/datasets/@{items('Pour_chaque_4')?['id']}/refreshes?$top=1" | |
| }, | |
| "runAfter": { | |
| "Créer_un_fichier_5": [ | |
| "Succeeded", | |
| "Failed", | |
| "TimedOut", | |
| "Skipped" | |
| ] | |
| }, | |
| "type": "Http" | |
| }, | |
| "HTTP_2_refreshhist": { | |
| "inputs": { | |
| "authentication": { | |
| "audience": "https://analysis.windows.net/powerbi/api", | |
| "clientId": "defa6c02-9757-41f3-85c2-9247d28c2d9e", | |
| "secret": "-G98Q~Vo3Dsq3hmrIGCjaQ.PSkZbYdM9CyiXeaYF", | |
| "tenant": "e4e1abd9-eac7-4a71-ab52-da5c998aa7ba", | |
| "type": "ActiveDirectoryOAuth" | |
| }, | |
| "method": "GET", | |
| "uri": "https://api.powerbi.com/v1.0/myorg/groups/@{items('Pour_chaque_2')?['id']}/datasets/@{items('Pour_chaque_4')?['id']}/refreshes" | |
| }, | |
| "runAfter": {}, | |
| "type": "Http" | |
| }, | |
| "Pour_chaque_10": { | |
| "actions": { | |
| "Condition": { | |
| "actions": { | |
| "Créer_un_fichier_8": { | |
| "inputs": { | |
| "body": "@body('HTTP_2_erreur_lastRefresh')", | |
| "host": { | |
| "connection": { | |
| "name": "@parameters('$connections')['sharepointonline']['connectionId']" | |
| } | |
| }, | |
| "method": "post", | |
| "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://loreal.sharepoint.com/sites/-FR-POWERBIFACTORY'))}/files", | |
| "queries": { | |
| "folderPath": "/Documents partages/LogicApps/Erreur_LastRefresh", | |
| "name": "ERR__@{items('Pour_chaque_2')?['name']}__@{items('Pour_chaque_4')?['name']}.json", | |
| "queryParametersSingleEncoded": true | |
| } | |
| }, | |
| "runAfter": { | |
| "HTTP_2_erreur_lastRefresh": [ | |
| "Succeeded" | |
| ] | |
| }, | |
| "runtimeConfiguration": { | |
| "contentTransfer": { | |
| "transferMode": "Chunked" | |
| } | |
| }, | |
| "type": "ApiConnection" | |
| }, | |
| "HTTP_2_erreur_lastRefresh": { | |
| "inputs": { | |
| "authentication": { | |
| "audience": "https://analysis.windows.net/powerbi/api", | |
| "clientId": "defa6c02-9757-41f3-85c2-9247d28c2d9e", | |
| "secret": "-G98Q~Vo3Dsq3hmrIGCjaQ.PSkZbYdM9CyiXeaYF", | |
| "tenant": "e4e1abd9-eac7-4a71-ab52-da5c998aa7ba", | |
| "type": "ActiveDirectoryOAuth" | |
| }, | |
| "method": "GET", | |
| "uri": "https://api.powerbi.com/v1.0/myorg/groups/@{items('Pour_chaque_2')?['id']}/datasets/@{items('Pour_chaque_4')?['id']}/refreshes/@{items('Pour_chaque_10')?['requestId']}" | |
| }, | |
| "runAfter": {}, | |
| "type": "Http" | |
| } | |
| }, | |
| "expression": { | |
| "and": [ | |
| { | |
| "equals": [ | |
| "@items('Pour_chaque_10')?['status']", | |
| "Failed" | |
| ] | |
| } | |
| ] | |
| }, | |
| "runAfter": {}, | |
| "type": "If" | |
| } | |
| }, | |
| "foreach": "@body('Analyser_JSON_2')?['value']", | |
| "runAfter": { | |
| "Analyser_JSON_2": [ | |
| "Succeeded", | |
| "Failed", | |
| "Skipped", | |
| "TimedOut" | |
| ] | |
| }, | |
| "type": "Foreach" | |
| } | |
| }, | |
| "foreach": "@body('Analyser_JSON_3')?['value']", | |
| "runAfter": { | |
| "Analyser_JSON_3": [ | |
| "Succeeded" | |
| ] | |
| }, | |
| "type": "Foreach" | |
| }, | |
| "Pour_chaque_9": { | |
| "actions": { | |
| "Créer_un_fichier_6": { | |
| "inputs": { | |
| "body": "@body('HTTP_6__datasources')", | |
| "host": { | |
| "connection": { | |
| "name": "@parameters('$connections')['sharepointonline']['connectionId']" | |
| } | |
| }, | |
| "method": "post", | |
| "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://loreal.sharepoint.com/sites/-FR-POWERBIFACTORY'))}/files", | |
| "queries": { | |
| "folderPath": "/Documents partages/LogicApps/Sourcing", | |
| "name": "SRC__@{items('Pour_chaque_2')?['name']}__@{items('Pour_chaque_9')?['name']}.json", | |
| "queryParametersSingleEncoded": true | |
| } | |
| }, | |
| "runAfter": { | |
| "HTTP_6__datasources": [ | |
| "Succeeded", | |
| "TimedOut", | |
| "Skipped", | |
| "Failed" | |
| ] | |
| }, | |
| "runtimeConfiguration": { | |
| "contentTransfer": { | |
| "transferMode": "Chunked" | |
| } | |
| }, | |
| "type": "ApiConnection" | |
| }, | |
| "Créer_un_fichier_9": { | |
| "inputs": { | |
| "body": "@body('HTTP_2_refresh_plan_schedule')", | |
| "host": { | |
| "connection": { | |
| "name": "@parameters('$connections')['sharepointonline']['connectionId']" | |
| } | |
| }, | |
| "method": "post", | |
| "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://loreal.sharepoint.com/sites/-FR-POWERBIFACTORY'))}/files", | |
| "queries": { | |
| "folderPath": "/Documents partages/LogicApps/ScheduledRefresh_plan", | |
| "name": "RFSHPLAN__@{items('Pour_chaque_2')?['name']}__@{items('Pour_chaque_9')?['name']}.json", | |
| "queryParametersSingleEncoded": true | |
| } | |
| }, | |
| "runAfter": { | |
| "HTTP_2_refresh_plan_schedule": [ | |
| "Succeeded", | |
| "TimedOut", | |
| "Skipped", | |
| "Failed" | |
| ] | |
| }, | |
| "runtimeConfiguration": { | |
| "contentTransfer": { | |
| "transferMode": "Chunked" | |
| } | |
| }, | |
| "type": "ApiConnection" | |
| }, | |
| "HTTP_2_refresh_plan_schedule": { | |
| "inputs": { | |
| "authentication": { | |
| "audience": "https://analysis.windows.net/powerbi/api", | |
| "clientId": "defa6c02-9757-41f3-85c2-9247d28c2d9e", | |
| "secret": "-G98Q~Vo3Dsq3hmrIGCjaQ.PSkZbYdM9CyiXeaYF", | |
| "tenant": "e4e1abd9-eac7-4a71-ab52-da5c998aa7ba", | |
| "type": "ActiveDirectoryOAuth" | |
| }, | |
| "method": "GET", | |
| "uri": "https://api.powerbi.com/v1.0/myorg/groups/@{items('Pour_chaque_2')?['id']}/datasets/@{items('Pour_chaque_9')?['id']}/refreshSchedule" | |
| }, | |
| "runAfter": { | |
| "Créer_un_fichier_6": [ | |
| "Succeeded", | |
| "TimedOut", | |
| "Skipped", | |
| "Failed" | |
| ] | |
| }, | |
| "type": "Http" | |
| }, | |
| "HTTP_6__datasources": { | |
| "inputs": { | |
| "authentication": { | |
| "audience": "https://analysis.windows.net/powerbi/api", | |
| "clientId": "defa6c02-9757-41f3-85c2-9247d28c2d9e", | |
| "secret": "-G98Q~Vo3Dsq3hmrIGCjaQ.PSkZbYdM9CyiXeaYF", | |
| "tenant": "e4e1abd9-eac7-4a71-ab52-da5c998aa7ba", | |
| "type": "ActiveDirectoryOAuth" | |
| }, | |
| "method": "GET", | |
| "uri": "https://api.powerbi.com/v1.0/myorg/groups/@{items('Pour_chaque_2')?['id']}/datasets/@{items('Pour_chaque_9')?['id']}/datasources" | |
| }, | |
| "runAfter": {}, | |
| "type": "Http" | |
| } | |
| }, | |
| "foreach": "@body('Analyser_JSON_3')?['value']", | |
| "runAfter": { | |
| "Analyser_JSON_3": [ | |
| "Succeeded" | |
| ] | |
| }, | |
| "type": "Foreach" | |
| } | |
| }, | |
| "foreach": "@body('Analyser_JSON')?['value']", | |
| "runAfter": { | |
| "Analyser_JSON": [ | |
| "Succeeded" | |
| ], | |
| "Créer_un_fichier_2": [ | |
| "Succeeded" | |
| ] | |
| }, | |
| "type": "Foreach" | |
| }, | |
| "Pour_chaque_3": { | |
| "actions": { | |
| "Supprimer_le_fichier_2": { | |
| "inputs": { | |
| "host": { | |
| "connection": { | |
| "name": "@parameters('$connections')['sharepointonline']['connectionId']" | |
| } | |
| }, | |
| "method": "delete", | |
| "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://loreal.sharepoint.com/sites/-FR-POWERBIFACTORY'))}/files/@{encodeURIComponent(items('Pour_chaque_3')?['{Identifier}'])}" | |
| }, | |
| "runAfter": {}, | |
| "type": "ApiConnection" | |
| } | |
| }, | |
| "foreach": "@body('Obtenir_les_fichiers_(propriétés_uniquement)_2__Dataflows')?['value']", | |
| "runAfter": { | |
| "Obtenir_les_fichiers_(propriétés_uniquement)_2__Dataflows": [ | |
| "Succeeded" | |
| ] | |
| }, | |
| "type": "Foreach" | |
| }, | |
| "Pour_chaque_5": { | |
| "actions": { | |
| "Supprimer_le_fichier_3": { | |
| "inputs": { | |
| "host": { | |
| "connection": { | |
| "name": "@parameters('$connections')['sharepointonline']['connectionId']" | |
| } | |
| }, | |
| "method": "delete", | |
| "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://loreal.sharepoint.com/sites/-FR-POWERBIFACTORY'))}/files/@{encodeURIComponent(items('Pour_chaque_5')?['{Identifier}'])}" | |
| }, | |
| "runAfter": {}, | |
| "type": "ApiConnection" | |
| } | |
| }, | |
| "foreach": "@body('Obtenir_les_fichiers_(propriétés_uniquement)_3__Datasets')?['value']", | |
| "runAfter": { | |
| "Obtenir_les_fichiers_(propriétés_uniquement)_3__Datasets": [ | |
| "Succeeded" | |
| ] | |
| }, | |
| "type": "Foreach" | |
| }, | |
| "Until__Sourcing": { | |
| "actions": { | |
| "Incrémenter_une_variable": { | |
| "inputs": { | |
| "name": "Taille_boucle", | |
| "value": 1 | |
| }, | |
| "runAfter": { | |
| "Pour_chaque_13": [ | |
| "Succeeded" | |
| ] | |
| }, | |
| "type": "IncrementVariable" | |
| }, | |
| "Obtenir_les_fichiers_(propriétés_uniquement)_5": { | |
| "inputs": { | |
| "host": { | |
| "connection": { | |
| "name": "@parameters('$connections')['sharepointonline']['connectionId']" | |
| } | |
| }, | |
| "method": "get", | |
| "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://loreal.sharepoint.com/sites/-FR-POWERBIFACTORY'))}/tables/@{encodeURIComponent(encodeURIComponent('ec0a8754-35f3-4630-b9df-bf8420f0db0d'))}/getfileitems", | |
| "queries": { | |
| "folderPath": "/Documents partages/LogicApps/Sourcing" | |
| } | |
| }, | |
| "runAfter": {}, | |
| "type": "ApiConnection" | |
| }, | |
| "Obtenir_les_fichiers_(propriétés_uniquement)_All_DF": { | |
| "inputs": { | |
| "host": { | |
| "connection": { | |
| "name": "@parameters('$connections')['sharepointonline']['connectionId']" | |
| } | |
| }, | |
| "method": "get", | |
| "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://loreal.sharepoint.com/sites/-FR-POWERBIFACTORY'))}/tables/@{encodeURIComponent(encodeURIComponent('ec0a8754-35f3-4630-b9df-bf8420f0db0d'))}/getfileitems", | |
| "queries": { | |
| "folderPath": "/Documents partages/LogicApps/All_DF" | |
| } | |
| }, | |
| "runAfter": { | |
| "Pour_chaque_12": [ | |
| "Succeeded" | |
| ] | |
| }, | |
| "type": "ApiConnection" | |
| }, | |
| "Obtenir_les_fichiers_(propriétés_uniquement)_Erreur_LastRefresh": { | |
| "inputs": { | |
| "host": { | |
| "connection": { | |
| "name": "@parameters('$connections')['sharepointonline']['connectionId']" | |
| } | |
| }, | |
| "method": "get", | |
| "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://loreal.sharepoint.com/sites/-FR-POWERBIFACTORY'))}/tables/@{encodeURIComponent(encodeURIComponent('ec0a8754-35f3-4630-b9df-bf8420f0db0d'))}/getfileitems", | |
| "queries": { | |
| "folderPath": "/Documents partages/LogicApps/ScheduledRefresh_plan" | |
| } | |
| }, | |
| "runAfter": { | |
| "Pour_chaque_11": [ | |
| "Succeeded" | |
| ] | |
| }, | |
| "type": "ApiConnection" | |
| }, | |
| "Obtenir_les_fichiers_(propriétés_uniquement)_Rapports": { | |
| "inputs": { | |
| "host": { | |
| "connection": { | |
| "name": "@parameters('$connections')['sharepointonline']['connectionId']" | |
| } | |
| }, | |
| "method": "get", | |
| "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://loreal.sharepoint.com/sites/-FR-POWERBIFACTORY'))}/tables/@{encodeURIComponent(encodeURIComponent('ec0a8754-35f3-4630-b9df-bf8420f0db0d'))}/getfileitems", | |
| "queries": { | |
| "folderPath": "/Documents partages/LogicApps/Rapports" | |
| } | |
| }, | |
| "runAfter": { | |
| "Pour_chaque_6": [ | |
| "Succeeded" | |
| ] | |
| }, | |
| "type": "ApiConnection" | |
| }, | |
| "Obtenir_les_fichiers_(propriétés_uniquement)_RefreshHistory": { | |
| "inputs": { | |
| "host": { | |
| "connection": { | |
| "name": "@parameters('$connections')['sharepointonline']['connectionId']" | |
| } | |
| }, | |
| "method": "get", | |
| "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://loreal.sharepoint.com/sites/-FR-POWERBIFACTORY'))}/tables/@{encodeURIComponent(encodeURIComponent('ec0a8754-35f3-4630-b9df-bf8420f0db0d'))}/getfileitems", | |
| "queries": { | |
| "folderPath": "/Documents partages/LogicApps/RefreshHistory" | |
| } | |
| }, | |
| "runAfter": { | |
| "Pour_chaque_7": [ | |
| "Succeeded" | |
| ] | |
| }, | |
| "type": "ApiConnection" | |
| }, | |
| "Obtenir_les_fichiers_(propriétés_uniquement)_ScheduledRefresh_plan": { | |
| "inputs": { | |
| "host": { | |
| "connection": { | |
| "name": "@parameters('$connections')['sharepointonline']['connectionId']" | |
| } | |
| }, | |
| "method": "get", | |
| "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://loreal.sharepoint.com/sites/-FR-POWERBIFACTORY'))}/tables/@{encodeURIComponent(encodeURIComponent('ec0a8754-35f3-4630-b9df-bf8420f0db0d'))}/getfileitems", | |
| "queries": { | |
| "folderPath": "/Documents partages/LogicApps/ScheduledRefresh_plan" | |
| } | |
| }, | |
| "runAfter": { | |
| "Pour_chaque_8": [ | |
| "Succeeded" | |
| ] | |
| }, | |
| "type": "ApiConnection" | |
| }, | |
| "Pour_chaque_11": { | |
| "actions": { | |
| "Supprimer_le_fichier_7": { | |
| "inputs": { | |
| "host": { | |
| "connection": { | |
| "name": "@parameters('$connections')['sharepointonline']['connectionId']" | |
| } | |
| }, | |
| "method": "delete", | |
| "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://loreal.sharepoint.com/sites/-FR-POWERBIFACTORY'))}/files/@{encodeURIComponent(items('Pour_chaque_11')?['{Identifier}'])}" | |
| }, | |
| "runAfter": {}, | |
| "type": "ApiConnection" | |
| } | |
| }, | |
| "foreach": "@body('Obtenir_les_fichiers_(propriétés_uniquement)_ScheduledRefresh_plan')?['value']", | |
| "runAfter": { | |
| "Obtenir_les_fichiers_(propriétés_uniquement)_ScheduledRefresh_plan": [ | |
| "Succeeded" | |
| ] | |
| }, | |
| "type": "Foreach" | |
| }, | |
| "Pour_chaque_12": { | |
| "actions": { | |
| "Supprimer_le_fichier_8": { | |
| "inputs": { | |
| "host": { | |
| "connection": { | |
| "name": "@parameters('$connections')['sharepointonline']['connectionId']" | |
| } | |
| }, | |
| "method": "delete", | |
| "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://loreal.sharepoint.com/sites/-FR-POWERBIFACTORY'))}/files/@{encodeURIComponent(items('Pour_chaque_12')?['{Identifier}'])}" | |
| }, | |
| "runAfter": {}, | |
| "type": "ApiConnection" | |
| } | |
| }, | |
| "foreach": "@body('Obtenir_les_fichiers_(propriétés_uniquement)_Erreur_LastRefresh')?['value']", | |
| "runAfter": { | |
| "Obtenir_les_fichiers_(propriétés_uniquement)_Erreur_LastRefresh": [ | |
| "Succeeded" | |
| ] | |
| }, | |
| "type": "Foreach" | |
| }, | |
| "Pour_chaque_13": { | |
| "actions": { | |
| "Supprimer_le_fichier_9": { | |
| "inputs": { | |
| "host": { | |
| "connection": { | |
| "name": "@parameters('$connections')['sharepointonline']['connectionId']" | |
| } | |
| }, | |
| "method": "delete", | |
| "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://loreal.sharepoint.com/sites/-FR-POWERBIFACTORY'))}/files/@{encodeURIComponent(items('Pour_chaque_13')?['{Identifier}'])}" | |
| }, | |
| "runAfter": {}, | |
| "type": "ApiConnection" | |
| } | |
| }, | |
| "foreach": "@body('Obtenir_les_fichiers_(propriétés_uniquement)_All_DF')?['value']", | |
| "runAfter": { | |
| "Obtenir_les_fichiers_(propriétés_uniquement)_All_DF": [ | |
| "Succeeded" | |
| ] | |
| }, | |
| "type": "Foreach" | |
| }, | |
| "Pour_chaque_6": { | |
| "actions": { | |
| "Supprimer_le_fichier_4": { | |
| "inputs": { | |
| "host": { | |
| "connection": { | |
| "name": "@parameters('$connections')['sharepointonline']['connectionId']" | |
| } | |
| }, | |
| "method": "delete", | |
| "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://loreal.sharepoint.com/sites/-FR-POWERBIFACTORY'))}/files/@{encodeURIComponent(items('Pour_chaque_6')?['{Identifier}'])}" | |
| }, | |
| "runAfter": {}, | |
| "type": "ApiConnection" | |
| } | |
| }, | |
| "foreach": "@body('Obtenir_les_fichiers_(propriétés_uniquement)_RefreshHistory')?['value']", | |
| "runAfter": { | |
| "Obtenir_les_fichiers_(propriétés_uniquement)_RefreshHistory": [ | |
| "Succeeded" | |
| ] | |
| }, | |
| "type": "Foreach" | |
| }, | |
| "Pour_chaque_7": { | |
| "actions": { | |
| "Supprimer_le_fichier_5": { | |
| "inputs": { | |
| "host": { | |
| "connection": { | |
| "name": "@parameters('$connections')['sharepointonline']['connectionId']" | |
| } | |
| }, | |
| "method": "delete", | |
| "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://loreal.sharepoint.com/sites/-FR-POWERBIFACTORY'))}/files/@{encodeURIComponent(items('Pour_chaque_7')?['{Identifier}'])}" | |
| }, | |
| "runAfter": {}, | |
| "type": "ApiConnection" | |
| } | |
| }, | |
| "foreach": "@body('Obtenir_les_fichiers_(propriétés_uniquement)_5')?['value']", | |
| "runAfter": { | |
| "Obtenir_les_fichiers_(propriétés_uniquement)_5": [ | |
| "Succeeded" | |
| ] | |
| }, | |
| "type": "Foreach" | |
| }, | |
| "Pour_chaque_8": { | |
| "actions": { | |
| "Supprimer_le_fichier_6": { | |
| "inputs": { | |
| "host": { | |
| "connection": { | |
| "name": "@parameters('$connections')['sharepointonline']['connectionId']" | |
| } | |
| }, | |
| "method": "delete", | |
| "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://loreal.sharepoint.com/sites/-FR-POWERBIFACTORY'))}/files/@{encodeURIComponent(items('Pour_chaque_8')?['{Identifier}'])}" | |
| }, | |
| "runAfter": {}, | |
| "type": "ApiConnection" | |
| } | |
| }, | |
| "foreach": "@body('Obtenir_les_fichiers_(propriétés_uniquement)_Rapports')?['value']", | |
| "runAfter": { | |
| "Obtenir_les_fichiers_(propriétés_uniquement)_Rapports": [ | |
| "Succeeded" | |
| ] | |
| }, | |
| "type": "Foreach" | |
| } | |
| }, | |
| "expression": "@equals(variables('Taille_boucle'), 7)", | |
| "limit": { | |
| "count": 60, | |
| "timeout": "PT1H" | |
| }, | |
| "runAfter": { | |
| "Initialiser_la_variable": [ | |
| "Succeeded" | |
| ] | |
| }, | |
| "type": "Until" | |
| } | |
| }, | |
| "contentVersion": "1.0.0.0", | |
| "outputs": {}, | |
| "parameters": { | |
| "$connections": { | |
| "defaultValue": {}, | |
| "type": "Object" | |
| } | |
| }, | |
| "triggers": { | |
| "Recurrence": { | |
| "evaluatedRecurrence": { | |
| "frequency": "Day", | |
| "interval": 1, | |
| "schedule": { | |
| "hours": [ | |
| "11" | |
| ], | |
| "minutes": [ | |
| 15 | |
| ] | |
| } | |
| }, | |
| "recurrence": { | |
| "frequency": "Day", | |
| "interval": 1, | |
| "schedule": { | |
| "hours": [ | |
| "11" | |
| ], | |
| "minutes": [ | |
| 15 | |
| ] | |
| } | |
| }, | |
| "type": "Recurrence" | |
| } | |
| } | |
| }, | |
| "parameters": { | |
| "$connections": { | |
| "value": { | |
| "sharepointonline": { | |
| "connectionId": "/subscriptions/f7f6af07-56a5-4044-a6a7-d6a4530dd5fe/resourceGroups/RG-BI-POWERBI/providers/Microsoft.Web/connections/sharepointonline-1", | |
| "connectionName": "sharepointonline-1", | |
| "id": "/subscriptions/f7f6af07-56a5-4044-a6a7-d6a4530dd5fe/providers/Microsoft.Web/locations/northeurope/managedApis/sharepointonline" | |
| } | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment