{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "metadata": {
    "_generator": {
      "name": "bicep",
      "version": "0.41.2.15936",
      "templateHash": "11752587302821709178"
    },
    "description": "EasyLife 365, identity/safe-sharing-storage v1: a storage account and a container for the files of Safe sharing. Give access with the grant script afterwards."
  },
  "parameters": {
    "accountName": {
      "type": "string",
      "minLength": 3,
      "maxLength": 24,
      "metadata": {
        "description": "The storage account: 3 to 24 lowercase letters and digits, unique in Azure."
      }
    },
    "containerName": {
      "type": "string",
      "minLength": 3,
      "maxLength": 63,
      "metadata": {
        "description": "The container: 3 to 63 lowercase letters, digits and hyphens, starting and ending with a letter or digit, with no two hyphens in a row."
      }
    },
    "region": {
      "type": "string",
      "defaultValue": "[resourceGroup().location]",
      "metadata": {
        "description": "The Azure region of the storage account. Default: the region of the resource group."
      }
    }
  },
  "resources": [
    {
      "type": "Microsoft.Storage/storageAccounts",
      "apiVersion": "2023-05-01",
      "name": "[parameters('accountName')]",
      "location": "[parameters('region')]",
      "kind": "StorageV2",
      "sku": {
        "name": "Standard_LRS"
      },
      "properties": {
        "accessTier": "Hot",
        "minimumTlsVersion": "TLS1_2",
        "supportsHttpsTrafficOnly": true,
        "allowBlobPublicAccess": false,
        "allowSharedKeyAccess": false,
        "allowCrossTenantReplication": false
      }
    },
    {
      "type": "Microsoft.Storage/storageAccounts/blobServices/containers",
      "apiVersion": "2023-05-01",
      "name": "[format('{0}/{1}/{2}', parameters('accountName'), 'default', parameters('containerName'))]",
      "properties": {
        "publicAccess": "None"
      },
      "dependsOn": [
        "[resourceId('Microsoft.Storage/storageAccounts', parameters('accountName'))]"
      ]
    }
  ],
  "outputs": {
    "containerResourceId": {
      "type": "string",
      "value": "[resourceId('Microsoft.Storage/storageAccounts/blobServices/containers', parameters('accountName'), 'default', parameters('containerName'))]"
    }
  }
}