Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion docs/CustomizingAzdParameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,16 @@ By default this template will use the environment name as the prefix to prevent
| `AZURE_OPENAI_IMAGE_MODEL` | string | `gpt-image-1-mini` | Image model to deploy (allowed: `gpt-image-1-mini`, `gpt-image-1.5`, `none`). |
| `IMAGE_MODEL_CAPACITY` | integer | `1` | Sets the image model deployment capacity in RPM (minimum: `1`). |
| `AZURE_OPENAI_API_VERSION` | string | `2025-01-01-preview` | Specifies the API version for Azure OpenAI service. |
| `AZURE_ENV_OPENAI_LOCATION` | string | `<User selects during deployment>` | Sets the Azure region for OpenAI resource deployment. |
| `AZURE_ENV_OPENAI_LOCATION` | string | `<User selects during deployment>` | Sets the Azure region for OpenAI resource deployment. Allowed: `australiaeast`, `canadaeast`, `eastus2`, `japaneast`, `koreacentral`, `polandcentral`, `swedencentral`, `switzerlandnorth`, `uaenorth`, `uksouth`, `westus3`. |
| `AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID` | string | `""` | Reuses an existing Log Analytics Workspace instead of creating a new one. |
| `AZURE_EXISTING_AI_PROJECT_RESOURCE_ID`| string | `""` | Reuses an existing AI Foundry Project instead of creating a new one. |
| `enableMonitoring` | boolean | `false` | Enable Log Analytics and Application Insights (WAF-aligned). |
| `enableScalability` | boolean | `false` | Enable auto-scaling and higher SKUs (WAF-aligned). |
| `enableRedundancy` | boolean | `false` | Enable zone redundancy and geo-replication (WAF-aligned). |
| `enablePrivateNetworking` | boolean | `false` | Enable VNet integration and private endpoints (WAF-aligned). |
| `AZURE_ENV_VM_SIZE` | string | `""` | Overrides the jumpbox VM size (private networking only). Must support accelerated networking and Premium SSD. |
| `AZURE_ENV_VM_ADMIN_USERNAME` | string | `""` | Sets the jumpbox VM admin username (private networking only). |
| `AZURE_ENV_VM_ADMIN_PASSWORD` | string | `""` | Sets the jumpbox VM admin password (private networking only). |
| `ACR_NAME` | string | `contentgencontainerreg` | Sets the existing Azure Container Registry name (without `.azurecr.io`). |
| `IMAGE_TAG` | string | `latest` | Sets the container image tag (e.g., `latest`, `dev`, `hotfix`). |

Expand Down
98 changes: 91 additions & 7 deletions infra/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,15 @@ param existingLogAnalyticsWorkspaceId string = ''
@description('Optional. Resource ID of an existing Foundry project.')
param azureExistingAIProjectResourceId string = ''

@description('Optional. Deploy Azure Bastion and Jumpbox VM for private network administration.')
param deployBastionAndJumpbox bool = false
@description('Optional. Jumpbox VM size. Must support accelerated networking and Premium SSD.')
param vmSize string = ''

@description('Optional. Jumpbox VM admin username.')
param vmAdminUsername string = ''

@description('Optional. Jumpbox VM admin password.')
@secure()
param vmAdminPassword string = ''

@description('Optional. The tags to apply to all deployed Azure resources.')
param tags object = {}
Expand Down Expand Up @@ -371,14 +378,91 @@ module userAssignedIdentity 'br/public:avm/res/managed-identity/user-assigned-id
module virtualNetwork 'modules/virtualNetwork.bicep' = if (enablePrivateNetworking) {
name: take('module.virtualNetwork.${solutionSuffix}', 64)
params: {
vnetName: 'vnet-${solutionSuffix}'
vnetLocation: solutionLocation
vnetAddressPrefixes: ['10.0.0.0/20']
name: 'vnet-${solutionSuffix}'
addressPrefixes: ['10.0.0.0/20'] // 4096 addresses (enough for 8 /23 subnets or 16 /24)
location: location
tags: tags
logAnalyticsWorkspaceId: logAnalyticsWorkspaceResourceId
enableTelemetry: enableTelemetry
resourceSuffix: solutionSuffix
deployBastionAndJumpbox: deployBastionAndJumpbox
enableTelemetry: enableTelemetry
}
}

// Azure Bastion Host
var bastionHostName = 'bas-${solutionSuffix}'
module bastionHost 'br/public:avm/res/network/bastion-host:0.8.2' = if (enablePrivateNetworking) {
name: take('avm.res.network.bastion-host.${bastionHostName}', 64)
params: {
name: bastionHostName
skuName: 'Standard'
location: location
virtualNetworkResourceId: virtualNetwork!.outputs.resourceId
diagnosticSettings: [
{
name: 'bastionDiagnostics'
workspaceResourceId: logAnalyticsWorkspaceResourceId
logCategoriesAndGroups: [
{
categoryGroup: 'allLogs'
enabled: true
}
]
}
]
tags: tags
enableTelemetry: enableTelemetry
publicIPAddressObject: {
name: 'pip-${bastionHostName}'
}
}
}

// Jumpbox Virtual Machine
var jumpboxVmName = take('vm-jumpbox-${solutionSuffix}', 15)
module jumpboxVM 'br/public:avm/res/compute/virtual-machine:0.21.0' = if (enablePrivateNetworking) {
name: take('avm.res.compute.virtual-machine.${jumpboxVmName}', 64)
params: {
name: take(jumpboxVmName, 15)
enableTelemetry: enableTelemetry
computerName: take(jumpboxVmName, 15)
osType: 'Windows'
vmSize: empty(vmSize) ? 'Standard_D2s_v5' : vmSize
adminUsername: empty(vmAdminUsername) ? 'JumpboxAdminUser' : vmAdminUsername
adminPassword: empty(vmAdminPassword) ? 'JumpboxAdminP@ssw0rd1234!' : vmAdminPassword
managedIdentities: {
userAssignedResourceIds: [
userAssignedIdentity.outputs.resourceId
]
}
availabilityZone: 1
imageReference: {
publisher: 'microsoft-dsvm'
offer: 'dsvm-win-2022'
sku: 'winserver-2022'
version: 'latest'
}
nicConfigurations: [
{
name: 'nic-${jumpboxVmName}'
enableAcceleratedNetworking: true
ipConfigurations: [
{
name: 'ipconfig01'
subnetResourceId: virtualNetwork!.outputs.jumpboxSubnetResourceId
}
]
}
]
osDisk: {
caching: 'ReadWrite'
diskSizeGB: 128
managedDisk: {
storageAccountType: 'Premium_LRS'
}
}
encryptionAtHost: false // Some Azure subscriptions do not support encryption at host
location: solutionLocation
tags: tags
}
dependsOn: (enableMonitoring && !useExistingLogAnalytics) ? [logAnalyticsWorkspace] : []
}
Expand Down
Loading
Loading