Skip to content

Commit aff4eb2

Browse files
committed
Add Microsoft Foundry Python SDK Guide and resource creation documentation
- Introduced a comprehensive guide for the Microsoft Foundry Python SDK, detailing prerequisites, model deployment, agent creation, and evaluation processes. - Created documentation for creating Azure AI Services multi-service resources using Azure CLI, including workflows, troubleshooting, and common patterns. - Added detailed workflows for resource group creation, Foundry resource creation, and resource provider registration. - Included troubleshooting steps for common errors encountered during resource creation.
1 parent cd64996 commit aff4eb2

File tree

261 files changed

+13365
-5356
lines changed

Some content is hidden

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

261 files changed

+13365
-5356
lines changed

cli/counts.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"agents": 16,
3-
"skills": 29
3+
"skills": 28
44
}

cli/extension.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ displayName: Azure Copilot CLI
66
description: |
77
AI-powered Azure development assistant. Describe what you want to build,
88
and Copilot builds and deploys it to Azure. Includes 16 specialized agents
9-
and 29 Azure skills.
9+
and 28 Azure skills.
1010
usage: azd copilot <command> [options]
1111
version: 0.1.6
1212
entryPoint: copilot

cli/src/internal/assets/ghcp4a-skills/appinsights-instrumentation/SKILL.md

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,33 @@
11
---
22
name: appinsights-instrumentation
3-
description: "Instrument web applications to send telemetry data to Azure Application Insights for observability and monitoring. USE FOR: instrument app with app insights, add appinsights instrumentation, configure application insights, set up telemetry monitoring, enable app insights auto-instrumentation, add observability to azure web app, instrument webapp to send data to app insights, configure telemetry for app service. DO NOT USE FOR: non-Azure monitoring (use CloudWatch for AWS, Datadog for third-party), log analysis (use azure-kusto), cost monitoring (use azure-cost-optimization), security monitoring (use azure-security)."
3+
description: |
4+
Guidance for instrumenting webapps with Azure Application Insights. Provides telemetry patterns, SDK setup, and configuration references.
5+
USE FOR: how to instrument app, App Insights SDK, telemetry patterns, what is App Insights, Application Insights guidance, instrumentation examples, APM best practices.
6+
DO NOT USE FOR: adding App Insights to my app (use azure-prepare), add telemetry to my project (use azure-prepare), add monitoring (use azure-prepare). This skill provides guidance—azure-prepare orchestrates component changes.
47
---
58

6-
# AppInsights instrumentation
9+
# AppInsights Instrumentation Guide
710

8-
This skill enables sending telemetry data of a webapp to Azure App Insights for better observability of the app's health.
11+
This skill provides **guidance and reference material** for instrumenting webapps with Azure Application Insights.
912

10-
## When to use this skill
13+
> **⛔ ADDING COMPONENTS?**
14+
>
15+
> If the user wants to **add App Insights to their app**, invoke **azure-prepare** instead.
16+
> This skill provides reference material—azure-prepare orchestrates the actual changes.
1117
12-
Use this skill when the user wants to enable telemetry for their webapp.
18+
## When to Use This Skill
19+
20+
- User asks **how** to instrument (guidance, patterns, examples)
21+
- User needs SDK setup instructions
22+
- azure-prepare invokes this skill during research phase
23+
- User wants to understand App Insights concepts
24+
25+
## When to Use azure-prepare Instead
26+
27+
- User says "add telemetry to my app"
28+
- User says "add App Insights"
29+
- User wants to modify their project
30+
- Any request to change/add components
1331

1432
## Prerequisites
1533

@@ -46,3 +64,8 @@ No matter which option you choose, recommend the user to create the App Insights
4664
- If the app is an ASP.NET Core app, see [ASPNETCORE guide](references/aspnetcore.md) for how to modify the C# code.
4765
- If the app is a Node.js app, see [NODEJS guide](references/nodejs.md) for how to modify the JavaScript/TypeScript code.
4866
- If the app is a Python app, see [PYTHON guide](references/python.md) for how to modify the Python code.
67+
68+
## SDK Quick References
69+
70+
- **OpenTelemetry Distro**: [Python](references/sdk/azure-monitor-opentelemetry-py.md) | [TypeScript](references/sdk/azure-monitor-opentelemetry-ts.md)
71+
- **OpenTelemetry Exporter**: [Python](references/sdk/azure-monitor-opentelemetry-exporter-py.md) | [Java](references/sdk/azure-monitor-opentelemetry-exporter-java.md)

cli/src/internal/assets/ghcp4a-skills/appinsights-instrumentation/references/aspnetcore.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ An ASP.NET Core app typically has a Program.cs file that "builds" the app. Find
1616
1717
## Configure App Insights connection string
1818

19-
The App Insights resource has a connection string. Add the connection string as an environment variable of the running app. You can use Azure CLI to query the connection string of the App Insights resource. See [scripts/appinsights.ps1](scripts/appinsights.ps1) for what Azure CLI command to execute for querying the connection string.
19+
The App Insights resource has a connection string. Add the connection string as an environment variable of the running app. You can use Azure CLI to query the connection string of the App Insights resource. See [scripts/appinsights.ps1](../scripts/appinsights.ps1) for what Azure CLI command to execute for querying the connection string.
2020

2121
After getting the connection string, set this environment variable with its value.
2222

2323
```
2424
"APPLICATIONINSIGHTS_CONNECTION_STRING={your_application_insights_connection_string}"
2525
```
2626

27-
If the app has IaC template such as Bicep or terraform files representing its cloud instance, this environment variable should be added to the IaC template to be applied in each deployment. Otherwise, use Azure CLI to manually apply the environment variable to the cloud instance of the app. See [scripts/appinsights.ps1](scripts/appinsights.ps1) for what Azure CLI command to execute for setting this environment variable.
27+
If the app has IaC template such as Bicep or terraform files representing its cloud instance, this environment variable should be added to the IaC template to be applied in each deployment. Otherwise, use Azure CLI to manually apply the environment variable to the cloud instance of the app. See [scripts/appinsights.ps1](../scripts/appinsights.ps1) for what Azure CLI command to execute for setting this environment variable.
2828

2929
> Important: Don't modify appsettings.json. It was a deprecated way to configure App Insights. The environment variable is the new recommended way.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Azure Monitor OpenTelemetry Exporter — Java SDK Quick Reference
2+
3+
> Condensed from **azure-monitor-opentelemetry-exporter-java**. Full patterns
4+
> (trace/metric/log export, spans, semantic conventions)
5+
> in the **azure-monitor-opentelemetry-exporter-java** plugin skill if installed.
6+
7+
## Install
8+
```xml
9+
<dependency>
10+
<groupId>com.azure</groupId>
11+
<artifactId>azure-monitor-opentelemetry-exporter</artifactId>
12+
<version>1.0.0-beta.x</version>
13+
</dependency>
14+
```
15+
16+
> **DEPRECATED**: Migrate to `azure-monitor-opentelemetry-autoconfigure`.
17+
18+
## Quick Start
19+
```java
20+
// Prefer autoconfigure instead:
21+
// <artifactId>azure-monitor-opentelemetry-autoconfigure</artifactId>
22+
```
23+
24+
## Best Practices
25+
- Use autoconfigure — migrate to `azure-monitor-opentelemetry-autoconfigure`
26+
- Set meaningful span names — use descriptive operation names
27+
- Add relevant attributes — include contextual data for debugging
28+
- Handle exceptions — always record exceptions on spans
29+
- Use semantic conventions — follow OpenTelemetry semantic conventions
30+
- End spans in finally — ensure spans are always ended
31+
- Use try-with-resources — scope management with try-with-resources pattern
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Azure Monitor OpenTelemetry Exporter — Python SDK Quick Reference
2+
3+
> Condensed from **azure-monitor-opentelemetry-exporter-py**. Full patterns
4+
> (metric exporter, log exporter, offline storage, sovereign clouds)
5+
> in the **azure-monitor-opentelemetry-exporter-py** plugin skill if installed.
6+
7+
## Install
8+
pip install azure-monitor-opentelemetry-exporter
9+
10+
## Quick Start
11+
```python
12+
from azure.monitor.opentelemetry.exporter import AzureMonitorTraceExporter
13+
exporter = AzureMonitorTraceExporter() # reads APPLICATIONINSIGHTS_CONNECTION_STRING
14+
```
15+
16+
## Best Practices
17+
- Use BatchSpanProcessor for production (not SimpleSpanProcessor)
18+
- Use ApplicationInsightsSampler for consistent sampling across services
19+
- Enable offline storage for reliability in production
20+
- Use AAD authentication instead of instrumentation keys
21+
- Set export intervals appropriate for your workload
22+
- Use the distro (azure-monitor-opentelemetry) unless you need custom pipelines
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Azure Monitor OpenTelemetry — Python SDK Quick Reference
2+
3+
> Condensed from **azure-monitor-opentelemetry-py**. Full patterns
4+
> (Flask/Django/FastAPI, custom metrics, sampling, live metrics)
5+
> in the **azure-monitor-opentelemetry-py** plugin skill if installed.
6+
7+
## Install
8+
pip install azure-monitor-opentelemetry
9+
10+
## Quick Start
11+
```python
12+
from azure.monitor.opentelemetry import configure_azure_monitor
13+
configure_azure_monitor()
14+
```
15+
16+
## Best Practices
17+
- Call configure_azure_monitor() early — before importing instrumented libraries
18+
- Use environment variables for connection string in production
19+
- Set cloud role name for multi-service Application Map
20+
- Enable sampling in high-traffic applications
21+
- Use structured logging for better log analytics queries
22+
- Add custom attributes to spans for better debugging
23+
- Use AAD authentication for production workloads
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Azure Monitor OpenTelemetry — TypeScript SDK Quick Reference
2+
3+
> Condensed from **azure-monitor-opentelemetry-ts**. Full patterns
4+
> (ESM loader, custom span processors, manual exporters, live metrics)
5+
> in the **azure-monitor-opentelemetry-ts** plugin skill if installed.
6+
7+
## Install
8+
npm install @azure/monitor-opentelemetry
9+
10+
## Quick Start
11+
```typescript
12+
import { useAzureMonitor } from "@azure/monitor-opentelemetry";
13+
useAzureMonitor({
14+
azureMonitorExporterOptions: {
15+
connectionString: process.env.APPLICATIONINSIGHTS_CONNECTION_STRING
16+
}
17+
});
18+
```
19+
20+
## Best Practices
21+
- Call useAzureMonitor() first — before importing other modules
22+
- Use ESM loader for ESM projects — `--import @azure/monitor-opentelemetry/loader`
23+
- Enable offline storage for reliable telemetry in disconnected scenarios
24+
- Set sampling ratio for high-traffic applications
25+
- Add custom dimensions — use span processors for enrichment
26+
- Graceful shutdown — call shutdownAzureMonitor() to flush telemetry

