Skip to content
Merged
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
4 changes: 2 additions & 2 deletions azure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ hooks:
Write-Host "Web app URL: "
Write-Host "$env:WEB_APP_URL" -ForegroundColor Cyan
Write-Host "`nRun the following command in your Bash terminal. It will grant the necessary permissions between resources and your user account, and also process and load the sample data into the application."
Write-Host "bash ./infra/scripts/process_sample_data.sh" -ForegroundColor Cyan
Write-Host "bash ./infra/scripts/process_sample_data.sh $env:AZURE_RESOURCE_GROUP" -ForegroundColor Cyan
shell: pwsh
continueOnError: false
interactive: true
Expand All @@ -26,7 +26,7 @@ hooks:
echo $WEB_APP_URL
echo ""
echo "Run the following command in your Bash terminal. It will grant the necessary permissions between resources and your user account, and also process and load the sample data into the application."
echo "bash ./infra/scripts/process_sample_data.sh"
echo "bash ./infra/scripts/process_sample_data.sh $env:AZURE_RESOURCE_GROUP"
shell: sh
continueOnError: false
interactive: true
30 changes: 30 additions & 0 deletions docs/AVMPostDeploymentGuide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# AVM Post Deployment Guide
This document provides guidance on post-deployment steps after deploying the Build Your Own Copilot Accelerator from the [AVM (Azure Verified Modules) repository](https://github.com/Azure/bicep-registry-modules/tree/main/avm/ptn/sa/build-your-own-copilot).

## Post Deployment Steps
1. Clone the Repository
First, clone this repository to access the post-deployment scripts:
```bash
git clone https://github.com/microsoft/Build-your-own-copilot-Solution-Accelerator.git
```
```bash
cd Build-your-own-copilot-Solution-Accelerator
```

2. Import Sample Data -Run bash command printed in the terminal. The bash command will look like the following:

```bash
bash ./infra/scripts/process_sample_data.sh <resourceGroupName>
```
If the deployment does not exist or has been deleted – The script will prompt you to manually enter the required values

3. Add Authentication Provider

Follow steps in [App Authentication](https://github.com/microsoft/Build-your-own-copilot-Solution-Accelerator/blob/main/docs/AppAuthentication.md) to configure authentication in app service.
>Note that Authentication changes can take up to 10 minutes.

4. Deleting Resources After a Failed Deployment

Follow steps in [Delete Resource Group](https://github.com/microsoft/Build-your-own-copilot-Solution-Accelerator/blob/main/docs/DeleteResourceGroup.md) if your deployment fails and/or you need to clean up the resources.

By following these steps, you’ll ensure a smooth transition from deployment to hands-on usage.
130 changes: 109 additions & 21 deletions infra/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ resource resourceGroupTags 'Microsoft.Resources/tags@2021-04-01' = {
TemplateName: 'Client Advisor'
Type: enablePrivateNetworking ? 'WAF' : 'Non-WAF'
CreatedBy: createdBy
DeploymentName: deployment().name
}
}
}
Expand Down Expand Up @@ -386,22 +387,109 @@ module sqlUserAssignedIdentity 'br/public:avm/res/managed-identity/user-assigned
}
}

