Skip to content

Commit 0143250

Browse files
authored
Merge pull request #235 from SQLPlayer/develop
The module accepts **Credentials** type of object (when loading from files), but the deployment is skipped and not supported yet. #156
2 parents 66abe19 + 8d762f2 commit 0143250

18 files changed

+125
-18
lines changed

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,10 @@ The main advantage of the module is the ability to publish all the Azure Data Fa
3636
* Build function to support validation of files, dependencies and config
3737
* Test connections (Linked Services)
3838
* Generates mermaid dependencies diagram to be used in MarkDown type of documents
39-
40-
The following features coming in the future:
41-
* Unit Tests of selected Pipelines and Linked Services
4239

43-
> The module publishes code, which is created and maintained by ADF in a code repository, when configured.
40+
# Known issues
41+
42+
The module accepts **Credentials** type of object (when loading from files), but the deployment is skipped and not supported yet. [Read more here](https://github.com/SQLPlayer/azure.datafactory.tools/issues/156).
4443

4544
# Overview
4645

adhoc/Test-AdfArmTemplate-debug.ps1

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Import-Module ".\azure.datafactory.tools.psd1" -Force
22
$VerbosePreference = 'Continue'
33
$ErrorActionPreference = 'Stop'
44

5-
$folder = 'd:\GitHub\mrpaulandrew\Azure-Data-Integration-Pipelines-Advanced-Design-and-Delivery\Code\DataFactory'
5+
$folder = 'X:\!WORK\GitHub\!SQLPlayer\azure.datafactory.tools\test\adf1'
66
Export-AdfToArmTemplate -RootFolder $folder
77

88
Publish-AdfV2FromJson -RootFolder $folder -ResourceGroupName 'rg-devops' -DataFactoryName 'padf2022bits' -Location 'uksouth'
@@ -14,4 +14,6 @@ $r
1414
Get-AzContext
1515

1616
$adf = Import-AdfFromFolder -FactoryName 'abc' -RootFolder $folder
17-
Get-AdfDocDiagram -adf $adf
17+
$doc = Get-AdfDocDiagram -adf $adf
18+
$doc | Set-Content 'diagram.md'
19+
$doc

azure.datafactory.tools.psd1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Generated by: Kamil Nowinski @ SQLPlayer.net
55
#
6-
# Generated on: 25/04/2022
6+
# Generated on: 10/10/2022
77
#
88

99
@{
@@ -12,7 +12,7 @@
1212
RootModule = 'azure.datafactory.tools.psm1'
1313

1414
# Version number of this module.
15-
ModuleVersion = '0.97.0'
15+
ModuleVersion = '0.99.0'
1616

1717
# Supported PSEditions
1818
# CompatiblePSEditions = @()

changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66

7+
## [0.99.0] - 2022-10-24
8+
### Fixed
9+
* The module accepts **Credentials** type of object (when loading from files), but the deployment is skipped and not supported yet. #156
10+
711
## [0.97.0] - 2022-04-25
812
### Fixed
913
* `Publish-AdfV2UsingArm` cmdlet to make it compatible with PS 5.1

diagram.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Option 1 (:::)
2+
::: mermaid
3+
graph LR
4+
dataset.movie_dataflow_sink --> linkedService.BlobSampleData
5+
dataset.movie_dataflow_source --> linkedService.BlobSampleData
6+
dataflow.MovieDemo --> dataset.movie_dataflow_sink
7+
dataflow.MovieDemo --> dataset.movie_dataflow_source
8+
:::
9+
10+
# Option 2 (```)
11+
``` mermaid
12+
graph LR
13+
dataset.movie_dataflow_sink --> linkedService.BlobSampleData
14+
dataset.movie_dataflow_source --> linkedService.BlobSampleData
15+
dataflow.MovieDemo --> dataset.movie_dataflow_sink
16+
dataflow.MovieDemo --> dataset.movie_dataflow_source
17+
```

private/Adf.class.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,15 @@ class Adf {
1717
[System.Collections.ArrayList] $Factories = @{}
1818
[System.Collections.ArrayList] $ManagedVirtualNetwork = @{}
1919
[System.Collections.ArrayList] $ManagedPrivateEndpoints = @{}
20+
[System.Collections.ArrayList] $Credentials = @{}
2021
[string] $Location = ""
2122
[AdfGlobalProp] $GlobalFactory = [AdfGlobalProp]::new()
2223
[AdfPublishOption] $PublishOptions
2324
$ArmTemplateJson
2425

2526
[System.Collections.ArrayList] AllObjects()
2627
{
27-
return $this.LinkedServices + $this.Pipelines + $this.DataSets + $this.DataFlows + $this.Triggers + $this.IntegrationRuntimes + $this.Factories + $this.ManagedVirtualNetwork + $this.ManagedPrivateEndpoints
28+
return $this.LinkedServices + $this.Pipelines + $this.DataSets + $this.DataFlows + $this.Triggers + $this.IntegrationRuntimes + $this.Factories + $this.ManagedVirtualNetwork + $this.ManagedPrivateEndpoints + $this.Credentials
2829
}
2930

3031
[hashtable] GetObjectsByFullName([string]$pattern)

private/AdfObject.class.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class AdfObject {
8383
return $ofn
8484
}
8585

86-
static $AllowedTypes = @('integrationRuntime', 'pipeline', 'dataset', 'dataflow', 'linkedService', 'trigger', 'factory', 'managedVirtualNetwork', 'managedPrivateEndpoint')
86+
static $AllowedTypes = @('integrationRuntime', 'pipeline', 'dataset', 'dataflow', 'linkedService', 'trigger', 'factory', 'managedVirtualNetwork', 'managedPrivateEndpoint', 'credential')
8787

8888
static AssertType ([string] $Type)
8989
{

private/ConvertTo-AdfType.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ function ConvertTo-AdfType {
1515
'Microsoft.DataFactory/factories/dataflows' { $resType = 'dataflow' }
1616
'Microsoft.DataFactory/factories/linkedservices' { $resType = 'linkedService' }
1717
'Microsoft.DataFactory/factories/triggers' { $resType = 'trigger' }
18+
'Microsoft.DataFactory/factories/credentials' { $resType = 'credential' }
1819
'Microsoft.DataFactory/factories/managedVirtualNetworks' { $resType = 'managedVirtualNetwork' }
1920
'Microsoft.DataFactory/factories/managedVirtualNetworks/managedPrivateEndpoints' { $resType = 'managedVirtualNetwork\default\managedPrivateEndpoint' }
2021
'Microsoft.DataFactory/factories' { $resType = 'factory' }

private/Deploy-AdfObjectOnly.ps1

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ function Deploy-AdfObjectOnly {
2121

2222
$type = $obj.Type
2323
if ($script:PublishMethod -eq "AzResource") { $type = "AzResource" }
24+
if ($obj.Type -eq "credential") { $type = $obj.Type }
2425
# Global parameters is being deployed with different method:
2526
if ($obj.Type -eq "factory") { $type = "GlobalParameters" }
2627

@@ -121,6 +122,11 @@ function Deploy-AdfObjectOnly {
121122
-DefinitionFile $obj.FileName `
122123
-Force | Out-Null
123124
}
125+
'credential'
126+
{
127+
Write-Warning "Credentials are not yet supported. The deployment for the object is skipped."
128+
Write-Warning "Any reference to the object causes error, unless to deploy it before."
129+
}
124130
'AzResource'
125131
{
126132
$resType = Get-AzureResourceType $obj.Type

private/Get-AdfObjectByName.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ function Get-AdfObjectByName {
3535
{
3636
$r = $adf.Triggers | Where-Object { $_.Name -eq $name } | Select-Object -First 1
3737
}
38+
'Credential'
39+
{
40+
$r = $adf.Credentials | Where-Object { $_.Name -eq $name } | Select-Object -First 1
41+
}
3842
'Factory'
3943
{
4044
$r = $adf.Factories | Where-Object { $_.Name -eq $name } | Select-Object -First 1

0 commit comments

Comments
 (0)