Hi Nathon,
To upload a snapshot JSON into a blob storage account using an ARM template with Ev2, you can use deployment scripts within your ARM template. Here’s a general approach to achieve this:
- Create a Storage Account: Define the storage account in your ARM template.
- Use Deployment Scripts: Utilize the deployment Scripts resource to execute a script that uploads your JSON file to the storage account.
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"type": "Microsoft.Resources/deploymentScripts",
"apiVersion": "2020-10-01",
"location": "[resourceGroup().location]",
"properties": {
"azPowerShellVersion": "3.0",
"scriptContent": "az storage blob upload --account-name <storageAccountName> --container-name <containerName> --name <blobName> --file <filePath>",
"supportingScriptUris": [],
"timeout": "PT30M",
"cleanupPreference": "OnSuccess",
"retentionInterval": "P1D",
"forceUpdateTag": "1.0"
}
}
]
}
Replace <storageAccountName>, <containerName>, <blobName>, and <filePath> with your actual values
For more detailed information and examples, you can refer to the Azure Resource Manager documentation on deployment scripts:
https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/deployment-script-template#sample-templates
To Follow:
- Define Parameters: Set parameters for the storage account name, location, and container name.
- Create Storage Account Resource: Define the storage account resource in the template.
- Add Deployment Script: Use the deployment Scripts resource to run an Azure CLI command that uploads the JSON file to the specified blob container.
This script to upload the snapshot.json file to the specified container in the storage account.
Please let us know if you have any further queries. I’m happy to assist you further.