test-resources.bicep•2.47 kB
targetScope = 'resourceGroup'
@minLength(3)
@maxLength(24)
@description('The base resource name.')
param baseName string = resourceGroup().name
@description('The location of the resource. By default, this is the same as the resource group.')
param location string = resourceGroup().location
@description('Virtual network address prefix')
param vnetAddressPrefix string = '10.20.0.0/16'
@description('Subnet prefix for AMLFS (must be at least /24 per RP requirement)')
param amlfsSubnetPrefix string = '10.20.1.0/24'
@description('The client OID to grant access to test resources.')
param testApplicationOid string = deployer().objectId
@description('AMLFS SKU name')
@allowed([
'AMLFS-Durable-Premium-40'
'AMLFS-Durable-Premium-125'
'AMLFS-Durable-Premium-250'
'AMLFS-Durable-Premium-500'
])
param amlfsSku string = 'AMLFS-Durable-Premium-500'
@description('AMLFS capacity in TiB')
@minValue(4)
param amlfsCapacityTiB int = 4
resource vnet 'Microsoft.Network/virtualNetworks@2023-05-01' = {
name: '${baseName}-vnet'
location: location
properties: {
addressSpace: {
addressPrefixes: [vnetAddressPrefix]
}
subnets: [
{
name: 'amlfs'
properties: {
addressPrefix: amlfsSubnetPrefix
natGateway: {
id: natGateway.id
}
privateEndpointNetworkPolicies: 'Disabled'
privateLinkServiceNetworkPolicies: 'Disabled'
}
}
]
}
}
resource natGateway 'Microsoft.Network/natGateways@2024-07-01' = {
name: '${baseName}-nat'
location: location
sku: {
name: 'Standard'
}
properties: {
idleTimeoutInMinutes: 10
publicIpAddresses: [
{
id: natPublicIp.id
}
]
}
}
resource natPublicIp 'Microsoft.Network/publicIPAddresses@2024-07-01' = {
name: '${baseName}-nat-pip'
location: location
sku: {
name: 'Standard'
}
properties: {
publicIPAllocationMethod: 'Static'
}
}
var filesystemSubnetId = resourceId('Microsoft.Network/virtualNetworks/subnets', vnet.name, 'amlfs')
resource amlfs 'Microsoft.StorageCache/amlFilesystems@2024-07-01' = {
name: baseName
location: location
sku: {
name: amlfsSku
}
properties: {
storageCapacityTiB: amlfsCapacityTiB
filesystemSubnet: filesystemSubnetId
maintenanceWindow: {
dayOfWeek: 'Sunday'
timeOfDayUTC: '02:00'
}
}
}
output amlfsId string = amlfs.id
output amlfsSubnetId string = filesystemSubnetId