Skip to content

Commit 1755b0b

Browse files
committed
Incremental checkin
1 parent 2407ca1 commit 1755b0b

File tree

1 file changed

+53
-11
lines changed

1 file changed

+53
-11
lines changed

articles/storage-actions/storage-tasks/storage-task-operations.md

Lines changed: 53 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ titleSuffix: Azure Storage Actions Preview
44
description: Learn about the elements of a storage task operation.
55
services: storage
66
author: normesta
7-
87
ms.service: azure-storage-actions
98
ms.topic: conceptual
109
ms.date: 10/07/2024
@@ -14,35 +13,78 @@ ms.author: normesta
1413

1514
# Storage task operations
1615

17-
This article describes the operations that you can use in a storage task. To learn how to define conditions and operations, see [Define storage task conditions and operations](storage-task-conditions-operations-edit.md).
16+
An operation is an action that a storage task performs on each object that meets the defined set of conditions. This article describes the format of a storage task operation and the list of operations, operation parameters, and allowable values. To learn more about conditions, see [Storage task conditions](storage-task-conditions.md).
1817

1918
> [!IMPORTANT]
2019
> Azure Storage Actions is currently in PREVIEW and is available these [regions](../overview.md#supported-regions).
2120
> See the [Supplemental Terms of Use for Microsoft Azure Previews](https://azure.microsoft.com/support/legal/preview-supplemental-terms/) for legal terms that apply to Azure features that are in beta, preview, or otherwise not yet released into general availability.
2221
2322
## Operation format
2423

25-
An operation is a blah in a JSON document. The following sample JSON shows a complete operation.
24+
A storage task contains a set of conditions and operations in a JSON document. The following snippet shows how conditions and operations appear in that document.
25+
26+
```json
27+
"action": {
28+
"if": {
29+
"condition": "<clause>",
30+
"operations": [
31+
{
32+
"name": "<operation name>",
33+
"parameters": {....},
34+
"onSuccess": "continue",
35+
"onFailure": "break"
36+
}
37+
]
38+
}
39+
}
40+
```
41+
42+
Each clause contains a _property_, a _value_, and an _operator_. When the storage task runs, it uses the operator to compare a property with a value to determine whether a clause is met by the target object. In a clause, the **operator** always appears first followed by the **property**, and then the **value**. The following image shows how each element is positioned in the expression.
43+
44+
> [!div class="mx-imgBorder"]
45+
> ![Format of a simple condition with an operator, property, and value.](../media/storage-tasks/storage-task-conditions/storage-task-conditions-condition-format-basic.png)
46+
47+
The following clause allows operations only on Microsoft Word documents. This clause targets all documents that end with the file extension `.docx`. Therefore, the operator is `endsWith`, the property is `Name`, the value is `.docx`.
2648

2749
```json
2850
{
29-
Put Json here
51+
"condition": "[[[endsWith(Name, '.docx')]]"
3052
}
3153
```
54+
If you define conditions by using the Azure portal, you can see this JSON structure by opening the **Code** tab of the visual designer.
3255

33-
An operation is a blah, as described in the following table:
56+
> [!div class="mx-imgBorder"]
57+
> ![Screenshot of the condition JSON as it appears in the Code tab of the visual designer.](../media/storage-tasks/storage-task-conditions/storage-task-conditions-code-tab.png)
3458
35-
| Parameter name | Parameter type | Notes |
36-
|----------------|----------------|-------|
37-
| `field name here` | Type description | Explanation here.|
59+
### Multiple clauses in a condition
3860

39-
## Operation example
61+
A condition can contain multiple clauses separated by a comma along with either the string `and` or `or`. The string `and` targets objects that meet the criteria in all clauses in the condition while `or` targets objects that meet the criterion in any of the clauses in the condition. The following image shows the position of the `and` and `or` string along with two clauses.
4062

41-
Here is an example.
63+
> [!div class="mx-imgBorder"]
64+
> ![Format of a condition that contains two clauses.](../media/storage-tasks/storage-task-conditions/storage-task-conditions-condition-format-multiple.png)
65+
66+
The following JSON shows a condition that contains two clauses. Because the `and` string is used in this expression, both clauses must evaluate to `true` before an operation is performed on the object.
4267

4368
```json
4469
{
45-
Put Json here
70+
"condition": "[[and(endsWith(Name, '.docx'), equals(Tags.Value[readyForLegalHold], 'Yes'))]]"
71+
}
72+
```
73+
74+
### Groups of conditions
75+
76+
Grouped clauses operate as a single unit separate from the rest of the clauses. Grouping clauses is similar to putting parentheses around a mathematical equation or logic expression. The `and` or `or` string for the first clause in the group applies to the whole group.
77+
78+
The following image shows two clauses grouped together.
79+
80+
> [!div class="mx-imgBorder"]
81+
> ![Format of a condition that contains two clauses grouped together.](../media/storage-tasks/storage-task-conditions/storage-task-conditions-condition-format-groups.png)
82+
83+
The following condition allows operations only on Microsoft Word documents where the `readyForLegalHold` tag of the document is set to a value of `Yes`. Operations are also performed on objects that are greater than 100 bytes even if the other two conditions are not true.
84+
85+
```json
86+
{
87+
"condition": "[[[or(and(endsWith(Name, '.docx'), equals(Tags.Value[readyForLegalHold], 'Yes')), greater(Content-Length, '100'))]]"
4688
}
4789
```
4890

0 commit comments

Comments
 (0)