az_datafactory.md
September 4, 2020 · View on GitHub
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 |
Unique name for this rule. |
config |
Label of |
factory_name |
The factory name. This field supports stamp variables. |
resource |
The type of the object in the DataFactory. Supported values are:
|
resource_group |
Name of resource group. This field supports stamp variables. |
resource_name |
The resource name (pipeline or trigger). |
template |
This template depends on the type of object in the DataFactory.
I.e: If you define the |
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