Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This quickstart describes how to create a storage task by using an Azure Resource Manager template (ARM template).
An Azure Resource Manager template is a JavaScript Object Notation (JSON) file that defines the infrastructure and configuration for your project. The template uses declarative syntax. You describe your intended deployment without writing the sequence of programming commands to create the deployment.
If your environment meets the prerequisites and you're familiar with using ARM templates, select the Deploy to Azure button. The template will open in the Azure portal.
Prerequisites
If you don't have an Azure subscription, create a free account before you begin.
Review the template
The template used in this quickstart is from Azure Quickstart Templates.
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "11663963517791910133"
}
},
"parameters": {
"storageTaskName": {
"type": "string",
"minLength": 3,
"maxLength": 18,
"metadata": {
"description": "The name of storage task."
}
},
"description": {
"type": "string",
"metadata": {
"description": "A description of the storage task."
}
},
"___location": {
"type": "string",
"defaultValue": "[resourceGroup().___location]",
"metadata": {
"description": "The region in which to create the storage task."
}
},
"lockedUntilDate": {
"type": "string",
"defaultValue": "[dateTimeAdd(utcNow(), 'P1D')]",
"metadata": {
"description": "Locks the file for one day."
}
}
},
"resources": [
{
"type": "Microsoft.StorageActions/storageTasks",
"apiVersion": "2023-01-01",
"name": "[parameters('storageTaskName')]",
"___location": "[parameters('___location')]",
"identity": {
"type": "SystemAssigned"
},
"properties": {
"action": {
"if": {
"condition": "[[[endsWith(Name, '.docx')]]",
"operations": [
{
"name": "SetBlobImmutabilityPolicy",
"onSuccess": "continue",
"onFailure": "break",
"parameters": {
"untilDate": "[parameters('lockedUntilDate')]",
"mode": "locked"
}
},
{
"name": "SetBlobTags",
"onSuccess": "continue",
"onFailure": "break",
"parameters": {
"tagsetImmutabilityUpdatedBy": "StorageTaskQuickstart"
}
}
]
}
},
"description": "[parameters('description')]",
"enabled": true
}
}
]
}
Deploy the template
Select the following link to sign in to Azure and open a template. The template creates a key vault and a secret.
Specify the subscription, resource group, and the storage task name. Then, select Review + create to deploy the template.
You can also use the Azure PowerShell, Azure CLI, and REST API. To learn other deployment methods, see Deploy templates.
Review deployed resources
In the Azure portal, search for Storage Tasks. Then, under Services, select Storage tasks - Azure Storage Actions.
In the list of storage tasks, search for the name of the storage task that you deployed.
Clean up resources
When no longer needed, delete the resource group. The resource group and all the resources in the resource group are deleted. Use the following command to delete the resource group and all its contained resources.
az group delete --name <resource-group-name>
Replace <resource-group-name>
with the name of your resource group.
Next steps
Assign a storage task to a storage account.