I have a vast park of Azure Data Factories and I would like to see it in details.
In order to do so I have this PowerShell script:
# Connect to Azure account
Connect-AzAccount
# Header for displaying pipeline information
$header = "ADF Location" + "`t" + "ResourceGroupName" + "`t" + "AdfName" + "`t" + "Pipeline Name"
# List of Resource Groups to be searched for Azure Data Factory (ADF) Pipelines
$RGs = "RG1", "RG2"
# Iterate through each Resource Group to Get ADFs and Then Iterate through each ADF to get Pipelines List
foreach ($ResourceGroupName in $RGs) {
# Get list ADFs associated with the resource group
$ADFs = Get-AzDataFactory -ResourceGroupName $ResourceGroupName
# Iterate through each ADF to get list of Pipelines associated with the ADF
foreach ($ADF in $ADFs) {
# Get list of Pipelines for the ADF
$Pipelines = Get-AzDataFactoryPipeline -ResourceGroupName $ResourceGroupName -DataFactoryName $ADF.DataFactoryName
# Iterate through each pipeline to get detailed information
foreach ($Pipeline in $Pipelines) {
# Get Detailed information about the pipeline
#$P = Get-AzDataFactoryPipeline -ResourceGroupName $ResourceGroupName -name $Pipeline.name -DataFactoryName $ADF.DataFactoryName
# Print the Pipeline Name along with Location, Resource Group & ADF name
Write-Output ($ADF.Location + "`t" + $ResourceGroupName + "`t" + $ADF.DataFactoryName + "`t" + $Pipeline.name)
} # End of Pipelines loop
} # End of ADFs loop
} # End of Resource Groups Loop
But once again gods are not on my side and they return me the error:
HTTP Status Code: NotFound Error Code: InvalidResourceType Error Message: The resource type could not be found
in the namespace 'Microsoft.DataFactory' for api version '2015-10-01'. Request Id:
cc590f66-c00f-4a63-ae46-800f38436949 Timestamp (Utc):02/28/2024 15:20:24
What am I doing wrong now?
ChatGPT replies like a broken toy... there is a long way before it takes over developers jobs...
The solution was that first of all you have to put yourself under that Subscription that is containing that Resource Group:
And then you can run:
Here the code: