// EasyLife 365 setup template. Use case: identity/safe-sharing-storage (the files of Safe sharing). Version: v1. // Source: https://docs.easylife365.cloud/downloads/identity/safe-sharing-storage/v1/template.bicep // template.json next to it is built from this file with `az bicep build`. // // Creates a storage account and a container in the resource group you deploy to. It gives no access: run grant.ps1 or // grant.sh afterwards, which assigns "Storage Blob Data Contributor" to the EasyLife 365 app on the container. // // Use it for a new storage account. Deploying it over an existing account sets that account's settings back to the ones // below; for an existing account, run the grant script only. metadata 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.' @description('The storage account: 3 to 24 lowercase letters and digits, unique in Azure.') @minLength(3) @maxLength(24) param accountName string @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.') @minLength(3) @maxLength(63) param containerName string @description('The Azure region of the storage account. Default: the region of the resource group.') param region string = resourceGroup().location // StorageV2, locally redundant, TLS 1.2, HTTPS only, Microsoft Entra ID sign-in only (no shared key), no anonymous blob // access, no replication to other tenants. resource account 'Microsoft.Storage/storageAccounts@2023-05-01' = { name: accountName location: region kind: 'StorageV2' sku: { name: 'Standard_LRS' } properties: { accessTier: 'Hot' minimumTlsVersion: 'TLS1_2' supportsHttpsTrafficOnly: true allowBlobPublicAccess: false allowSharedKeyAccess: false allowCrossTenantReplication: false } } // The blob service comes with the account; the template leaves its settings as they are. resource blobService 'Microsoft.Storage/storageAccounts/blobServices@2023-05-01' existing = { parent: account name: 'default' } resource container 'Microsoft.Storage/storageAccounts/blobServices/containers@2023-05-01' = { parent: blobService name: containerName properties: { publicAccess: 'None' } } output containerResourceId string = container.id