agentops-accelerator 0.3.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. agentops/__init__.py +10 -0
  2. agentops/__main__.py +6 -0
  3. agentops/agent/__init__.py +12 -0
  4. agentops/agent/_legacy_ids.py +92 -0
  5. agentops/agent/analyzer.py +207 -0
  6. agentops/agent/checks/__init__.py +1 -0
  7. agentops/agent/checks/catalog.py +880 -0
  8. agentops/agent/checks/errors.py +279 -0
  9. agentops/agent/checks/foundry_config.py +75 -0
  10. agentops/agent/checks/latency.py +84 -0
  11. agentops/agent/checks/opex.py +157 -0
  12. agentops/agent/checks/opex_workspace.py +874 -0
  13. agentops/agent/checks/posture.py +36 -0
  14. agentops/agent/checks/posture_rules/__init__.py +53 -0
  15. agentops/agent/checks/posture_rules/content_filter.py +59 -0
  16. agentops/agent/checks/posture_rules/diagnostics.py +74 -0
  17. agentops/agent/checks/posture_rules/local_auth.py +55 -0
  18. agentops/agent/checks/posture_rules/managed_identity.py +59 -0
  19. agentops/agent/checks/posture_rules/network.py +68 -0
  20. agentops/agent/checks/regression.py +78 -0
  21. agentops/agent/checks/release_readiness.py +182 -0
  22. agentops/agent/checks/safety.py +247 -0
  23. agentops/agent/checks/spec_conformance.py +375 -0
  24. agentops/agent/cockpit.py +5159 -0
  25. agentops/agent/config.py +240 -0
  26. agentops/agent/findings.py +113 -0
  27. agentops/agent/history.py +142 -0
  28. agentops/agent/knowledge/__init__.py +182 -0
  29. agentops/agent/knowledge/waf-checklist.csv +39 -0
  30. agentops/agent/llm_assist/__init__.py +16 -0
  31. agentops/agent/llm_assist/_base.py +124 -0
  32. agentops/agent/llm_assist/_bundle_rule.py +154 -0
  33. agentops/agent/llm_assist/_client.py +347 -0
  34. agentops/agent/llm_assist/_dataset_rules.py +191 -0
  35. agentops/agent/llm_assist/_engine.py +106 -0
  36. agentops/agent/llm_assist/_prompt_rules.py +291 -0
  37. agentops/agent/llm_assist/_spec_rules.py +235 -0
  38. agentops/agent/production_telemetry.py +430 -0
  39. agentops/agent/report.py +207 -0
  40. agentops/agent/server/__init__.py +1 -0
  41. agentops/agent/server/app.py +84 -0
  42. agentops/agent/server/auth.py +94 -0
  43. agentops/agent/server/chat.py +44 -0
  44. agentops/agent/server/protocol.py +72 -0
  45. agentops/agent/sources/__init__.py +1 -0
  46. agentops/agent/sources/azure_monitor.py +523 -0
  47. agentops/agent/sources/azure_resources.py +602 -0
  48. agentops/agent/sources/foundry_control.py +174 -0
  49. agentops/agent/sources/results_history.py +494 -0
  50. agentops/agent/sources/spec_detectors/__init__.py +42 -0
  51. agentops/agent/sources/spec_detectors/_base.py +58 -0
  52. agentops/agent/sources/spec_detectors/agents_md.py +75 -0
  53. agentops/agent/sources/spec_detectors/spec_kit.py +172 -0
  54. agentops/agent/time_range.py +117 -0
  55. agentops/cli/__init__.py +1 -0
  56. agentops/cli/app.py +4823 -0
  57. agentops/core/__init__.py +1 -0
  58. agentops/core/agentops_config.py +592 -0
  59. agentops/core/config_loader.py +22 -0
  60. agentops/core/evaluators.py +480 -0
  61. agentops/core/release_evidence.py +56 -0
  62. agentops/core/results.py +117 -0
  63. agentops/mcp/__init__.py +10 -0
  64. agentops/mcp/server.py +232 -0
  65. agentops/pipeline/__init__.py +8 -0
  66. agentops/pipeline/cloud_results.py +189 -0
  67. agentops/pipeline/cloud_runner.py +901 -0
  68. agentops/pipeline/comparison.py +108 -0
  69. agentops/pipeline/diagnostics.py +51 -0
  70. agentops/pipeline/invocations.py +535 -0
  71. agentops/pipeline/official_eval.py +414 -0
  72. agentops/pipeline/orchestrator.py +775 -0
  73. agentops/pipeline/prompt_deploy.py +377 -0
  74. agentops/pipeline/publisher.py +121 -0
  75. agentops/pipeline/reporter.py +202 -0
  76. agentops/pipeline/runtime.py +409 -0
  77. agentops/pipeline/thresholds.py +84 -0
  78. agentops/services/__init__.py +1 -0
  79. agentops/services/cicd.py +720 -0
  80. agentops/services/eval_analysis.py +848 -0
  81. agentops/services/evidence_pack.py +757 -0
  82. agentops/services/initializer.py +86 -0
  83. agentops/services/preflight.py +470 -0
  84. agentops/services/setup_wizard.py +709 -0
  85. agentops/services/skills.py +643 -0
  86. agentops/services/trace_promotion.py +300 -0
  87. agentops/services/workflow_analysis.py +1129 -0
  88. agentops/templates/.gitignore +15 -0
  89. agentops/templates/__init__.py +1 -0
  90. agentops/templates/agent-server/Dockerfile +23 -0
  91. agentops/templates/agent-server/README.md +61 -0
  92. agentops/templates/agent-server/main.bicep +94 -0
  93. agentops/templates/agent.yaml +87 -0
  94. agentops/templates/agentops.yaml +58 -0
  95. agentops/templates/foundry.svg +71 -0
  96. agentops/templates/icon.png +0 -0
  97. agentops/templates/pipelines/azuredevops/agentops-deploy-dev-azd.yml +118 -0
  98. agentops/templates/pipelines/azuredevops/agentops-deploy-dev.yml +73 -0
  99. agentops/templates/pipelines/azuredevops/agentops-deploy-prod-azd.yml +141 -0
  100. agentops/templates/pipelines/azuredevops/agentops-deploy-prod.yml +94 -0
  101. agentops/templates/pipelines/azuredevops/agentops-deploy-prompt-agent.yml +167 -0
  102. agentops/templates/pipelines/azuredevops/agentops-deploy-qa-azd.yml +118 -0
  103. agentops/templates/pipelines/azuredevops/agentops-deploy-qa.yml +68 -0
  104. agentops/templates/pipelines/azuredevops/agentops-pr-prompt-agent.yml +210 -0
  105. agentops/templates/pipelines/azuredevops/agentops-pr.yml +155 -0
  106. agentops/templates/pipelines/azuredevops/agentops-watchdog.yml +106 -0
  107. agentops/templates/project.gitignore +36 -0
  108. agentops/templates/sample-traces.jsonl +3 -0
  109. agentops/templates/skills/agentops-agent/SKILL.md +137 -0
  110. agentops/templates/skills/agentops-config/SKILL.md +113 -0
  111. agentops/templates/skills/agentops-dataset/SKILL.md +84 -0
  112. agentops/templates/skills/agentops-eval/SKILL.md +189 -0
  113. agentops/templates/skills/agentops-report/SKILL.md +71 -0
  114. agentops/templates/skills/agentops-workflow/SKILL.md +471 -0
  115. agentops/templates/smoke.jsonl +3 -0
  116. agentops/templates/waf-checklist.README.md +84 -0
  117. agentops/templates/waf-checklist.csv +22 -0
  118. agentops/templates/workflows/agentops-deploy-dev-azd.yml +166 -0
  119. agentops/templates/workflows/agentops-deploy-dev.yml +187 -0
  120. agentops/templates/workflows/agentops-deploy-prod-azd.yml +183 -0
  121. agentops/templates/workflows/agentops-deploy-prod.yml +171 -0
  122. agentops/templates/workflows/agentops-deploy-prompt-agent.yml +197 -0
  123. agentops/templates/workflows/agentops-deploy-qa-azd.yml +156 -0
  124. agentops/templates/workflows/agentops-deploy-qa.yml +145 -0
  125. agentops/templates/workflows/agentops-pr-prompt-agent.yml +210 -0
  126. agentops/templates/workflows/agentops-pr.yml +148 -0
  127. agentops/templates/workflows/agentops-watchdog.yml +122 -0
  128. agentops/utils/__init__.py +1 -0
  129. agentops/utils/azd_env.py +435 -0
  130. agentops/utils/azure_endpoints.py +62 -0
  131. agentops/utils/colors.py +47 -0
  132. agentops/utils/dotenv_loader.py +105 -0
  133. agentops/utils/foundry_discovery.py +229 -0
  134. agentops/utils/logging.py +59 -0
  135. agentops/utils/telemetry.py +554 -0
  136. agentops/utils/yaml.py +36 -0
  137. agentops_accelerator-0.3.0.dist-info/METADATA +278 -0
  138. agentops_accelerator-0.3.0.dist-info/RECORD +142 -0
  139. agentops_accelerator-0.3.0.dist-info/WHEEL +5 -0
  140. agentops_accelerator-0.3.0.dist-info/entry_points.txt +2 -0
  141. agentops_accelerator-0.3.0.dist-info/licenses/LICENSE +21 -0
  142. agentops_accelerator-0.3.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,141 @@
