Skip to content

Latest commit

 

History

History
198 lines (162 loc) · 3.98 KB

az_datafactory.md

File metadata and controls

198 lines (162 loc) · 3.98 KB

az_datafactory

az_datafactory(
    name,
    config,
    factory_name,
    resource,
    resource_group,
    resource_name,
    template
)

A rule for setting basic properties for other rules.

Attributes
name

Name, required

Unique name for this rule.

config

Label, required

Label of az_config target.

factory_name

String, required

The factory name.

This field supports stamp variables.

resource

String, required

The type of the object in the DataFactory.

Supported values ​​are: pipeline and trigger.

resource_group

String, required

Name of resource group.

This field supports stamp variables.

resource_name

String, required

The resource name (pipeline or trigger).

template

json file, required

This template depends on the type of object in the DataFactory.

I.e: If you define the resource as a pipeline, the template must contain the resource definition. If you define the resource as a trigger, the template must contain the propeties of the trigger.

Examples

load("@rules_microsoft_azure//az:defs.bzl", "az_config", "az_datafactory")

genrule(
    name = "template",
    outs = ["template.json"],
    cmd = """
echo -e '{"properties": {"activities": [], "variables": {},"annotations": []}}' > \"$@\"
"""
)

az_config(
    name = "config",
    debug = True,
    subscription = "dev",
    verbose = True,
)

az_datafactory(
    name = "foo",
    config = ":config",
    factory_name = "foo-factory",
    resource = "pipeline",
    resource_group = "foo-factory-rg",
    resource_name = "foo",
    template = ":template",
)

Usage

The az_datafactory rules expose a collection of actions. We will follow the :foo target from the example above.

Build

Build creates all the constituent elements and makes the model available like {name}.substituted.json.

bazel build :dev

NOTE: If the resource attribute is defined as a pipeline, the folder property will contain the destination bazel directory.

E.g:

{
  "properties": {
    "folder": {
      "name": "bazel/<workspace_name>/path/to/target"
    }
  }
}

Resolve

You can "resolve" your resource template by running:

bazel run :foo

The resolved template will be printed to STDOUT.

Create or Update

Users can create or update objects by running:

bazel run :foo.create

This deploys the resolved template.

Delete

Users can delete objects by running:

bazel run :foo.create

Show

Users can get objects by running:

bazel run :foo.show

Start

NOTE: Only available for the trigger resource.

Users can start a trigger by running:

bazel run :foo.start

Stop

NOTE: Only available for the trigger resource.

Users can stop a trigger by running:

bazel run :foo.stop