Skip to content

Commit 6871b2c

Browse files
Merge pull request #622 from microsoft/dev
fix: Merging dev to main branch
2 parents f793108 + 604c181 commit 6871b2c

File tree

12 files changed

+1670
-54
lines changed

12 files changed

+1670
-54
lines changed

azure_custom.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
environment:
2+
name: document-generation
3+
location: eastus
4+
5+
name: document-generation
6+
metadata:
7+
template: document-generation@1.0
8+
9+
requiredVersions:
10+
azd: '>= 1.18.0'
11+
12+
parameters:
13+
solutionPrefix:
14+
type: string
15+
default: bs-azdtest
16+
otherLocation:
17+
type: string
18+
default: eastus2
19+
baseUrl:
20+
type: string
21+
default: 'https://github.com/microsoft/document-generation-solution-accelerator'
22+
23+
services:
24+
webapp:
25+
project: ./src
26+
language: py
27+
host: appservice
28+
dist: ./dist
29+
hooks:
30+
prepackage:
31+
windows:
32+
shell: pwsh
33+
run: ../infra/scripts/package_webapp.ps1
34+
interactive: true
35+
continueOnError: false
36+
posix:
37+
shell: sh
38+
run: bash ../infra/scripts/package_webapp.sh
39+
interactive: true
40+
continueOnError: false
41+
42+
deployment:
43+
mode: Incremental
44+
template: ./infra/main.bicep # Path to the main.bicep file inside the 'deployment' folder
45+
parameters:
46+
solutionPrefix: ${parameters.solutionPrefix}
47+
otherLocation: ${parameters.otherLocation}
48+
baseUrl: ${parameters.baseUrl}

docs/DeploymentGuide.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,11 @@ Once you've opened the project in [Codespaces](#github-codespaces), [Dev Contain
209209

210210
6. 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`.
211211

212-
7. You can now delete the resources by running `azd down`, if you are done trying out the application.
212+
7. You can now delete the resources by running `azd down`, if you are done trying out the application.
213+
> **Note:** If you deployed with `enableRedundancy=true` and Log Analytics workspace replication is enabled, you must first disable replication before running `azd down` else resource group delete will fail. Follow the steps in [Handling Log Analytics Workspace Deletion with Replication Enabled](./LogAnalyticsReplicationDisable.md), wait until replication returns `false`, then run `azd down`.
213214

214215
### 🛠️ Troubleshooting
215-
If you encounter any issues during the deployment process, please refer [troubleshooting](../docs/TroubleShootingSteps.md) document for detailed steps and solutions
216+
If you encounter any issues during the deployment process, please refer [troubleshooting](../docs/TroubleShootingSteps.md) document for detailed steps and solutions
216217

217218
## Post Deployment Steps
218219

@@ -226,6 +227,17 @@ Once you've opened the project in [Codespaces](#github-codespaces), [Dev Contain
226227

227228
- Follow steps in [Delete Resource Group](./DeleteResourceGroup.md) if your deployment fails and/or you need to clean up the resources.
228229

230+
## Deploy Your Local Changes
231+
232+
To deploy your local changes, rename the below files:
233+
234+
1. Rename `azure.yaml` to `azure_custom2.yaml` and `azure_custom.yaml` to `azure.yaml`.
235+
236+
2. **Go to `infra` directory:**
237+
- Rename `main.bicep` to `main_custom2.bicep` and `main_custom.bicep` to `main.bicep`.
238+
239+
3. Continue with the [deploying steps](#deploying-with-azd).
240+
229241
## Environment configuration for local development & debugging
230242
> Set APP_ENV in your .env file to control Azure authentication. Set the environment variable to dev to use Azure CLI credentials, or to prod to use Managed Identity for production. **Ensure you're logged in via az login when using dev in local**.
231243
To configure your environment, follow these steps:
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# 🛠 Handling Log Analytics Workspace Deletion with Replication Enabled
2+
3+
If redundancy (replication) is enabled for your Log Analytics workspace, you must disable it before deleting the workspace or resource group. Otherwise, deletion will fail.
4+
5+
## ✅ Steps to Disable Replication Before Deletion
6+
Run the following Azure CLI command. Note: This operation may take about 5 minutes to complete.
7+
8+
```bash
9+
az resource update --ids "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{logAnalyticsName}" --set properties.replication.enabled=false
10+
```
11+
12+
Replace:
13+
- `{subscriptionId}` → Your Azure subscription ID
14+
- `{resourceGroupName}` → The name of your resource group
15+
- `{logAnalyticsName}` → The name of your Log Analytics workspace
16+
17+
Optional: Verify replication disabled (should output `false`):
18+
```bash
19+
az resource show --ids "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{logAnalyticsName}" --query properties.replication.enabled -o tsv
20+
```
21+
22+
## ✅ After Disabling Replication
23+
You can safely delete:
24+
- The Log Analytics workspace (manual)
25+
- The resource group (manual), or
26+
- All provisioned resources via `azd down`
27+
28+
Return to: [Deployment Guide](./DeploymentGuide.md)

infra/main.bicep

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,6 +1105,11 @@ module keyvault 'br/public:avm/res/key-vault/vault:0.12.1' = {
11051105
{name: 'AZURE-OPENAI-PREVIEW-API-VERSION', value: azureOpenaiAPIVersion}
11061106
{name: 'AZURE-OPEN-AI-DEPLOYMENT-MODEL', value: gptModelName}
11071107
{name: 'TENANT-ID', value: subscription().tenantId}
1108+
{
1109+
name: 'AZURE-AI-AGENT-ENDPOINT'
1110+
value: aiFoundryAiProjectEndpoint
1111+
}
1112+
11081113
]
11091114
}
11101115
dependsOn:[

0 commit comments

Comments
 (0)