1
+ # AgentOps - Deploy to production with azd (Azure DevOps Pipelines)
2
+ #
3
+ # agentops:deploy-mode=azd
4
+ #
5
+ # RUN_AZD_PROVISION defaults to false for production. Use Azure DevOps
6
+ # Environment approvals before enabling infra changes.
7
+
8
+ trigger:
9
+ branches:
10
+ include:
11
+ - main
12
+
13
+ pr: none
14
+
15
+ pool:
16
+ vmImage: ubuntu-latest
17
+
18
+ variables:
19
+ - group: agentops
20
+ - name: AZURE_SERVICE_CONNECTION
21
+ value: agentops-azure
22
+ - name: AGENTOPS_CONFIG
23
+ value: agentops.yaml
24
+ - name: AZURE_ENV_NAME
25
+ value: production
26
+ - name: RUN_AZD_PROVISION
27
+ value: "false"
28
+
29
+ stages:
30
+ - stage: provision
31
+ displayName: azd environment (production)
32
+ jobs:
33
+ - deployment: azd_provision
34
+ environment: production
35
+ strategy:
36
+ runOnce:
37
+ deploy:
38
+ steps:
39
+ - checkout: self
40
+ - task: AzureCLI@2
41
+ displayName: Prepare azd env and optional provision
42
+ inputs:
43
+ azureSubscription: $(AZURE_SERVICE_CONNECTION)
44
+ scriptType: bash
45
+ scriptLocation: inlineScript
46
+ inlineScript: |
47
+ test -f azure.yaml || {
48
+ echo "##vso[task.logissue type=error;sourcepath=azure.yaml]No azure.yaml found. Ask your coding agent to generate a zero-trust azd deployment, then re-run this pipeline."
49
+ exit 1
50
+ }
51
+ curl -fsSL https://aka.ms/install-azd.sh | bash
52
+ azd env new "$(AZURE_ENV_NAME)" --no-prompt --subscription "$(AZURE_SUBSCRIPTION_ID)" ${AZURE_LOCATION:+--location "$AZURE_LOCATION"} \
53
+ || azd env select "$(AZURE_ENV_NAME)"
54
+ azd env set AZURE_SUBSCRIPTION_ID "$(AZURE_SUBSCRIPTION_ID)"
55
+ if [ -n "$AZURE_LOCATION" ]; then
56
+ azd env set AZURE_LOCATION "$AZURE_LOCATION"
57
+ fi
58
+ if [ "$(RUN_AZD_PROVISION)" = "true" ]; then
59
+ __AILZ_PREFLIGHT_COMMAND__
60
+ azd provision --no-prompt
61
+ else
62
+ echo "Skipping azd provision for production."
63
+ fi
64
+
65
+ - stage: safety_eval
66
+ displayName: AgentOps safety eval (pre-deploy)
67
+ dependsOn: provision
68
+ jobs:
69
+ - job: eval_gate
70
+ steps:
71
+ - checkout: self
72
+ - task: UsePythonVersion@0
73
+ inputs:
74
+ versionSpec: "3.11"
75
+ - bash: |
76
+ python -m pip install --upgrade pip
77
+ python -m pip install "agentops-accelerator[foundry,agent] @ git+https://github.com/Azure/agentops.git@main"
78
+ displayName: Install AgentOps Toolkit
79
+
80
+ __EVAL_TASKS__
81
+
82
+ - task: AzureCLI@2
83
+ displayName: Run AgentOps doctor
84
+ condition: always()
85
+ inputs:
86
+ azureSubscription: $(AZURE_SERVICE_CONNECTION)
87
+ scriptType: bash
88
+ scriptLocation: inlineScript
89
+ inlineScript: |
90
+ agentops doctor --workspace . --out .agentops/agent/report.md \
91
+ --severity-fail critical --evidence-pack
92
+ env:
93
+ AZURE_AI_FOUNDRY_PROJECT_ENDPOINT: $(AZURE_AI_FOUNDRY_PROJECT_ENDPOINT)
94
+ AZURE_OPENAI_ENDPOINT: $(AZURE_OPENAI_ENDPOINT)
95
+ AZURE_OPENAI_DEPLOYMENT: $(AZURE_OPENAI_DEPLOYMENT)
96
+ APPLICATIONINSIGHTS_CONNECTION_STRING: $(APPLICATIONINSIGHTS_CONNECTION_STRING)
97
+ - task: PublishPipelineArtifact@1
98
+ condition: always()
99
+ inputs:
100
+ targetPath: __EVAL_ARTIFACT_TARGET__
101
+ artifact: agentops-deploy-prod-results
102
+ publishLocation: pipeline
103
+
104
+ - task: PublishPipelineArtifact@1
105
+ condition: always()
106
+ inputs:
107
+ targetPath: .agentops/release/latest
108
+ artifact: agentops-deploy-prod-release-evidence
109
+ publishLocation: pipeline
110
+
111
+ - stage: deploy
112
+ displayName: azd deploy (production)
113
+ dependsOn: safety_eval
114
+ jobs:
115
+ - deployment: azd_deploy
116
+ environment: production
117
+ strategy:
118
+ runOnce:
119
+ deploy:
120
+ steps:
121
+ - checkout: self
122
+ - task: AzureCLI@2
123
+ displayName: Run azd deploy
124
+ inputs:
125
+ azureSubscription: $(AZURE_SERVICE_CONNECTION)
126
+ scriptType: bash
127
+ scriptLocation: inlineScript
128
+ inlineScript: |
129
+ curl -fsSL https://aka.ms/install-azd.sh | bash
130
+ test -f azure.yaml || {
131
+ echo "##vso[task.logissue type=error;sourcepath=azure.yaml]No azure.yaml found. Ask your coding agent to generate a zero-trust azd deployment, then re-run this pipeline."
132
+ exit 1
133
+ }
134
+ azd env new "$(AZURE_ENV_NAME)" --no-prompt --subscription "$(AZURE_SUBSCRIPTION_ID)" ${AZURE_LOCATION:+--location "$AZURE_LOCATION"} \
135
+ || azd env select "$(AZURE_ENV_NAME)"
136
+ azd env set AZURE_SUBSCRIPTION_ID "$(AZURE_SUBSCRIPTION_ID)"
137
+ if [ -n "$AZURE_LOCATION" ]; then
138
+ azd env set AZURE_LOCATION "$AZURE_LOCATION"
139
+ fi
140
+ azd env refresh "$(AZURE_ENV_NAME)" --no-prompt
141
+ azd deploy --no-prompt
@@ -0,0 +1,94 @@
1
+ # AgentOps — Deploy to production (Azure DevOps Pipelines)
2
+ #
3
+ # Runs on push to `main`. Executes the AgentOps eval against the
4
+ # production environment and, on PASS, calls `agentops/deploy.sh production`.
5
+ # Production deploys are typically gated by an approval check configured
6
+ # on the `production` Environment in Pipelines → Environments.
7
+ #
8
+ # Generated by `agentops workflow generate --platform azure-devops`.
9
+
10
+ trigger:
11
+ branches:
12
+ include:
13
+ - main
14
+
15
+ pr: none
16
+
17
+ pool:
18
+ vmImage: ubuntu-latest
19
+
20
+ variables:
21
+ - group: agentops
22
+ - name: AZURE_SERVICE_CONNECTION
23
+ value: agentops-azure
24
+ - name: AGENTOPS_CONFIG
25
+ value: agentops.yaml
26
+ - name: TARGET_ENVIRONMENT
27
+ value: production
28
+
29
+ stages:
30
+ - stage: eval
31
+ displayName: AgentOps eval (pre-deploy)
32
+ jobs:
33
+ - deployment: agentops_eval_and_deploy
34
+ displayName: Eval + deploy to $(TARGET_ENVIRONMENT)
35
+ environment: $(TARGET_ENVIRONMENT)
36
+ timeoutInMinutes: 45
37
+ strategy:
38
+ runOnce:
39
+ deploy:
40
+ steps:
41
+ - checkout: self
42
+ fetchDepth: 1
43
+
44
+ - task: UsePythonVersion@0
45
+ displayName: Set up Python 3.11
46
+ inputs:
47
+ versionSpec: "3.11"
48
+
49
+ - bash: |
50
+ python -m pip install --upgrade pip
51
+ python -m pip install "agentops-accelerator[foundry,agent] @ git+https://github.com/Azure/agentops.git@main"
52
+ displayName: Install AgentOps Toolkit
53
+
54
+ __EVAL_TASKS__
55
+
56
+ - task: AzureCLI@2
57
+ displayName: Run AgentOps doctor
58
+ condition: always()
59
+ inputs:
60
+ azureSubscription: $(AZURE_SERVICE_CONNECTION)
61
+ scriptType: bash
62
+ scriptLocation: inlineScript
63
+ inlineScript: |
64
+ agentops doctor --workspace . --out .agentops/agent/report.md \
65
+ --severity-fail critical --evidence-pack
66
+ env:
67
+ AZURE_AI_FOUNDRY_PROJECT_ENDPOINT: $(AZURE_AI_FOUNDRY_PROJECT_ENDPOINT)
68
+ AZURE_OPENAI_ENDPOINT: $(AZURE_OPENAI_ENDPOINT)
69
+ AZURE_OPENAI_DEPLOYMENT: $(AZURE_OPENAI_DEPLOYMENT)
70
+ APPLICATIONINSIGHTS_CONNECTION_STRING: $(APPLICATIONINSIGHTS_CONNECTION_STRING)
71
+
72
+ - task: PublishPipelineArtifact@1
73
+ displayName: Upload AgentOps results
74
+ condition: always()
75
+ inputs:
76
+ targetPath: __EVAL_ARTIFACT_TARGET__
77
+ artifact: agentops-deploy-$(TARGET_ENVIRONMENT)-results
78
+ publishLocation: pipeline
79
+
80
+ - task: PublishPipelineArtifact@1
81
+ displayName: Upload AgentOps release evidence
82
+ condition: always()
83
+ inputs:
84
+ targetPath: .agentops/release/latest
85
+ artifact: agentops-deploy-$(TARGET_ENVIRONMENT)-release-evidence
86
+ publishLocation: pipeline
87
+
88
+ - bash: |
89
+ if [ -x ./agentops/deploy.sh ]; then
90
+ ./agentops/deploy.sh "$(TARGET_ENVIRONMENT)"
91
+ else
92
+ echo "##[warning]No ./agentops/deploy.sh hook found; skipping deploy step."
93
+ fi
94
+ displayName: Deploy to $(TARGET_ENVIRONMENT)
@@ -0,0 +1,167 @@
1
+ # AgentOps - Deploy Foundry prompt agent to __ENV_LABEL__ (Azure DevOps)
2
+ #
3
+ # agentops:deploy-mode=prompt-agent
4
+ #
5
+ # Stages a candidate Foundry prompt-agent version from prompt_file, evaluates
6
+ # that exact candidate, then records it as deployed only after the gate passes.
7
+ #
8
+ # Generated by `agentops workflow generate --platform azure-devops --deploy-mode prompt-agent`.
9
+
10
+ trigger:
11
+ branches:
12
+ include:
13
+ __BRANCHES__
14
+
15
+ pr: none
16
+
17
+ pool:
18
+ vmImage: ubuntu-latest
19
+
20
+ variables:
21
+ - group: agentops
22
+ - name: AZURE_SERVICE_CONNECTION
23
+ value: agentops-azure
24
+ - name: AGENTOPS_CONFIG
25
+ value: agentops.yaml
26
+ - name: TARGET_ENVIRONMENT
27
+ value: __ENV_NAME__
28
+
29
+ stages:
30
+ - stage: stage_candidate
31
+ displayName: Stage Foundry prompt candidate (__ENV_LABEL__)
32
+ jobs:
33
+ - job: stage_candidate
34
+ steps:
35
+ - checkout: self
36
+ fetchDepth: 1
37
+
38
+ - task: UsePythonVersion@0
39
+ displayName: Set up Python 3.11
40
+ inputs:
41
+ versionSpec: "3.11"
42
+
43
+ - task: AzureCLI@2
44
+ displayName: Create candidate agent version from prompt_file
45
+ inputs:
46
+ azureSubscription: $(AZURE_SERVICE_CONNECTION)
47
+ scriptType: bash
48
+ scriptLocation: inlineScript
49
+ inlineScript: |
50
+ python -m pip install --upgrade pip
51
+ python -m pip install "agentops-accelerator[foundry] @ git+https://github.com/Azure/agentops.git@main"
52
+ python -m agentops.pipeline.prompt_deploy stage \
53
+ --config "$(AGENTOPS_CONFIG)" \
54
+ --environment "$(TARGET_ENVIRONMENT)" \
55
+ --out ".agentops/deployments/foundry-agent.json" \
56
+ --eval-config ".agentops/deployments/agentops.candidate.yaml"
57
+ env:
58
+ AZURE_AI_FOUNDRY_PROJECT_ENDPOINT: $(AZURE_AI_FOUNDRY_PROJECT_ENDPOINT)
59
+ AGENTOPS_AGENT_PROMPT_FILE: $(AGENTOPS_AGENT_PROMPT_FILE)
60
+
61
+ - task: PublishPipelineArtifact@1
62
+ displayName: Upload candidate deployment record
63
+ inputs:
64
+ targetPath: .agentops/deployments
65
+ artifact: foundry-agent-__ENV_KEY__-candidate
66
+ publishLocation: pipeline
67
+
68
+ - stage: eval
69
+ displayName: AgentOps eval (__ENV_LABEL__ candidate gate)
70
+ dependsOn: stage_candidate
71
+ jobs:
72
+ - deployment: agentops_eval_and_deploy
73
+ displayName: Eval candidate for $(TARGET_ENVIRONMENT)
74
+ environment: $(TARGET_ENVIRONMENT)
75
+ timeoutInMinutes: 45
76
+ strategy:
77
+ runOnce:
78
+ deploy:
79
+ steps:
80
+ - checkout: self
81
+ fetchDepth: 1
82
+
83
+ - task: DownloadPipelineArtifact@2
84
+ displayName: Download candidate deployment record
85
+ inputs:
86
+ artifact: foundry-agent-__ENV_KEY__-candidate
87
+ path: .agentops/deployments
88
+
89
+ - task: UsePythonVersion@0
90
+ displayName: Set up Python 3.11
91
+ inputs:
92
+ versionSpec: "3.11"
93
+
94
+ - bash: |
95
+ python -m pip install --upgrade pip
96
+ python -m pip install "agentops-accelerator[foundry,agent] @ git+https://github.com/Azure/agentops.git@main"
97
+ displayName: Install AgentOps Toolkit
98
+
99
+ __EVAL_TASKS__
100
+
101
+ - task: AzureCLI@2
102
+ displayName: Run AgentOps doctor
103
+ condition: always()
104
+ inputs:
105
+ azureSubscription: $(AZURE_SERVICE_CONNECTION)
106
+ scriptType: bash
107
+ scriptLocation: inlineScript
108
+ inlineScript: |
109
+ agentops doctor --workspace . --out .agentops/agent/report.md \
110
+ --severity-fail critical --evidence-pack
111
+ env:
112
+ AZURE_AI_FOUNDRY_PROJECT_ENDPOINT: $(AZURE_AI_FOUNDRY_PROJECT_ENDPOINT)
113
+ AZURE_OPENAI_ENDPOINT: $(AZURE_OPENAI_ENDPOINT)
114
+ AZURE_OPENAI_DEPLOYMENT: $(AZURE_OPENAI_DEPLOYMENT)
115
+ APPLICATIONINSIGHTS_CONNECTION_STRING: $(APPLICATIONINSIGHTS_CONNECTION_STRING)
116
+
117
+ - task: PublishPipelineArtifact@1
118
+ displayName: Upload AgentOps results
119
+ condition: always()
120
+ inputs:
121
+ targetPath: __EVAL_ARTIFACT_TARGET__
122
+ artifact: agentops-deploy-__ENV_KEY__-results
123
+ publishLocation: pipeline
124
+
125
+ - task: PublishPipelineArtifact@1
126
+ displayName: Upload AgentOps release evidence
127
+ condition: always()
128
+ inputs:
129
+ targetPath: .agentops/release/latest
130
+ artifact: agentops-deploy-__ENV_KEY__-release-evidence
131
+ publishLocation: pipeline
132
+
133
+ - stage: deploy
134
+ displayName: Record Foundry prompt deploy (__ENV_LABEL__)
135
+ dependsOn: eval
136
+ jobs:
137
+ - deployment: foundry_prompt_deploy
138
+ displayName: Record candidate as deployed to $(TARGET_ENVIRONMENT)
139
+ environment: $(TARGET_ENVIRONMENT)
140
+ strategy:
141
+ runOnce:
142
+ deploy:
143
+ steps:
144
+ - task: DownloadPipelineArtifact@2
145
+ displayName: Download candidate deployment record
146
+ inputs:
147
+ artifact: foundry-agent-__ENV_KEY__-candidate
148
+ path: .agentops/deployments
149
+
150
+ - task: UsePythonVersion@0
151
+ displayName: Set up Python 3.11
152
+ inputs:
153
+ versionSpec: "3.11"
154
+
155
+ - bash: |
156
+ python -m pip install "agentops-accelerator @ git+https://github.com/Azure/agentops.git@main"
157
+ python -m agentops.pipeline.prompt_deploy summarize \
158
+ --deployment ".agentops/deployments/foundry-agent.json" \
159
+ --environment "$(TARGET_ENVIRONMENT)"
160
+ displayName: Mark candidate as deployed
161
+
162
+ - task: PublishPipelineArtifact@1
163
+ displayName: Upload Foundry deployment record
164
+ inputs:
165
+ targetPath: .agentops/deployments/foundry-agent.json
166
+ artifact: foundry-agent-__ENV_KEY__-deployment
167
+ publishLocation: pipeline
@@ -0,0 +1,118 @@
1
+ # AgentOps - Deploy to qa with azd (Azure DevOps Pipelines)
2
+ #
3
+ # agentops:deploy-mode=azd
4
+ #
5
+ # RUN_AZD_PROVISION defaults to false for QA. Set it to true only for
6
+ # reviewed infrastructure changes.
7
+
8
+ trigger:
9
+ branches:
10
+ include:
11
+ - release/*
12
+
13
+ pr: none
14
+
15
+ pool:
16
+ vmImage: ubuntu-latest
17
+
18
+ variables:
19
+ - group: agentops
20
+ - name: AZURE_SERVICE_CONNECTION
21
+ value: agentops-azure
22
+ - name: AGENTOPS_CONFIG
23
+ value: agentops.yaml
24
+ - name: AZURE_ENV_NAME
25
+ value: qa
26
+ - name: RUN_AZD_PROVISION
27
+ value: "false"
28
+
29
+ stages:
30
+ - stage: provision
31
+ displayName: azd environment (qa)
32
+ jobs:
33
+ - deployment: azd_provision
34
+ environment: qa
35
+ strategy:
36
+ runOnce:
37
+ deploy:
38
+ steps:
39
+ - checkout: self
40
+ - task: AzureCLI@2
41
+ displayName: Prepare azd env and optional provision
42
+ inputs:
43
+ azureSubscription: $(AZURE_SERVICE_CONNECTION)
44
+ scriptType: bash
45
+ scriptLocation: inlineScript
46
+ inlineScript: |
47
+ test -f azure.yaml || {
48
+ echo "##vso[task.logissue type=error;sourcepath=azure.yaml]No azure.yaml found. Ask your coding agent to generate a zero-trust azd deployment, then re-run this pipeline."
49
+ exit 1
50
+ }
51
+ curl -fsSL https://aka.ms/install-azd.sh | bash
52
+ azd env new "$(AZURE_ENV_NAME)" --no-prompt --subscription "$(AZURE_SUBSCRIPTION_ID)" ${AZURE_LOCATION:+--location "$AZURE_LOCATION"} \
53
+ || azd env select "$(AZURE_ENV_NAME)"
54
+ azd env set AZURE_SUBSCRIPTION_ID "$(AZURE_SUBSCRIPTION_ID)"
55
+ if [ -n "$AZURE_LOCATION" ]; then
56
+ azd env set AZURE_LOCATION "$AZURE_LOCATION"
57
+ fi
58
+ if [ "$(RUN_AZD_PROVISION)" = "true" ]; then
59
+ __AILZ_PREFLIGHT_COMMAND__
60
+ azd provision --no-prompt
61
+ else
62
+ echo "Skipping azd provision for QA."
63
+ fi
64
+
65
+ - stage: eval
66
+ displayName: AgentOps eval (pre-deploy)
67
+ dependsOn: provision
68
+ jobs:
69
+ - job: eval_gate
70
+ steps:
71
+ - checkout: self
72
+ - task: UsePythonVersion@0
73
+ inputs:
74
+ versionSpec: "3.11"
75
+ - bash: |
76
+ python -m pip install --upgrade pip
77
+ python -m pip install "agentops-accelerator[foundry] @ git+https://github.com/Azure/agentops.git@main"
78
+ displayName: Install AgentOps Toolkit
79
+
80
+ __EVAL_TASKS__
81
+ - task: PublishPipelineArtifact@1
82
+ condition: always()
83
+ inputs:
84
+ targetPath: __EVAL_ARTIFACT_TARGET__
85
+ artifact: agentops-deploy-qa-results
86
+ publishLocation: pipeline
87
+
88
+ - stage: deploy
89
+ displayName: azd deploy (qa)
90
+ dependsOn: eval
91
+ jobs:
92
+ - deployment: azd_deploy
93
+ environment: qa
94
+ strategy:
95
+ runOnce:
96
+ deploy:
97
+ steps:
98
+ - checkout: self
99
+ - task: AzureCLI@2
100
+ displayName: Run azd deploy
101
+ inputs:
102
+ azureSubscription: $(AZURE_SERVICE_CONNECTION)
103
+ scriptType: bash
104
+ scriptLocation: inlineScript
105
+ inlineScript: |
106
+ curl -fsSL https://aka.ms/install-azd.sh | bash
107
+ test -f azure.yaml || {
108
+ echo "##vso[task.logissue type=error;sourcepath=azure.yaml]No azure.yaml found. Ask your coding agent to generate a zero-trust azd deployment, then re-run this pipeline."
109
+ exit 1
110
+ }
111
+ azd env new "$(AZURE_ENV_NAME)" --no-prompt --subscription "$(AZURE_SUBSCRIPTION_ID)" ${AZURE_LOCATION:+--location "$AZURE_LOCATION"} \
112
+ || azd env select "$(AZURE_ENV_NAME)"
113
+ azd env set AZURE_SUBSCRIPTION_ID "$(AZURE_SUBSCRIPTION_ID)"
114
+ if [ -n "$AZURE_LOCATION" ]; then
115
+ azd env set AZURE_LOCATION "$AZURE_LOCATION"
116
+ fi
117
+ azd env refresh "$(AZURE_ENV_NAME)" --no-prompt
118
+ azd deploy --no-prompt
@@ -0,0 +1,68 @@
1
+ # AgentOps — Deploy to qa (Azure DevOps Pipelines)
2
+ #
3
+ # Runs on push to `release/*`. Executes the AgentOps eval against the qa
4
+ # environment and, on PASS, calls `agentops/deploy.sh qa`.
5
+ #
6
+ # Generated by `agentops workflow generate --platform azure-devops`.
7
+
8
+ trigger:
9
+ branches:
10
+ include:
11
+ - release/*
12
+
13
+ pr: none
14
+
15
+ pool:
16
+ vmImage: ubuntu-latest
17
+
18
+ variables:
19
+ - group: agentops
20
+ - name: AZURE_SERVICE_CONNECTION
21
+ value: agentops-azure
22
+ - name: AGENTOPS_CONFIG
23
+ value: agentops.yaml
24
+ - name: TARGET_ENVIRONMENT
25
+ value: qa
26
+
27
+ stages:
28
+ - stage: eval
29
+ displayName: AgentOps eval (pre-deploy)
30
+ jobs:
31
+ - deployment: agentops_eval_and_deploy
32
+ displayName: Eval + deploy to $(TARGET_ENVIRONMENT)
33
+ environment: $(TARGET_ENVIRONMENT)
34
+ timeoutInMinutes: 45
35
+ strategy:
36
+ runOnce:
37
+ deploy:
38
+ steps:
39
+ - checkout: self
40
+ fetchDepth: 1
41
+
42
+ - task: UsePythonVersion@0
43
+ displayName: Set up Python 3.11
44
+ inputs:
45
+ versionSpec: "3.11"
46
+
47
+ - bash: |
48
+ python -m pip install --upgrade pip
49
+ python -m pip install "agentops-accelerator[foundry] @ git+https://github.com/Azure/agentops.git@main"
50
+ displayName: Install AgentOps Toolkit
51
+
52
+ __EVAL_TASKS__
53
+
54
+ - task: PublishPipelineArtifact@1
55
+ displayName: Upload AgentOps results
56
+ condition: always()
57
+ inputs:
58
+ targetPath: __EVAL_ARTIFACT_TARGET__
59
+ artifact: agentops-deploy-$(TARGET_ENVIRONMENT)-results
60
+ publishLocation: pipeline
61
+
62
+ - bash: |
63
+ if [ -x ./agentops/deploy.sh ]; then
64
+ ./agentops/deploy.sh "$(TARGET_ENVIRONMENT)"
65
+ else
66
+ echo "##[warning]No ./agentops/deploy.sh hook found; skipping deploy step."
67
+ fi
68
+ displayName: Deploy to $(TARGET_ENVIRONMENT)