cli/src/internal/assets/ghcp4a-skills/azure-ai/SKILL.md

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: azure-ai
3-
description: "Use for Azure AI: Search, Speech, Foundry, OpenAI, Document Intelligence. Helps with search, vector/hybrid search, speech-to-text, text-to-speech, transcription, AI agents, prompt flows, OCR. USE FOR: AI Search, query search, vector search, hybrid search, semantic search, speech-to-text, text-to-speech, transcribe, AI agent, prompt flow, Foundry, OCR, convert text to speech. DO NOT USE FOR: Function apps/Functions (use azure-functions), databases (azure-postgres/azure-kusto), resources."
3+
description: "Use for Azure AI: Search, Speech, OpenAI, Document Intelligence. Helps with search, vector/hybrid search, speech-to-text, text-to-speech, transcription, OCR. USE FOR: AI Search, query search, vector search, hybrid search, semantic search, speech-to-text, text-to-speech, transcribe, OCR, convert text to speech. DO NOT USE FOR: Function apps/Functions (use azure-functions), databases (azure-postgres/azure-kusto), general Azure resources."
44
---
55

66
# Azure AI Services
@@ -11,7 +11,6 @@ description: "Use for Azure AI: Search, Speech, Foundry, OpenAI, Document Intell
1111
|---------|----------|-----------|-----|
1212
| AI Search | Full-text, vector, hybrid search | `azure__search` | `az search` |
1313
| Speech | Speech-to-text, text-to-speech | `azure__speech` | - |
14-
| Foundry | AI models, agents, prompt flows | `azure__foundry` | `az ml` |
1514
| OpenAI | GPT models, embeddings, DALL-E | - | `az cognitiveservices` |
1615
| Document Intelligence | Form extraction, OCR | - | - |
1716

@@ -28,11 +27,6 @@ When Azure MCP is enabled:
2827
- `azure__speech` with command `speech_transcribe` - Speech to text
2928
- `azure__speech` with command `speech_synthesize` - Text to speech
3029

