az_storage(
name,
config,
account_name,
container_name,
srcs
)
A rule for setting basic properties for other rules.
Attributes | |
---|---|
name |
Unique name for this rule. |
config |
Label of |
account_name |
Storage account name. This field supports stamp variables. |
container_name |
Container name to copy or remove sources. This field supports stamp variables. |
srcs |
The list of targets that have a file to be copy or removed from a Container. The path to the file in the storage account will be the target value defined in the dictionary. |
load("@rules_microsoft_azure//az:defs.bzl", "az_config", "az_storage")
genrule(
name = "generate",
outs = [
"generated1.txt",
"generated2.txt",
],
cmd = """
echo -e 'This is a file generated by a genrule rule and will be copied to a blobstorage.' > $(location generated1.txt);
echo -e 'This is a file generated by a genrule rule and will be copied to a blobstorage.' > $(location generated2.txt);
""",
visibility = ["//visibility:public"],
)
az_config(
name = "config",
debug = True,
subscription = "dev",
verbose = True,
)
az_storage(
name = "foo",
srcs = {
":generate": "path/to/container/",
},
account_name = "bar",
config = ":config",
container_name = "baz",
)
The az_storage
rules expose a collection of actions. We will follow the :foo
target from the example above.
Users can obtain information about the artifacts by running:
bazel run :foo
The data will be printed on STDOUT
.
Users can copy objects to a container by running:
bazel run :foo.copy
Users can remove objects from a container by running:
bazel run :foo.remove