Skip to content

chore: dev to main merge#155

Open
Saswato-Microsoft wants to merge 6 commits into
mainfrom
dev
Open

chore: dev to main merge#155
Saswato-Microsoft wants to merge 6 commits into
mainfrom
dev

Conversation

@Saswato-Microsoft
Copy link
Copy Markdown
Contributor

Purpose

This pull request introduces support for "Bring Your Own" (BYO) Log Analytics Workspace for observability in the deployment. It allows users to specify an existing Log Analytics workspace for routing diagnostic logs and metrics from the wrapper-managed PostgreSQL Flexible Server and for linking a new Application Insights component to this workspace, instead of creating new observability resources by default. The change is fully documented and exposes relevant outputs for downstream automation.

Key changes grouped by theme:

Infrastructure and Parameterization:

  • Added the existingLogAnalyticsWorkspaceResourceId parameter to infra/main.bicep, infra/main.bicepparam, and infra/main.json, allowing users to specify an existing Log Analytics workspace for observability. [1] [2] [3]
  • Conditional creation of an Application Insights component in the deployment resource group, linked to the BYO workspace, only when BYO is enabled, deployAppInsights is true, and deployLogAnalytics is false. [1] [2]
  • Diagnostic settings for the wrapper-managed PostgreSQL Flexible Server are now routed to the specified BYO Log Analytics workspace when enabled. [1] [2] [3] [4]

Outputs and Automation:

  • Exposed new outputs for downstream automation: the workspace resource ID, Application Insights resource ID, name, connection string, and instrumentation key (when BYO is enabled and App Insights is created). [1] [2]

Documentation:

  • Updated docs/deploymentguide.md and docs/parameter_guide.md with detailed instructions, permissions required, and security notes for using a BYO Log Analytics workspace, including how to set the parameter and expected outputs. [1] [2] [3]

Miscellaneous:

  • Updated Bicep and ARM template generator metadata to reflect the new template version. [1] [2]

These changes provide more flexibility for organizations with centralized observability infrastructure and improve the security and manageability of diagnostic data.

Does this introduce a breaking change?

  • Yes
  • No

Golden Path Validation

  • I have tested the primary workflows (the "golden path") to ensure they function correctly without errors.

Deployment Validation

  • I have validated the deployment process successfully and all services are running as expected with this change.

What to Check

Verify that the following are valid

  • ...

Other Information

Saswato-Microsoft and others added 6 commits May 11, 2026 20:59
…urceId

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…tion Insights integration

Co-authored-by: Copilot <copilot@github.com>
…greSQL diagnostics

Co-authored-by: Copilot <copilot@github.com>
feat: Support BYO Log Analytics workspace for Foundry app and PostgreSQL diagnostics
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds BYO Log Analytics workspace support for observability, allowing PostgreSQL diagnostics and a wrapper-created Application Insights component to target an existing workspace.

Changes:

  • Adds existingLogAnalyticsWorkspaceResourceId parameter and related BYO observability variables.
  • Creates conditional BYO Application Insights and PostgreSQL diagnostic settings.
  • Documents BYO workspace setup, outputs, and permissions.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
infra/main.bicep Adds BYO workspace parameter, conditional App Insights resource, PostgreSQL diagnostic settings, and outputs.
infra/main.bicepparam Reads the BYO workspace resource ID from an azd environment variable.
infra/main.json Generated ARM template updates reflecting the Bicep changes.
docs/parameter_guide.md Adds BYO Log Analytics setup, outputs, and permissions guidance.
docs/deploymentguide.md Adds BYO workspace parameter and deployment guidance.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/parameter_guide.md
Comment on lines +125 to +129
The identity running the deployment needs permission to attach diagnostic settings to the workspace and to create the Application Insights component:

- **`Microsoft.Insights/diagnosticSettings/write`** on the BYO Log Analytics workspace (or its resource group). The built-in **Log Analytics Contributor** role on the workspace (or its RG) covers this — there is no need to grant subscription-wide rights.
- **`Microsoft.Insights/components/write`** on the deployment resource group (covered by **Contributor** on the deployment RG, which the deployment identity already needs to provision the rest of the stack).
- The PostgreSQL Flexible Server that emits diagnostics is wrapper-managed in the deployment RG, so no additional cross-resource permissions are required.
Comment thread docs/deploymentguide.md
1. Route PostgreSQL diagnostic logs and metrics to your workspace (when PostgreSQL is deployed by the wrapper).
2. Create an Application Insights component in the deployment resource group, linked to your existing workspace — only when Application Insights deployment is enabled and the deployment is not creating a new Log Analytics workspace (i.e. `deployAppInsights = true` and `deployLogAnalytics = false`, which are the wrapper defaults).

The workspace may live in a different resource group or subscription within the same tenant. The identity running `azd up` needs **`Microsoft.Insights/diagnosticSettings/write`** on the workspace itself (covered by the built-in **Log Analytics Contributor** role scoped to the workspace or its resource group — subscription-wide rights are not required). See the **Observability — Bring Your Own Log Analytics Workspace** section in the [Parameter Guide](./parameter_guide.md) for the full output reference (including App Insights values when that component is deployed) and notes on deployment-history exposure of those values.
Comment thread infra/main.bicep
param aiFoundryCosmosDBAccountResourceId string = ''
param keyVaultResourceId string = ''

@description('Optional. Full ARM resource ID of an existing Log Analytics workspace to use for observability of the deployed Foundry application and wrapper-managed PostgreSQL. When provided, an Application Insights component is created in the deployment resource group and linked to this workspace, and diagnostic settings on the wrapper-managed PostgreSQL flexible server are routed to it. Leave empty to skip BYO behavior. Format: /subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.OperationalInsights/workspaces/{name}.')
Comment thread docs/parameter_guide.md
## Observability — Bring Your Own Log Analytics Workspace

By default the wrapper sets `deployLogAnalytics = false`, so the AI Landing Zone does not create a new Log Analytics workspace and Application Insights is not provisioned. If you already have a centralized Log Analytics workspace (for example one shared across the platform), you can wire the deployed Foundry application and the wrapper-managed PostgreSQL Flexible Server to it.

Comment thread infra/main.bicep
Comment on lines +432 to +433
publicNetworkAccessForIngestion: 'Enabled'
publicNetworkAccessForQuery: 'Enabled'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants