I am new to ARM. I have created an ARM Template for deploying storage accounts and a data factory in a resource group.
If I want to use the same ARM Template to add another resource into the same resource group, can I not simply add that resource in the ARM Template below the storage accounts and data factory deployment code and run the ARM template?
Because currently, when I run the same template it is giving me an error saying:
storage accounts already exists.
Seems like it is trying to redeploy the storage accounts, which I don't want. How can I use the same ARM Template every time I have to deploy some new resource, by avoiding redeployment of already deployed resources?
Is there anything I can add in the ARM Template ?
Note: I don't wish to use PowerShell or Azure CLI here. I am deploying the resources using a pipeline where I have created YAML tasks.
PFB my sample template :
{
"$schema": "http://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {
"type": "string",
"defaultValue": "West Europe"
},
"storageAccountName": {
"type": "string",
"defaultValue": "storageabc"
}
"accountType": {
"type": "string"
},
"kind": {
"type": "string"
}
...
},
"resources": [
{
"name": "[parameters('storageAccountName')]",
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2019-06-01",
"location": "[parameters('location')]",
"properties": {},
"dependsOn": [],
"sku": {
"name": "[parameters('accountType')]"
},
"kind": "[parameters('kind')]"
},
{
"type": "Microsoft.DataFactory/factories,
"apiVersion": "2018-06-01"
-
-
-
..
}
],
"outputs": {}
}