31-
### Foundry
32-
- `azure__foundry` with command `foundry_model_list` - List AI models
33-
- `azure__foundry` with command `foundry_deployment_list` - List deployments
34-
- `azure__foundry` with command `foundry_agent_list` - List AI agents
35-
3630
**If Azure MCP is not enabled:** Run `/azure:setup` or enable via `/mcp`.
3731

3832
## AI Search Capabilities
@@ -53,19 +47,21 @@ When Azure MCP is enabled:
5347
| Speaker diarization | Identify who spoke when |
5448
| Custom models | Domain-specific vocabulary |
5549

56-
## Foundry Capabilities
50+
## SDK Quick References
5751

58-
| Feature | Description |
59-
|---------|-------------|
60-
| Model catalog | GPT-4, Llama, Mistral, custom |
61-
| AI agents | Multi-turn, tool calling, RAG |
62-
| Prompt flow | Orchestration, evaluation |
63-
| Fine-tuning | Custom model training |
52+
For programmatic access to these services, see the condensed SDK guides:
53+
54+
- **AI Search**: [Python](references/sdk/azure-search-documents-py.md) | [TypeScript](references/sdk/azure-search-documents-ts.md) | [.NET](references/sdk/azure-search-documents-dotnet.md)
55+
- **OpenAI**: [.NET](references/sdk/azure-ai-openai-dotnet.md)
56+
- **Vision**: [Python](references/sdk/azure-ai-vision-imageanalysis-py.md) | [Java](references/sdk/azure-ai-vision-imageanalysis-java.md)
57+
- **Transcription**: [Python](references/sdk/azure-ai-transcription-py.md)
58+
- **Translation**: [Python](references/sdk/azure-ai-translation-text-py.md) | [TypeScript](references/sdk/azure-ai-translation-ts.md)
59+
- **Document Intelligence**: [.NET](references/sdk/azure-ai-document-intelligence-dotnet.md) | [TypeScript](references/sdk/azure-ai-document-intelligence-ts.md)
60+
- **Content Safety**: [Python](references/sdk/azure-ai-contentsafety-py.md) | [TypeScript](references/sdk/azure-ai-contentsafety-ts.md) | [Java](references/sdk/azure-ai-contentsafety-java.md)
6461

6562
## Service Details
6663

6764
For deep documentation on specific services:
6865

6966
- AI Search indexing and queries -> [Azure AI Search documentation](https://learn.microsoft.com/azure/search/search-what-is-azure-search)
7067
- Speech transcription patterns -> [Azure AI Speech documentation](https://learn.microsoft.com/azure/ai-services/speech-service/overview)
71-
- Foundry agents and flows -> [Azure AI Foundry documentation](https://learn.microsoft.com/azure/ai-studio/what-is-ai-studio)
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Azure AI Content Safety — Java SDK Quick Reference
2+
3+
> Condensed from **azure-ai-contentsafety-java**. Full patterns (blocklist management, image moderation, 8-severity)
4+
> in the **azure-ai-contentsafety-java** plugin skill if installed.
5+
6+
## Install
7+
```xml
8+
<dependency>
9+
<groupId>com.azure</groupId>
10+
<artifactId>azure-ai-contentsafety</artifactId>
11+
<version>1.1.0-beta.1</version>
12+
</dependency>
13+
```
14+
15+
## Quick Start
16+
```java
17+
import com.azure.ai.contentsafety.ContentSafetyClient;
18+
import com.azure.ai.contentsafety.ContentSafetyClientBuilder;
19+
import com.azure.ai.contentsafety.BlocklistClient;
20+
import com.azure.ai.contentsafety.BlocklistClientBuilder;
21+
ContentSafetyClient client = new ContentSafetyClientBuilder()
22+
.endpoint(endpoint).credential(credential).buildClient();
23+
```
24+
25+
## Non-Obvious Patterns
26+
- Two separate builders: `ContentSafetyClientBuilder` and `BlocklistClientBuilder`
27+
- Image from file: `new ContentSafetyImageData().setContent(BinaryData.fromBytes(bytes))`
28+
- Image from URL: `new ContentSafetyImageData().setBlobUrl(url)`
29+
- Blocklist create uses raw `BinaryData` + `RequestOptions` (not typed model)
30+
31+
## Best Practices
32+
1. Blocklist changes take ~5 minutes to take effect
33+
2. Only request needed categories to reduce latency
34+
3. Typically block severity >= 4 for strict moderation
35+
4. Process multiple items in parallel for throughput
36+
5. Cache blocklist results where appropriate

0 commit comments

Comments
 (0)