Skip to content

Commit 75da7f5

Browse files
Abdul-MicrosoftPriyanka-MicrosoftPrajwal-Microsoft
authored
feat: Merging the AVM Waf changes into byoc-researcher (#685)
* infra avm changes in bicep * infra avm changes in bicep * updated variables * updated variables * updated variables * webapp bicep changes * webapp bicep changes * webapp bicep changes * webapp bicep changes * webapp bicep changes * only storage account deployment * only storage account deployment * only storage, multiservice & search deployment * only storage, multiservice & search deployment * only storage, multiservice & search deployment * only storage, multiservice & search deployment * only storage, multiservice & search deployment * only storage, multiservice & search deployment * only storage, multiservice & search deployment * only storage, multiservice & search deployment * only storage, multiservice & search deployment * only storage, multiservice & search deployment * added disable local auth params * added disable local auth params set to false * added disable local auth params set to false * added disable local auth params set to false * added disable local auth params set to false * added disable local auth params set to false * add keys to key vault * add keys to key vault * add keys to key vault * added owner permission * changed primaryscripturi to scriptcontent to resolve output error * changed primaryscripturi to scriptcontent to resolve output error * changed primaryscripturi to scriptcontent to resolve output error * changed retentiondays * added depends on * added depends on * added depends on * added depends on * added depends on * added depends on * added depends on * added deployment script file in the module * added deployment script file in the module * added azure client id * fetching azure client id from environment variables * changed container registry name * changed container registry name * avm and waf latest changes * fix: Added support to run the script in private network * avm and waf latest changes * fix: Added permission for storage and deployment script issue fix * added private endpoint changes * added private endpoint changes * added private endpoint changes * cleanup, removed abbr fiel * cleanup, removed abbr fiel * cleanup, removed abbr fiel * added module for hub and project * added module for hub and project * Refactored the bicep code based on bicep standards and added parameters file * updated main.json file * Update publicNetworkAccess configuration for draft flow deployment * Update Azure Machine Learning private link in main.bicep * Update containerImageTag to use latest version in parameters files * updated openai key * Enable private networking and add monitoring, scalability, and VM admin parameters in main.parameters.json; set publicNetworkAccess to 'Enabled' in main.bicep for draft flow deployment * bicep build * removed system assigned managed identity * added comment for project and hub * added comment for project and hub * Readme update * Readme update, removed dev container and codespace * Readme update, removed dev container and codespace * condition added for vmusername and password * Refactor networking settings to conditionally enable public network access based on private networking configuration * updated main.json * removed promptflow version * Update DraftFlow.zip with latest changes * Update default values for location and container registry hostname in Bicep and JSON templates * Refactor deployment instructions and remove unused parameters from JSON files * Update deployment guides to clarify WAF-aligned production deployment steps * Update deployment templates and documentation for clarity and consistency * Remove obsolete Bicep files and associated documentation for Azure infrastructure deployment, including AI services, app services, key vault, managed identity, storage account, and deployment scripts. * Remove pre-requisites section from Deployment Guide for clarity and focus on deployment options * Update project name in azure.yaml * Enhance AI Foundry Deployment Guide with detailed Azure Bastion connection steps and troubleshooting tips; update link reference in Deployment Guide for clarity. --------- Co-authored-by: Priyanka-Microsoft <v-prisinghal@microsoft.com> Co-authored-by: Prajwal D C <v-dcprajwal@microsoft.com>
1 parent ee9a923 commit 75da7f5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+56561
-3998
lines changed

.github/workflows/RAdeploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ jobs:
106106
107107
az deployment group create \
108108
--resource-group ${{ env.RESOURCE_GROUP_NAME }} \
109-
--template-file infra/bicep/main.bicep \
110-
--parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} createdBy="Pipeline" tags="{'SecurityControl':'Ignore','Purpose':'Deploying and Cleaning Up Resources for Validation','CreatedDate':'$current_date'}"
109+
--template-file infra/main.bicep \
110+
--parameters solutionName=${{ env.SOLUTION_PREFIX }} createdBy="Pipeline" tags="{'SecurityControl':'Ignore','Purpose':'Deploying and Cleaning Up Resources for Validation','CreatedDate':'$current_date'}"
111111
- name: List KeyVaults and Store in Array
112112
id: list_keyvaults
113113
run: |

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ https://azure.microsoft.com/en-us/explore/global-infrastructure/products-by-regi
7575

7676
2. Click the following deployment button to create the required resources for this accelerator in your Azure Subscription.
7777

