0
{
  "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "storageAccountType": {
      "type": "string",
      "defaultValue": "eNtsaBuilding M103",
      "metadata": {
        "description": "Storage Account type"
      }
    }
  },
  "variables": {
    "MandelaUniversity2019": "[concat(uniquestring(resourceGroup().id), 'standardsa')]"
  },
  "resources": [
    {
      "type": "Microsoft.Storage/eNtsaResourcesIOT",
      "name": "[variables('MandelaUniversity2019')]",
      "apiVersion": "2018-01-06",
      "location": "[resourceGroup().location]",
      "sku": {
        "name": "[parameters('storageAccountType')]"
      },
      "kind": "Storage",
      "properties": {

      }
    }
  ],
  "outputs": {
    "MandelaUniversity2019": {
      "type": "string",
      "value": "[variables('MandelaUniversity2019')]"
    }
  }
}
14:16:57 - 2:16:56 PM - Resource Microsoft.Storage/eNtsaResourcesIOT 'fi7so6zmvqa2istandardsa' failed with message '{
14:16:57 -   "error": {
14:16:57 -     "code": "InvalidResourceType",
14:16:57 -     "message": "The resource type could not be found in the namespace 'Microsoft.Storage' for api version '2018-01-06'."
14:16:57 -   }
14:16:57 - }'

How do i solve this problem, i am trying to create a template using VS 2019 and my deploymentJSON script indicate that error. Please assist as i dont know Yes invalidResourceType but i do have that Resource type on my portal. Is there anything should add or modify on this JSON script? Please guide me to resolve this issue, thanks.

Gcobza
  • 432
  • 1
  • 5
  • 12
  • Hi team i managed to get this working, although it gave me default storage-account type; 15:27:42 - =============== ========================= ========== 15:27:42 - storageAccountName String ix7md2utybyjwstandardsa 15:27:42 - 15:27:42 - 15:27:43 - 15:27:43 - 15:27:43 - Successfully deployed template 'azuredeploy.json' to resource group 'AzureARManager'. – Gcobza Sep 06 '19 at 13:31
  • only these adjustment were made "resources": [ { "type": "Microsoft.Storage/storageAccounts", "name": "[variables('storageAccountName')]", "apiVersion": "2018-07-01", "location": "eastus", "sku": { "name": "Standard_LRS", "tier": "Standard" }, "kind": "Storage", "properties": { } } ], – Gcobza Sep 06 '19 at 13:32
  • either delete the question or post an answer – 4c74356b41 Sep 06 '19 at 14:59

1 Answers1

0

As mentioned in the comments, use this:

{
  "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "storageAccountType": {
      "type": "string",
      "defaultValue": "eNtsaBuilding M103",
      "metadata": {
        "description": "Storage Account type"
      }
    }
  },
  "variables": {
    "MandelaUniversity2019": "[concat(uniquestring(resourceGroup().id), 'standardsa')]"
  },
  "resources":[ 
     { 
        "type":"Microsoft.Storage/storageAccounts",
        "name":"[variables('storageAccountName')]",
        "apiVersion":"2018-07-01",
        "location":"eastus",
        "sku":{ 
           "name":"Standard_LRS",
           "tier":"Standard"
        },
        "kind":"Storage",
        "properties":{ 

        }
     }
  ],
  "outputs": {
    "MandelaUniversity2019": {
      "type": "string",
      "value": "[variables('MandelaUniversity2019')]"
    }
  }
}
AmanGarg-MSFT
  • 1,123
  • 6
  • 10