An Azure service for ingesting, preparing, and transforming data at scale.
It has been done in two steps.
- one powershell script creates MPE in ADF (Using Rest API)
# Variables
$gcc="xxx"
$resourceGroupName = "resourceGroupName"
$dataFactoryName = "dataFactoryName-$gcc-05"
$functionAppName = "functionAppName-$gcc-05"
$privateEndpointName = "pe_linked_service_fun_$gcc"
$location = "West Europe"
$subscriptionId = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
$privateLinkResourceId="/subscriptions/$subscriptionId/resourceGroups/$resourceGroupName/providers/Microsoft.Web/sites/$functionAppName"
# Authenticate and get access token
#Connect-AzAccount
$context = Set-AzContext -SubscriptionId $subscriptionId
$context.Subscription.Name
$ADFazProfile = [Microsoft.Azure.Commands.Common.Authentication.Abstractions.AzureRmProfileProvider]::Instance.Profile;
$ADFprofileClient = New-Object -TypeName Microsoft.Azure.Commands.ResourceManager.Common.RMProfileClient -ArgumentList ($ADFazProfile);
$ADFtoken = $ADFprofileClient.AcquireAccessToken($context.Subscription.TenantId);
$ADFauthHeader = @{
'Content-Type'='application/json'
'Authorization'='Bearer ' + $ADFtoken.AccessToken
};
# Create a Managed Private Endpoint for ADF
$privateEndpointUri = "https://management.azure.com/subscriptions/$subscriptionId/resourceGroups/$resourceGroupName/providers/Microsoft.DataFactory/factories/$dataFactoryName/managedVirtualNetworks/default/managedPrivateEndpoints/$privateEndpointName"
$apiVersion="?api-version=2018-06-01"
$body = @{
"name" = "$privateEndpointName"
"properties" = @{
"privateLinkResourceId" = "$privateLinkResourceId"
"groupId" = "sites"
"fqdns" = @(
"$functionAppName.azurewebsites.net",
"$functionAppName.scm.azurewebsites.net"
)
}
}
# Convert the body to JSON
$jsonBody = $body | ConvertTo-Json
$response = Invoke-RestMethod -Uri $privateEndpointUri$apiVersion -Method PUT -Headers $ADFauthHeader -Body $jsonBody
$response
- One PowerShell script approve MPE in ADF (Using Azure PowerShell module)