78-
[![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2FBuild-your-own-copilot-Solution-Accelerator%2Fbyoc-researcher%2Finfra%2Fbicep%2Fmain.json)
78+
[![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2FBuild-your-own-copilot-Solution-Accelerator%2Fbyoc-researcher%2Finfra%2Fmain.json)
7979

80-
3. You will need to select an Azure Subscription, create/select a Resource group, Region, and a unique Solution Prefix.
80+
3. You will need to select an Azure Subscription, create/select a Resource group, Region, and a unique Solution Name.
8181

8282
![image](docs/images/readMe/armDeployment.png)
8383

@@ -93,6 +93,13 @@ The next steps are optional for additional learning. Not required to deploy the
9393

9494
8. Optional - Follow steps in [Promptflow Safety Evaluation guide](./docs/PromptFlowSafetyEvaluation.md) to set up the safety evaluation flows.
9595

96+
### **Deploying with Azure Developer CLI (AZD)**
97+
98+
Follow the quick deploy steps on the deployment guide to deploy this solution using Azure Developer CLI(AZD) to your own Azure subscription.
99+
100+
[Click here to launch the deployment guide](./docs/DeploymentGuide.md)
101+
<br/><br/>
102+
96103

97104
<br/>
98105
<br>

azure.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-dev/main/schemas/v1.0/azure.yaml.json
2+
name: byoc-research-assistant
3+
4+
requiredVersions:
5+
azd: ">= 1.15.0"
6+
7+
metadata:
8+
template: byoc-research-assistant@1.0

docs/AIFoundryDeployment.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,40 @@
11
# AI Foundry Deployment Guide
2+
3+
> **Important**: For WAF-aligned production deployments, ensure you are logged into the designated virtual machine before proceeding with the below steps.
4+
5+
### Accessing the Virtual Machine via Azure Bastion
6+
7+
For WAF-aligned production environments, you must perform these deployment steps from within the designated virtual machine. Follow these steps to connect:
8+
9+
1. **Navigate to your Virtual Machine in Azure Portal**
10+
- Go to [Azure Portal](https://portal.azure.com/)
11+
- Search for "Virtual machines" in the top search bar
12+
- Click on your VM named `vm-{your-deployment-prefix}` or similar
13+
14+
2. **Connect using Azure Bastion**
15+
- In your VM overview page, click the **Connect** button
16+
- Select **Connect via Bastion** from the dropdown menu
17+
18+
3. **Enter your credentials**
19+
- **Username**: Use the admin username you specified during the initial deployment (e.g., `JumpboxAdminUser` or the custom username you provided)
20+
- **Password**: Enter the admin password you set during the deployment process
21+
- **Authentication Type**: Select "Password"
22+
- Click **Connect**
23+
24+
4. **Wait for connection**
25+
- The Bastion connection may take 30-60 seconds to establish
26+
- A new browser tab will open with your VM desktop environment
27+
28+
5. **Open a web browser in the VM**
29+
- Once connected to the VM, open Microsoft Edge or Chrome
30+
- Navigate to [AI Foundry](https://ai.azure.com/) from within the VM
31+
- Sign in with your Azure credentials
32+
33+
> **Troubleshooting**: If you forgot your VM credentials:
34+
> - You can reset the password in Azure Portal: Go to your VM → **Reset password** in the left menu
35+
> - Or contact your Azure administrator for assistance
36+
---
37+
238
Please follow the steps below to configure the Prompt flow endpoint in App service configuration.
339

440
## Step 1: OpenAI Foundry Project

docs/CustomizingAzdParameters.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
## [Optional]: Customizing resource names
2+
3+
By default this template will use the environment name as the prefix to prevent naming collisions within Azure. The parameters below show the default values. You only need to run the statements below if you need to change the values.
4+
5+
6+
> To override any of the parameters, run `azd env set <PARAMETER_NAME> <VALUE>` before running `azd up`. On the first azd command, it will prompt you for the environment name. Be sure to choose 3-20 charaters alphanumeric unique name.
7+
8+
## Parameters
9+
10+
| Name | Type | Default Value | Purpose |
11+
| -----------------------------| ------- | ------------------- | ---------------------------------------------------------------------------------------------------- |
12+
| `AZURE_ENV_NAME` | string | `azdtemp` | Used as a prefix for all resource names to ensure uniqueness across environments. |
13+
| `AZURE_LOCATION` | string | `<User selects during deployment>` | Sets the Azure region for resource deployment. |
14+
| `AZURE_OPENAI_MODEL_DEPLOYMENT_TYPE` | string | `Standard` | Change the Model Deployment Type (allowed values: Standard, GlobalStandard). |
15+
| `AZURE_OPENAI_DEPLOYMENT_MODEL` | string | `gpt-35-turbo` | Set the GPT model name (allowed values: `gpt-35-turbo`, `gpt-4`, `gpt-4o`). |
16+
| `AZURE_OPENAI_API_VERSION` | string | `0125` | Set the Azure OpenAI model version. |
17+
| `AZURE_OPENAI_DEPLOYMENT_MODEL_CAPACITY` | integer | `30` | Set the model capacity for GPT deployment. Choose based on your Azure quota and usage needs. |
18+
| `AZURE_OPENAI_EMBEDDING_MODEL` | string | `text-embedding-ada-002` | Set the model name used for embeddings. |
19+
| `AZURE_OPENAI_EMBEDDING_MODEL_VERSION` | string | `2` | Set the version for the embedding model. |
20+
| `AZURE_OPENAI_EMBEDDING_MODEL_CAPACITY` | integer | `45` | Set the capacity for embedding model deployment. |
21+
| `AZURE_ENV_IMAGETAG` | string | `latest` | Set the container image tag (allowed values: `latest`, `dev`, `hotfix`). |
22+
| `AZURE_ENV_ENABLE_TELEMETRY` | boolean | `true` | Enable or disable telemetry collection for the deployment. |
23+
| `AZURE_ENV_VM_ADMIN_USERNAME` | string | `<Set when enablePrivateNetworking=true>` | Admin username for the jumpbox VM when private networking is enabled. |
24+
| `AZURE_ENV_VM_ADMIN_PASSWORD` | string | `<Set when enablePrivateNetworking=true>` | Admin password for the jumpbox VM when private networking is enabled. |
25+
26+
27+
## How to Set a Parameter
28+
To customize any of the above values, run the following command **before** `azd up`:
29+
30+
```bash
31+
azd env set <PARAMETER_NAME> <VALUE>
32+
33+
```
34+
35+
**Example:**
36+
37+
```bash
38+
azd env set AZURE_LOCATION westus2
39+
```

docs/DeploymentGuide.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Deployment Guide
2+
3+
## Deployment Options
4+
5+
### Sandbox or WAF Aligned Deployment Options
6+
7+
The [`infra`](../infra) folder of the Build-your-own-copilot-Solution-Accelerator contains the [`main.bicep`](../infra/main.bicep) Bicep script, which defines all Azure infrastructure components for this solution.
8+
9+
By default, the `azd up` command uses the [`main.parameters.json`](../infra/main.parameters.json) file to deploy the solution. This file is pre-configured for a **sandbox environment** — ideal for development and proof-of-concept scenarios, with minimal security and cost controls for rapid iteration.
10+
11+
For **production deployments**, the repository also provides [`main.waf.parameters.json`](../infra/main.waf.parameters.json), which applies a [Well-Architected Framework (WAF) aligned](https://learn.microsoft.com/en-us/azure/well-architected/) configuration. This option enables additional Azure best practices for reliability, security, cost optimization, operational excellence, and performance efficiency, such as:
12+
13+
- Enhanced network security (e.g., Network protection with private endpoints)
14+
- Stricter access controls and managed identities
15+
- Logging, monitoring, and diagnostics enabled by default
16+
- Resource tagging and cost management recommendations
17+
18+
---
19+
20+
**How to choose your deployment configuration:**
21+
22+
* Use the default `main.parameters.json` file for a **sandbox/dev environment**
23+
* For a **WAF-aligned, production-ready deployment**, copy the contents of `main.waf.parameters.json` into `main.parameters.json` before running `azd up`
24+
25+
### VM Credentials Configuration
26+
27+
By default, the solution sets the VM administrator username and password from environment variables.
28+
29+
To set your own VM credentials before deployment, use:
30+
31+
```sh
32+
azd env set AZURE_ENV_VM_ADMIN_USERNAME <your-username>
33+
azd env set AZURE_ENV_VM_ADMIN_PASSWORD <your-password>
34+
```
35+
36+
> [!TIP]
37+
> Always review and adjust parameter values (such as region, capacity, security settings and log analytics workspace configuration) to match your organization’s requirements before deploying. For production, ensure you have sufficient quota and follow the principle of least privilege for all identities and role assignments.
38+
39+
40+
> [!IMPORTANT]
41+
> The WAF-aligned configuration is under active development. More Azure Well-Architected recommendations will be added in future updates.
42+
43+
---
44+
45+
### Deploying with AZD
46+
47+
Once you've opened the project in locally, you can deploy it to Azure by following these steps:
48+
49+
1. Login to Azure:
50+
51+
```shell
52+
azd auth login
53+
```
54+
55+
#### To authenticate with Azure Developer CLI (`azd`), use the following command with your **Tenant ID**:
56+
57+
```sh
58+
azd auth login --tenant-id <tenant-id>
59+
```
60+
61+
2. Provision and deploy all the resources:
62+
63+
```shell
64+
azd up
65+
```
66+
67+
3. Provide an `azd` environment name (e.g., "resass").
68+
4. Select a subscription from your Azure account and choose a location that has quota for all the resources.
69+
-- This deployment will take *15-20 minutes* to provision the resources in your account and set up the solution with sample data.
70+
- If you encounter an error or timeout during deployment, changing the location may help, as there could be availability constraints for the resources.
71+
72+
5. When Deployment is complete, follow steps in [AI Foundry Deployment guide](./AIFoundryDeployment.md) to configure the grant draft proposal endpoint.
73+
74+
5. Open the [Azure Portal](https://portal.azure.com/), go to the deployed resource group, find the App Service, and get the app URL from `Default domain`.
75+
76+
6. If you are done trying out the application, you can delete the resources by running `azd down`.
77+
78+
---
-14.6 KB
Loading

0 commit comments

Comments
 (0)