4

DataFactory/Refresh PBI Dataset.json

 3 years ago
source link: https://github.com/DC-AC/DataFactory/blob/master/Refresh%20PBI%20Dataset.json
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
master

DataFactory/Refresh PBI Dataset.json

Go to file

336 lines (336 sloc) 13.6 KB

{ "name": "Refresh PBI Dataset", "properties": { "activities": [ { "name": "Call Dataset Refresh", "type": "WebActivity", "dependsOn": [ { "activity": "Get AAD Token", "dependencyConditions": [ "Succeeded" ] } ], "policy": { "timeout": "7.00:00:00", "retry": 0, "retryIntervalInSeconds": 30, "secureOutput": true, "secureInput": true }, "userProperties": [], "typeProperties": { "url": { "value": "@concat('https://api.powerbi.com/v1.0/myorg/groups/',pipeline().parameters.PBIAppWorkspaceId,'/datasets/',pipeline().parameters.PBIDatasetId,'/refreshes')", "type": "Expression" }, "method": "POST", "headers": { "Authorization": { "value": "@concat(string(activity('Get AAD Token').output.token_type),' ',string(activity('Get AAD Token').output.access_token))", "type": "Expression" } }, "body": { "helloww": "worldddd" } } }, { "name": "Get AAD Token", "type": "WebActivity", "dependsOn": [ { "activity": "Get TenantId from AKV", "dependencyConditions": [ "Succeeded" ] }, { "activity": "Get ClientId from AKV", "dependencyConditions": [ "Succeeded" ] }, { "activity": "Get Secret from AKV", "dependencyConditions": [ "Succeeded" ] } ], "policy": { "timeout": "7.00:00:00", "retry": 0, "retryIntervalInSeconds": 30, "secureOutput": true, "secureInput": true }, "userProperties": [], "typeProperties": { "url": { "value": "@concat('https://login.microsoftonline.com/',activity('Get TenantId from AKV').output.value,'/oauth2/token')", "type": "Expression" }, "method": "POST", "headers": { "Content-Type": "application/x-www-form-urlencoded" }, "body": { "value": "@concat('grant_type=client_credentials&resource=https://analysis.windows.net/powerbi/api&client_id=',activity('Get ClientId from AKV').output.value,'&client_secret=',encodeUriComponent(activity('Get Secret from AKV').output.value))", "type": "Expression" } } }, { "name": "Get TenantId from AKV", "type": "WebActivity", "dependsOn": [], "policy": { "timeout": "7.00:00:00", "retry": 0, "retryIntervalInSeconds": 30, "secureOutput": true, "secureInput": true }, "userProperties": [], "typeProperties": { "url": { "value": "@concat(pipeline().parameters.KeyVaultDNSName,'secrets/',pipeline().parameters.SecretName_TenantId,'/',pipeline().parameters.SecretVersion_TenantId,'?api-version=7.0')", "type": "Expression" }, "method": "GET", "body": { "simple": "body" }, "authentication": { "type": "MSI", "resource": "https://vault.azure.net" } } }, { "name": "Get ClientId from AKV", "type": "WebActivity", "dependsOn": [], "policy": { "timeout": "7.00:00:00", "retry": 0, "retryIntervalInSeconds": 30, "secureOutput": true, "secureInput": true }, "userProperties": [], "typeProperties": { "url": { "value": "@concat(pipeline().parameters.KeyVaultDNSName,'secrets/',pipeline().parameters.SecretName_SPClientId,'/',pipeline().parameters.SecretVersion_SPClientId,'?api-version=7.0')", "type": "Expression" }, "method": "GET", "body": { "simple": "body" }, "authentication": { "type": "MSI", "resource": "https://vault.azure.net" } } }, { "name": "Get Secret from AKV", "type": "WebActivity", "dependsOn": [], "policy": { "timeout": "7.00:00:00", "retry": 0, "retryIntervalInSeconds": 30, "secureOutput": true, "secureInput": true }, "userProperties": [], "typeProperties": { "url": { "value": "@concat(pipeline().parameters.KeyVaultDNSName,'secrets/',pipeline().parameters.SecretName_SPSecret,'/',pipeline().parameters.SecretVersion_SPSecret,'?api-version=7.0')", "type": "Expression" }, "method": "GET", "body": { "simple": "body" }, "authentication": { "type": "MSI", "resource": "https://vault.azure.net" } } }, { "name": "Until Refresh Complete", "type": "Until", "dependsOn": [ { "activity": "Call Dataset Refresh", "dependencyConditions": [ "Succeeded" ] } ], "userProperties": [], "typeProperties": { "expression": { "value": "@not(equals('Unknown',variables('RefreshStatus')))", "type": "Expression" }, "activities": [ { "name": "Get Dataset Refresh Status", "type": "WebActivity", "dependsOn": [ { "activity": "Wait1", "dependencyConditions": [ "Succeeded" ] } ], "policy": { "timeout": "7.00:00:00", "retry": 0, "retryIntervalInSeconds": 30, "secureOutput": true, "secureInput": true }, "userProperties": [], "typeProperties": { "url": { "value": "@concat('https://api.powerbi.com/v1.0/myorg/groups/',pipeline().parameters.PBIAppWorkspaceId,'/datasets/',pipeline().parameters.PBIDatasetId,'/refreshes?$top=1')", "type": "Expression" }, "method": "GET", "headers": { "Authorization": { "value": "@concat(string(activity('Get AAD Token').output.token_type),' ',string(activity('Get AAD Token').output.access_token))", "type": "Expression" } }, "body": { "helloww": "worldddd" } } }, { "name": "Set RefreshStatus", "type": "SetVariable", "dependsOn": [ { "activity": "Get Dataset Refresh Status", "dependencyConditions": [ "Succeeded" ] } ], "userProperties": [], "typeProperties": { "variableName": "RefreshStatus", "value": { "value": "@activity('Get Dataset Refresh Status').output.value[0].status", "type": "Expression" } } }, { "name": "Wait1", "type": "Wait", "dependsOn": [], "userProperties": [], "typeProperties": { "waitTimeInSeconds": 30 } } ], "timeout": "7.00:00:00" } }, { "name": "Refresh Succeeded", "type": "IfCondition", "dependsOn": [ { "activity": "Until Refresh Complete", "dependencyConditions": [ "Succeeded" ] } ], "userProperties": [], "typeProperties": { "expression": { "value": "@equals(variables('RefreshStatus'),'Completed')", "type": "Expression" }, "ifFalseActivities": [ { "name": "Fail Pipeline", "type": "WebActivity", "dependsOn": [], "policy": { "timeout": "7.00:00:00", "retry": 0, "retryIntervalInSeconds": 30, "secureOutput": false, "secureInput": false }, "userProperties": [], "typeProperties": { "url": "https://ThrowAnError ", "method": "POST", "body": "Fail" } } ] } } ], "parameters": { "SecretName_TenantId": { "type": "String", "defaultValue": "TenantId" }, "SecretName_SPClientId": { "type": "String", "defaultValue": "ClientId" }, "SecretName_SPSecret": { "type": "String", "defaultValue": "ClientSecret" }, "KeyVaultDNSName": { "type": "string" }, "SecretVersion_TenantId": { "type": "string" }, "SecretVersion_SPClientId": { "type": "string" }, "SecretVersion_SPSecret": { "type": "string" }, "PBIAppWorkspaceId": { "type": "string" }, "PBIDatasetId": { "type": "string" } }, "variables": { "RefreshStatus": { "type": "String", "defaultValue": "Unknown" } }, "annotations": [] }, "type": "Microsoft.DataFactory/factories/pipelines" }


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK