0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Azure Data Factory にて git 連携後の publish による手動リリースの検証

Last updated at Posted at 2023-09-06

概要

Azure Data Factory (ADF)のリリース方法が複雑であるため、よりシンプルなリリース方法として git 連携後の publish によりリリースする方法の検証結果を共有します。

次の手順によりリリースを実施する想定です。1 については初回のみの実施であり、2 についてはグローバルパラメータを変更/追加する場合にのみ実施する想定です。

  1. リリース対象の ADF にて Git 連携を実施
  2. factory 配下にある ADF 名の json ファイル(例:factory/manabian-prd.json) にてグローバルパラメータの値を設定
  3. リリース対象の ADF にて publish(発行)を選択

想定のリリース手順

1. リリース対象の ADF にて Git 連携を実施

image.png

2. factory 配下にある ADF 名の json ファイル(例:factory/manabian-prd.json) にてグローバルパラメータの値を設定

image.png

3. リリース対象の ADF にて publish(発行)を選択

image.png

開発時に実施すべき事項

1. リンクドサービスとデータセットをパイプラインからグローバルパラメータを設定

リンクドサービスとデータセットではグローバルパラメータを設定できないため、リンクドサービスとデータセットにてパラメータを設定して、パイプラインでグローバルパラメータに基づいてパラメータを設定する必要があります。

image.png

検証用環境とプログラムの作成

リソース作成と権原付与

開発環境とリリース先環境として次のリソースを作成して、Azure Data Factory のマネージド ID に対して Azure Storage のストレージ BLOB データ共同作成者権限を付与する。開発環境とリリース先環境にて同じ git レポジトリーを参照させて、 git レポジトリーへのコミットは開発環境の ADF からのみ行います。

  • 開発環境
    • Azure Data Factory
    • Azure Storage
  • リリース先環境
    • Azure Data Factory
    • Azure Storage

開発環境にてグローバルパラメータの作成

image.png

開発環境にてリンクドサービスの作成

image.png

リンクドサービスの json 定義
{
    "name": "AzureBlobStorage1",
    "properties": {
        "parameters": {
            "conn_str": {
                "type": "string"
            }
        },
        "annotations": [],
        "type": "AzureBlobStorage",
        "typeProperties": {
            "serviceEndpoint": "@{linkedService().conn_str}",
            "accountKind": "StorageV2"
        }
    }
}

開発環境にてデータセットの作成

image.png

データセットの json 定義
{
    "name": "DelimitedText1",
    "properties": {
        "linkedServiceName": {
            "referenceName": "AzureBlobStorage1",
            "type": "LinkedServiceReference",
            "parameters": {
                "conn_str": {
                    "value": "@dataset().conn_str",
                    "type": "Expression"
                }
            }
        },
        "parameters": {
            "conn_str": {
                "type": "string"
            }
        },
        "annotations": [],
        "type": "DelimitedText",
        "typeProperties": {
            "location": {
                "type": "AzureBlobStorageLocation"
            },
            "columnDelimiter": ",",
            "escapeChar": "\\",
            "firstRowAsHeader": true,
            "quoteChar": "\""
        },
        "schema": []
    }
}

開発環境にてパイプラインの作成

image.png

パイプラインの json 定義
{
    "name": "pipeline1",
    "properties": {
        "activities": [
            {
                "name": "Get Metadata1",
                "type": "GetMetadata",
                "dependsOn": [],
                "policy": {
                    "timeout": "0.12:00:00",
                    "retry": 0,
                    "retryIntervalInSeconds": 30,
                    "secureOutput": false,
                    "secureInput": false
                },
                "userProperties": [],
                "typeProperties": {
                    "dataset": {
                        "referenceName": "DelimitedText1",
                        "type": "DatasetReference",
                        "parameters": {
                            "conn_str": {
                                "value": "@pipeline().globalParameters.azure_storage_conn",
                                "type": "Expression"
                            }
                        }
                    },
                    "fieldList": [
                        "exists"
                    ],
                    "storeSettings": {
                        "type": "AzureBlobStorageReadSettings",
                        "recursive": true,
                        "enablePartitionDiscovery": false
                    },
                    "formatSettings": {
                        "type": "DelimitedTextReadSettings"
                    }
                }
            }
        ],
        "annotations": []
    }
}

リリース先環境にてグローバルパラメータを設定

開発環境の ADF にてコミットした内容を git レポジトリー経由で取得して、リリース先環境の ADF にてグローバルパラメータを設定します。

image.png

リリース先環境での実行確認

publishの実行可否の確認

正常終了することを確認。

image.png

パイプライン実行の確認

正常終了することを確認。

image.png

0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?