Update-AzStorageActionTask
Asynchronously update a new storage task resource with the specified parameters.
If a storage task is already created and a subsequent update request is issued with different properties, the storage task properties will be updated.
If a storage task is already created and a subsequent update request is issued with the exact same set of properties, the request will succeed.
Syntax
UpdateExpanded (Default)
Update-AzStorageActionTask
-Name <String>
-ResourceGroupName <String>
[-SubscriptionId <String>]
[-Description <String>]
[-ElseOperation <IStorageTaskOperation[]>]
[-EnableSystemAssignedIdentity <Boolean>]
[-Enabled]
[-IfCondition <String>]
[-IfOperation <IStorageTaskOperation[]>]
[-Tag <Hashtable>]
[-UserAssignedIdentity <String[]>]
[-DefaultProfile <PSObject>]
[-AsJob]
[-NoWait]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
UpdateViaIdentityExpanded
Update-AzStorageActionTask
-InputObject <IStorageActionIdentity>
[-Description <String>]
[-ElseOperation <IStorageTaskOperation[]>]
[-EnableSystemAssignedIdentity <Boolean>]
[-Enabled]
[-IfCondition <String>]
[-IfOperation <IStorageTaskOperation[]>]
[-Tag <Hashtable>]
[-UserAssignedIdentity <String[]>]
[-DefaultProfile <PSObject>]
[-AsJob]
[-NoWait]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Asynchronously update a new storage task resource with the specified parameters.
If a storage task is already created and a subsequent update request is issued with different properties, the storage task properties will be updated.
If a storage task is already created and a subsequent update request is issued with the exact same set of properties, the request will succeed.
Examples
Example 1: Update storage action task with conditions
$elseoperation = New-AzStorageActionTaskOperationObject -Name DeleteBlob -OnFailure break -OnSuccess continue
Update-AzStorageActionTask -Name mytask1 -ResourceGroupName group001 -ElseOperation $elseoperation
CreationTimeInUtc : 1/23/2024 6:47:43 AM
Description : my storage task
ElseOperation : {{
"name": "DeleteBlob",
"onSuccess": "continue",
"onFailure": "break"
}}
Enabled : False
Id : /subscriptions/11111111-2222-3333-4444-123456789101/resourceGroups/group001/providers/Microsoft.StorageActions/storageTasks/mytask1
IdentityPrincipalId :
IdentityTenantId :
IdentityType : None
IdentityUserAssignedIdentity : {
}
IfCondition : [[equals(AccessTier, 'Cool')]]
IfOperation : {{
"name": "SetBlobTier",
"parameters": {
"tier": "Hot"
},
"onSuccess": "continue",
"onFailure": "break"
}}
Location : eastus2euap
Name : mytask1
ProvisioningState : Succeeded
ResourceGroupName : group001
SystemDataCreatedAt :
SystemDataCreatedBy :
SystemDataCreatedByType :
SystemDataLastModifiedAt :
SystemDataLastModifiedBy :
SystemDataLastModifiedByType :
Tag : {
}
TaskVersion : 1
Type : Microsoft.StorageActions/storageTasks
This command updates storage action task.
Example 2: Update storage action task with conditions
$ifOperation = New-AzStorageActionTaskOperationObject -Name SetBlobTier -Parameter @{"tier"= "Hot"} -OnFailure break -OnSuccess continue
Update-AzStorageActionTask -Name mytask3 -ResourceGroupName group001 -IfCondition "[[equals(AccessTier, 'Hot')]]" -IfOperation $ifoperation
CreationTimeInUtc : 4/12/2024 9:56:05 AM
Description : my storage task 3
ElseOperation : {{
"name": "DeleteBlob",
"onSuccess": "continue",
"onFailure": "break"
}}
Enabled : True
Id : /subscriptions/11111111-2222-3333-4444-123456789101/resourceGroups/group001/providers/Microsoft.StorageActions/storageTasks/mytask3
IdentityPrincipalId : 00001111-aaaa-2222-bbbb-3333cccc4444
IdentityTenantId : 11111111-2222-3333-4444-987654321012
IdentityType : SystemAssigned
IdentityUserAssignedIdentity : {
}
IfCondition : [[equals(AccessTier, 'Hot')]]
IfOperation : {{
"name": "SetBlobTier",
"parameters": {
"tier": "Hot"
},
"onSuccess": "continue",
"onFailure": "break"
}}
Location : eastus2euap
Name : mytask3
ProvisioningState : Succeeded
ResourceGroupName : group001
SystemDataCreatedAt :
SystemDataCreatedBy :
SystemDataCreatedByType :
SystemDataLastModifiedAt :
SystemDataLastModifiedBy :
SystemDataLastModifiedByType :
Tag : {
}
TaskVersion : 1
Type : Microsoft.StorageActions/storageTasks
This command updates storage action task.
Example 3: Update storage action task with system assigned
Update-AzStorageActionTask -Name mytask1 -ResourceGroupName group001 -EnableSystemAssignedIdentity 1
CreationTimeInUtc : 2/27/2024 6:48:18 AM
Description : my storage task
ElseOperation :
Enabled : True
Id : /subscriptions/11111111-2222-3333-4444-123456789101/resourceGroups/group001/providers/Microsoft.StorageActions/storageTasks/myta
sk1
IdentityPrincipalId : 66aefa04-060e-4eeb-9342-7228e31d1596
IdentityTenantId : 72f988bf-86f1-41af-91ab-2d7cd011db47
IdentityType : SystemAssigned
IdentityUserAssignedIdentity : {
}
IfCondition : [[equals(AccessTier, 'Cool')]]
IfOperation : {{
"name": "SetBlobTier",
"parameters": {
"tier": "Hot"
},
"onSuccess": "continue",
"onFailure": "break"
}}
Location : eastus2euap
Name : mytask1
ProvisioningState : Succeeded
ResourceGroupName : group001
SystemDataCreatedAt :
SystemDataCreatedBy :
SystemDataCreatedByType :
SystemDataLastModifiedAt :
SystemDataLastModifiedBy :
SystemDataLastModifiedByType :
Tag : {
}
TaskVersion : 1
Type : Microsoft.StorageActions/storageTasks
This command updates storage action task.
Parameters
-AsJob
Run the command as a job
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Aliases: cf
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-DefaultProfile
The DefaultProfile parameter is not functional.
Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
Parameter properties
Type: PSObject
Default value: None
Supports wildcards: False
DontShow: False
Aliases: AzureRMContext, AzureCredential
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Description
Text that describes the purpose of the storage task
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ElseOperation
List of operations to execute in the else block
Parameter properties
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Enabled
Storage Task is enabled when set to true and disabled when set to false
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-EnableSystemAssignedIdentity
Determines whether to enable a system-assigned identity for the resource.
Parameter properties
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-IfCondition
Condition predicate to evaluate each object.
See https://aka.ms/storagetaskconditions for valid properties and operators.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-IfOperation
List of operations to execute when the condition predicate satisfies.
Parameter properties
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
Identity Parameter
UpdateViaIdentityExpanded
Position: Named
Mandatory: True
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-Name
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.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Aliases: StorageTaskName
Parameter sets
UpdateExpanded
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-NoWait
Run the command asynchronously
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ResourceGroupName
The name of the resource group.
The name is case insensitive.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
UpdateExpanded
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-SubscriptionId
The ID of the target subscription.
The value must be an UUID.
Parameter properties
Type: String
Default value: (Get-AzContext).Subscription.Id
Supports wildcards: False
DontShow: False
Parameter sets
UpdateExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Tag
Resource tags.
Parameter properties
Type: Hashtable
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-UserAssignedIdentity
The array of user assigned identities associated with the resource.
The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.'
Parameter properties
Type: String [ ]
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Aliases: wi
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters .
Outputs