// ========== Network Module ========== //
module network 'modules/network.bicep' = if (enablePrivateNetworking) {
name: take('network-${solutionSuffix}-deployment', 64)
// ========== Virtual Network and Networking Components ========== //

// Virtual Network with NSGs and Subnets
module virtualNetwork 'modules/virtualNetwork.bicep' = if (enablePrivateNetworking) {
name: take('module.virtualNetwork.${solutionSuffix}', 64)
params: {
resourcesName: solutionSuffix
// logAnalyticsWorkSpaceResourceId: logAnalyticsWorkspace.outputs.resourceId
logAnalyticsWorkSpaceResourceId: logAnalyticsWorkspaceResourceId
vmAdminUsername: vmAdminUsername ?? 'JumpboxAdminUser'
vmAdminPassword: vmAdminPassword ?? 'JumpboxAdminP@ssw0rd1234!'
vmSize: vmSize ?? 'Standard_DS2_v2' // Default VM size
name: 'vnet-${solutionSuffix}'
addressPrefixes: ['10.0.0.0/20'] // 4096 addresses (enough for 8 /23 subnets or 16 /24)
location: solutionLocation
tags: allTags
logAnalyticsWorkspaceId: logAnalyticsWorkspaceResourceId
resourceSuffix: solutionSuffix
enableTelemetry: enableTelemetry
}
}
// Azure Bastion Host
var bastionHostName = 'bas-${solutionSuffix}'
module bastionHost 'br/public:avm/res/network/bastion-host:0.6.1' = if (enablePrivateNetworking) {
name: take('avm.res.network.bastion-host.${bastionHostName}', 64)
params: {
name: bastionHostName
skuName: 'Standard'
location: solutionLocation
virtualNetworkResourceId: virtualNetwork!.outputs.resourceId
diagnosticSettings: [
{
name: 'bastionDiagnostics'
workspaceResourceId: logAnalyticsWorkspaceResourceId
logCategoriesAndGroups: [
{
categoryGroup: 'allLogs'
enabled: true
}
]
}
]
tags: tags
enableTelemetry: enableTelemetry
publicIPAddressObject: {
name: 'pip-${bastionHostName}'
zones: []
}
}
}

// Jumpbox Virtual Machine
var jumpboxVmName = take('vm-jumpbox-${solutionSuffix}', 15)
module jumpboxVM 'br/public:avm/res/compute/virtual-machine:0.15.0' = if (enablePrivateNetworking) {
name: take('avm.res.compute.virtual-machine.${jumpboxVmName}', 64)
params: {
name: take(jumpboxVmName, 15) // Shorten VM name to 15 characters to avoid Azure limits
vmSize: vmSize ?? 'Standard_DS2_v2'
location: solutionLocation
adminUsername: vmAdminUsername ?? 'JumpboxAdminUser'
adminPassword: vmAdminPassword ?? 'JumpboxAdminP@ssw0rd1234!'
tags: tags
zone: 0
imageReference: {
offer: 'WindowsServer'
publisher: 'MicrosoftWindowsServer'
sku: '2019-datacenter'
version: 'latest'
}
osType: 'Windows'
osDisk: {
name: 'osdisk-${jumpboxVmName}'
managedDisk: {
storageAccountType: 'Standard_LRS'
}
}
encryptionAtHost: false // Some Azure subscriptions do not support encryption at host
nicConfigurations: [
{
name: 'nic-${jumpboxVmName}'
ipConfigurations: [
{
name: 'ipconfig1'
subnetResourceId: virtualNetwork!.outputs.jumpboxSubnetResourceId
}
]
diagnosticSettings: [
{
name: 'jumpboxDiagnostics'
workspaceResourceId: logAnalyticsWorkspaceResourceId
logCategoriesAndGroups: [
{
categoryGroup: 'allLogs'
enabled: true
}
]
metricCategories: [
{
category: 'AllMetrics'
enabled: true
}
]
}
]
}
]
enableTelemetry: enableTelemetry
}
}
// ========== Private DNS Zones ========== //
var privateDnsZones = [
'privatelink.cognitiveservices.azure.com'
Expand Down Expand Up @@ -455,8 +543,8 @@ module avmPrivateDnsZones 'br/public:avm/res/network/private-dns-zone:0.7.1' = [
enableTelemetry: enableTelemetry
virtualNetworkLinks: [
{
name: take('vnetlink-${network!.outputs.vnetName}-${split(zone, '.')[1]}', 80)
virtualNetworkResourceId: network!.outputs.vnetResourceId
name: take('vnetlink-${virtualNetwork!.outputs.name}-${split(zone, '.')[1]}', 80)
virtualNetworkResourceId: virtualNetwork!.outputs.resourceId
}
]
}
Expand Down Expand Up @@ -496,7 +584,7 @@ module keyvault 'br/public:avm/res/key-vault/vault:0.12.1' = {
]
}
service: 'vault'
subnetResourceId: network!.outputs.subnetPrivateEndpointsResourceId
subnetResourceId: virtualNetwork!.outputs.pepsSubnetResourceId
}
]
: []
Expand Down Expand Up @@ -637,7 +725,7 @@ module aiFoundryAiServices 'modules/ai-services.bicep' = if (aiFoundryAIservices
{
name: 'pep-${aiFoundryAiServicesResourceName}'
customNetworkInterfaceName: 'nic-${aiFoundryAiServicesResourceName}'
subnetResourceId: network!.outputs.subnetPrivateEndpointsResourceId
subnetResourceId: virtualNetwork!.outputs.pepsSubnetResourceId
privateDnsZoneGroup: {
privateDnsZoneGroupConfigs: [
{
Expand Down Expand Up @@ -744,7 +832,7 @@ module cosmosDb 'br/public:avm/res/document-db/database-account:0.15.0' = {
]
}
service: 'Sql'
subnetResourceId: network!.outputs.subnetPrivateEndpointsResourceId
subnetResourceId: virtualNetwork!.outputs.pepsSubnetResourceId
}
]
: []
Expand Down Expand Up @@ -817,7 +905,7 @@ module avmStorageAccount 'br/public:avm/res/storage/storage-account:0.20.0' = {
}
]
}
subnetResourceId: network!.outputs.subnetPrivateEndpointsResourceId
subnetResourceId: virtualNetwork!.outputs.pepsSubnetResourceId
service: 'blob'
}
{
Expand All @@ -830,7 +918,7 @@ module avmStorageAccount 'br/public:avm/res/storage/storage-account:0.20.0' = {
}
]
}
subnetResourceId: network!.outputs.subnetPrivateEndpointsResourceId
subnetResourceId: virtualNetwork!.outputs.pepsSubnetResourceId
service: 'queue'
}
]
Expand Down Expand Up @@ -939,7 +1027,7 @@ module sqlDBModule 'br/public:avm/res/sql/server:0.20.1' = {
]
}
service: 'sqlServer'
subnetResourceId: network!.outputs.subnetPrivateEndpointsResourceId
subnetResourceId: virtualNetwork!.outputs.pepsSubnetResourceId
tags: tags
}
]
Expand Down Expand Up @@ -1062,7 +1150,7 @@ module webSite 'modules/web-sites.bicep' = {
// WAF aligned configuration for Private Networking
vnetRouteAllEnabled: enablePrivateNetworking ? true : false
vnetImagePullEnabled: enablePrivateNetworking ? true : false
virtualNetworkSubnetId: enablePrivateNetworking ? network!.outputs.subnetWebResourceId : null
virtualNetworkSubnetId: enablePrivateNetworking ? virtualNetwork!.outputs.webSubnetResourceId : null
publicNetworkAccess: 'Enabled'
}
}
Expand Down Expand Up @@ -1144,7 +1232,7 @@ module searchService 'br/public:avm/res/search/search-service:0.11.1' = {
]
}
service: 'searchService'
subnetResourceId: network!.outputs.subnetPrivateEndpointsResourceId
subnetResourceId: virtualNetwork!.outputs.pepsSubnetResourceId
}
]
: []
Expand Down Expand Up @@ -1381,5 +1469,5 @@ output USE_AI_PROJECT_CLIENT string = useAIProjectClientFlag
@description('Indicates whether the internal stream should be used.')
output USE_INTERNAL_STREAM string = useInternalStream

@description('The client ID of the managed identity.')
output AZURE_CLIENT_ID string = userAssignedIdentity.outputs.clientId
@description('The Azure Subscription ID where the resources are deployed.')
output AZURE_SUBSCRIPTION_ID string = subscription().subscriptionId
Loading
Loading