Storage Tasks - Create
Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already created and a subsequent create request is issued with different properties, the storage task properties will be updated. If a storage task is already created and a subsequent create or update request is issued with the exact same set of properties, the request will succeed.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageActions/storageTasks/{storageTaskName}?api-version=2023-01-01
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
resource
|
path | True |
string minLength: 1maxLength: 90 |
The name of the resource group. The name is case insensitive. |
|
storage
|
path | True |
string minLength: 3maxLength: 18 pattern: ^[a-z0-9]{3,18}$ |
The name of the storage task within the specified resource group. Storage task names must be between 3 and 18 characters in length and use numbers and lower-case letters only. |
|
subscription
|
path | True |
string (uuid) |
The ID of the target subscription. The value must be an UUID. |
|
api-version
|
query | True |
string minLength: 1 |
The API version to use for this operation. |
Request Body
| Name | Required | Type | Description |
|---|---|---|---|
| identity | True |
The managed service identity of the resource. |
|
| location | True |
string |
The geo-location where the resource lives |
| properties.action | True |
The storage task action that is executed |
|
| properties.description | True |
string |
Text that describes the purpose of the storage task |
| properties.enabled | True |
boolean |
Storage Task is enabled when set to true and disabled when set to false |
| tags |
object |
Resource tags. |
Responses
| Name | Type | Description |
|---|---|---|
| 200 OK |
Resource 'StorageTask' update operation succeeded |
|
| 201 Created |
Resource 'StorageTask' create operation succeeded Headers
|
|
| 202 Accepted |
Resource operation accepted. Headers
|
|
| Other Status Codes |
An unexpected error response. |
Security
azure_auth
Azure Active Directory OAuth2 Flow.
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
| Name | Description |
|---|---|
| user_impersonation | impersonate your user account |
Examples
PutStorageTask
Sample request
PUT https://management.azure.com/subscriptions/1f31ba14-ce16-4281-b9b4-3e78da6e1616/resourceGroups/res4228/providers/Microsoft.StorageActions/storageTasks/mytask1?api-version=2023-01-01
{
"identity": {
"type": "SystemAssigned"
},
"location": "westus",
"properties": {
"description": "My Storage task",
"action": {
"else": {
"operations": [
{
"name": "DeleteBlob",
"onFailure": "break",
"onSuccess": "continue"
}
]
},
"if": {
"condition": "[[equals(AccessTier, 'Cool')]]",
"operations": [
{
"name": "SetBlobTier",
"onFailure": "break",
"onSuccess": "continue",
"parameters": {
"tier": "Hot"
}
}
]
}
},
"enabled": true
}
}
Sample response
location: https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.StorageActions/locations/eastus/operationResults/00000000-0000-0000-0000-000000000000?api-version=2023-01-01
{
"name": "mytask1",
"type": "Microsoft.StorageActions/storageTasks",
"id": "/subscriptions/c86a9c18-8373-41fa-92d4-1d7bdc16977b/resourceGroups/res4228/providers/Microsoft.StorageActions/storageTasks/mytask1",
"identity": {
"type": "SystemAssigned",
"principalId": "2fd475e8-8923-4597-842f-7ce1adfc6c4a",
"tenantId": "b4a2005c-32c1-434c-bbf0-ff486912fc75"
},
"location": "westus",
"properties": {
"description": "Storage task",
"action": {
"else": {
"operations": [
{
"name": "DeleteBlob",
"onFailure": "break",
"onSuccess": "continue"
}
]
},
"if": {
"condition": "[[equals(AccessTier, 'Cool')]]",
"operations": [
{
"name": "SetBlobTier",
"onFailure": "break",
"onSuccess": "continue",
"parameters": {
"tier": "Hot"
}
}
]
}
},
"creationTimeInUtc": "2023-07-06T00:24:59.1441663Z",
"enabled": true,
"provisioningState": "Succeeded",
"taskVersion": 1
}
}
location: https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.StorageActions/locations/eastus/operationResults/00000000-0000-0000-0000-000000000000?api-version=2023-01-01
{
"name": "mytask1",
"type": "Microsoft.StorageActions/storageTasks",
"id": "/subscriptions/c86a9c18-8373-41fa-92d4-1d7bdc16977b/resourceGroups/res4228/providers/Microsoft.StorageActions/storageTasks/mytask1",
"identity": {
"type": "SystemAssigned",
"principalId": "2fd475e8-8923-4597-842f-7ce1adfc6c4a",
"tenantId": "b4a2005c-32c1-434c-bbf0-ff486912fc75"
},
"location": "westus",
"properties": {
"description": "Storage task",
"action": {
"else": {
"operations": [
{
"name": "DeleteBlob",
"onFailure": "break",
"onSuccess": "continue"
}
]
},
"if": {
"condition": "[[equals(AccessTier, 'Cool')]]",
"operations": [
{
"name": "SetBlobTier",
"onFailure": "break",
"onSuccess": "continue",
"parameters": {
"tier": "Hot"
}
}
]
}
},
"creationTimeInUtc": "2023-07-06T00:24:59.1441663Z",
"enabled": true,
"provisioningState": "Succeeded",
"taskVersion": 1
}
}
location: https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.StorageActions/locations/eastus/operationResults/00000000-0000-0000-0000-000000000000?api-version=2023-01-01
Definitions
| Name | Description |
|---|---|
|
created |
The type of identity that created the resource. |
|
Else |
The else block of storage task operation |
|
Error |
The resource management error additional info. |
|
Error |
The error detail. |
|
Error |
Error response |
|
If |
The if block of storage task operation |
|
Managed |
Managed service identity (system assigned and/or user assigned identities) |
|
Managed |
Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). |
|
On |
Action to be taken when the operation fails for a object. |
|
On |
Action to be taken when the operation is successful for a object. |
|
Provisioning |
Represents the provisioning state of the storage task. |
|
Storage |
Represents Storage Task. |
|
Storage |
The storage task action represents conditional statements and operations to be performed on target objects. |
|
Storage |
Represents an operation to be performed on the object |
|
Storage |
The operation to be performed on the object. |
|
system |
Metadata pertaining to creation and last modification of the resource. |
|
User |
User assigned identity properties |
createdByType
The type of identity that created the resource.
| Value | Description |
|---|---|
| User | |
| Application | |
| ManagedIdentity | |
| Key |
ElseCondition
The else block of storage task operation
| Name | Type | Description |
|---|---|---|
| operations |
List of operations to execute in the else block |
ErrorAdditionalInfo
The resource management error additional info.
| Name | Type | Description |
|---|---|---|
| info |
object |
The additional info. |
| type |
string |
The additional info type. |
ErrorDetail
The error detail.
| Name | Type | Description |
|---|---|---|
| additionalInfo |
The error additional info. |
|
| code |
string |
The error code. |
| details |
The error details. |
|
| message |
string |
The error message. |
| target |
string |
The error target. |
ErrorResponse
Error response
| Name | Type | Description |
|---|---|---|
| error |
The error object. |
IfCondition
The if block of storage task operation
| Name | Type | Description |
|---|---|---|
| condition |
string |
Condition predicate to evaluate each object. See https://aka.ms/storagetaskconditions for valid properties and operators. |
| operations |
List of operations to execute when the condition predicate satisfies. |
ManagedServiceIdentity
Managed service identity (system assigned and/or user assigned identities)
| Name | Type | Description |
|---|---|---|
| principalId |
string (uuid) |
The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. |
| tenantId |
string (uuid) |
The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. |
| type |
Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). |
|
| userAssignedIdentities |
<string,
User |
User-Assigned Identities |
ManagedServiceIdentityType
Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).
| Value | Description |
|---|---|
| None | |
| SystemAssigned | |
| UserAssigned | |
| SystemAssigned,UserAssigned |
OnFailure
Action to be taken when the operation fails for a object.
| Value | Description |
|---|---|
| break |
OnSuccess
Action to be taken when the operation is successful for a object.
| Value | Description |
|---|---|
| continue |
ProvisioningState
Represents the provisioning state of the storage task.
| Value | Description |
|---|---|
| ValidateSubscriptionQuotaBegin | |
| ValidateSubscriptionQuotaEnd | |
| Accepted | |
| Creating | |
| Succeeded | |
| Deleting | |
| Canceled | |
| Failed |
StorageTask
Represents Storage Task.
| Name | Type | Description |
|---|---|---|
| id |
string (arm-id) |
Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" |
| identity |
The managed service identity of the resource. |
|
| location |
string |
The geo-location where the resource lives |
| name |
string |
The name of the resource |
| properties.action |
The storage task action that is executed |
|
| properties.creationTimeInUtc |
string (date-time) |
The creation date and time of the storage task in UTC. |
| properties.description |
string |
Text that describes the purpose of the storage task |
| properties.enabled |
boolean |
Storage Task is enabled when set to true and disabled when set to false |
| properties.provisioningState |
Represents the provisioning state of the storage task. |
|
| properties.taskVersion |
integer (int64) minimum: 1maximum: 1 |
Storage task version. |
| systemData |
Azure Resource Manager metadata containing createdBy and modifiedBy information. |
|
| tags |
object |
Resource tags. |
| type |
string |
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" |
StorageTaskAction
The storage task action represents conditional statements and operations to be performed on target objects.
| Name | Type | Description |
|---|---|---|
| else |
The else block of storage task operation |
|
| if |
The if block of storage task operation |
StorageTaskOperation
Represents an operation to be performed on the object
| Name | Type | Description |
|---|---|---|
| name |
The operation to be performed on the object. |
|
| onFailure |
Action to be taken when the operation fails for a object. |
|
| onSuccess |
Action to be taken when the operation is successful for a object. |
|
| parameters |
object |
Key-value parameters for the operation. |
StorageTaskOperationName
The operation to be performed on the object.
| Value | Description |
|---|---|
| SetBlobTier | |
| SetBlobTags | |
| SetBlobImmutabilityPolicy | |
| SetBlobLegalHold | |
| SetBlobExpiry | |
| DeleteBlob | |
| UndeleteBlob |
systemData
Metadata pertaining to creation and last modification of the resource.
| Name | Type | Description |
|---|---|---|
| createdAt |
string (date-time) |
The timestamp of resource creation (UTC). |
| createdBy |
string |
The identity that created the resource. |
| createdByType |
The type of identity that created the resource. |
|
| lastModifiedAt |
string (date-time) |
The timestamp of resource last modification (UTC) |
| lastModifiedBy |
string |
The identity that last modified the resource. |
| lastModifiedByType |
The type of identity that last modified the resource. |
UserAssignedIdentity
User assigned identity properties
| Name | Type | Description |
|---|---|---|
| clientId |
string (uuid) |
The client ID of the assigned identity. |
| principalId |
string (uuid) |
The principal ID of the assigned identity. |