Skip to content

Commit 8211a9e

Browse files
WanWan
authored andcommitted
feat: add Azure DevOps enterprise integration support
Add support for Azure DevOps as an enterprise identity provider with automatic organization discovery. The integration uses Azure AD app registration for authentication and automatically discovers user organizations via the Azure DevOps Accounts API. Changes: - Add azureDevOps configuration to values.yaml with tenant ID and secret support - Add Azure DevOps environment variables and keycloak configuration - Add ingress route for Azure DevOps integration endpoint - Update README with Azure DevOps setup instructions including secret configuration - Use auto-discovery for organizations instead of manual configuration
1 parent 0048743 commit 8211a9e

File tree

6 files changed

+62
-2
lines changed

6 files changed

+62
-2
lines changed

charts/openhands/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
description: OpenHands is an AI-driven autonomous software engineer
33
name: openhands
44
appVersion: 0.54.2
5-
version: 0.1.33
5+
version: 0.1.34
66
maintainers:
77
- name: rbren
88
- name: xingyao

charts/openhands/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,36 @@ authentication as well.
245245
enabled: true
246246
```
247247

248+
#### Azure DevOps
249+
250+
1. Create an Azure AD App Registration:
251+
252+
- Go to the Azure Portal > Azure Active Directory > App registrations > New registration
253+
- Set the "Redirect URI" to `https://auth.openhands.example.com/realms/allhands/broker/azuredevops/endpoint`
254+
- Under "Certificates & secrets", create a new client secret
255+
- Under "API permissions", add the following permissions for Azure DevOps (if using delegated permissions): vso.code_write, vso.work_write, vso.identity, vso.profile, vso.project
256+
- Note the Application (client) ID, Directory (tenant) ID, and Client Secret
257+
258+
2. Create an Azure DevOps App secret:
259+
260+
```bash
261+
kubectl create secret generic azuredevops-app -n openhands \
262+
--from-literal=client-id=<your-azure-ad-client-id> \
263+
--from-literal=client-secret=<your-azure-ad-client-secret>
264+
```
265+
266+
3. Update site-values.yaml file:
267+
268+
```yaml
269+
azureDevOps:
270+
enabled: true
271+
# For single-tenant apps, set your Azure AD tenant ID
272+
# For multi-tenant apps, leave empty or set to "common"
273+
tenantId: "<your-tenant-id-or-empty>"
274+
auth:
275+
existingSecret: azuredevops-app
276+
```
277+
248278
When the chart is deployed, a job will run to configure the Keycloak realm with the identity provider credentials you provided.
249279

250280
### Install OpenHands

charts/openhands/templates/_env.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,20 @@
180180
name: {{ .Values.bitbucket.auth.existingSecret }}
181181
key: client-secret
182182
{{- end }}
183+
{{- if .Values.azureDevOps.enabled }}
184+
- name: AZURE_DEVOPS_APP_CLIENT_ID
185+
valueFrom:
186+
secretKeyRef:
187+
name: {{ .Values.azureDevOps.auth.existingSecret }}
188+
key: client-id
189+
- name: AZURE_DEVOPS_APP_CLIENT_SECRET
190+
valueFrom:
191+
secretKeyRef:
192+
name: {{ .Values.azureDevOps.auth.existingSecret }}
193+
key: client-secret
194+
- name: AZURE_DEVOPS_TENANT_ID
195+
value: {{ .Values.azureDevOps.tenantId | quote }}
196+
{{- end }}
183197
{{- if and .Values.litellm.enabled .Values.litellm.useDependentInstall }}
184198
- name: LITE_LLM_API_URL
185199
value: http://{{ .Release.Name }}-litellm

charts/openhands/templates/ingress-integrations.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ spec:
4343
name: openhands-integrations-service
4444
port:
4545
number: 3000
46+
- path: /integration/azure-devops/events
47+
pathType: Exact
48+
backend:
49+
service:
50+
name: openhands-integrations-service
51+
port:
52+
number: 3000
4653
- path: /integration/jira/events
4754
pathType: Exact
4855
backend:

charts/openhands/templates/keycloak-config-script.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ data:
9090
fi
9191
if [ "$ERROR_MESSAGE" = "Realm not found." ]; then
9292
echo "Creating allhands realm..."
93-
envsubst '$WEB_HOST,$AUTH_WEB_HOST,$KEYCLOAK_REALM_NAME,$KEYCLOAK_PROVIDER_NAME,$KEYCLOAK_CLIENT_ID,$KEYCLOAK_CLIENT_SECRET,$GITHUB_APP_CLIENT_ID,$GITHUB_APP_CLIENT_SECRET,$GITLAB_APP_CLIENT_ID,$GITLAB_APP_CLIENT_SECRET,$BITBUCKET_APP_CLIENT_ID,$BITBUCKET_APP_CLIENT_SECRET,$GITHUB_BASE_URL,$KEYCLOAK_SMTP_PASSWORD'< /app/allhands-realm-github-provider.json.tmpl > /app/allhands-realm-github-provider.json
93+
envsubst '$WEB_HOST,$AUTH_WEB_HOST,$KEYCLOAK_REALM_NAME,$KEYCLOAK_PROVIDER_NAME,$KEYCLOAK_CLIENT_ID,$KEYCLOAK_CLIENT_SECRET,$GITHUB_APP_CLIENT_ID,$GITHUB_APP_CLIENT_SECRET,$GITLAB_APP_CLIENT_ID,$GITLAB_APP_CLIENT_SECRET,$BITBUCKET_APP_CLIENT_ID,$BITBUCKET_APP_CLIENT_SECRET,$AZURE_DEVOPS_APP_CLIENT_ID,$AZURE_DEVOPS_APP_CLIENT_SECRET,$GITHUB_BASE_URL,$KEYCLOAK_SMTP_PASSWORD'< /app/allhands-realm-github-provider.json.tmpl > /app/allhands-realm-github-provider.json
9494
keycloak_api_call "curl -s -X POST \"$KEYCLOAK_SERVER_URL/admin/realms\" -H \"Authorization: Bearer $ACCESS_TOKEN\" -H \"Content-Type: application/json\" --data \"@/app/allhands-realm-github-provider.json\""
9595
echo "Created allhands realm."
9696
fi

charts/openhands/values.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ appConfig:
1313
OPENHANDS_GITHUB_SERVICE_CLS: "integrations.github.github_service.SaaSGitHubService"
1414
OPENHANDS_GITLAB_SERVICE_CLS: "integrations.gitlab.gitlab_service.SaaSGitLabService"
1515
OPENHANDS_BITBUCKET_SERVICE_CLS: "integrations.bitbucket.bitbucket_service.SaaSBitBucketService"
16+
OPENHANDS_AZURE_DEVOPS_SERVICE_CLS: "integrations.azure_devops.azure_devops_service.SaaSAzureDevOpsService"
1617
OPENHANDS_MCP_CONFIG_CLS: "server.mcp.mcp_config.SaaSOpenHandsMCPConfig"
1718
OPENHANDS_EXPERIMENT_MANAGER_CLS: "experiments.experiment_manager.SaaSExperimentManager"
1819
POSTHOG_CLIENT_KEY: "1234abcd"
@@ -597,6 +598,14 @@ jiraDc:
597598
linear:
598599
enabled: false
599600

601+
azureDevOps:
602+
enabled: false
603+
# Azure AD tenant ID for single-tenant app authentication
604+
# Leave empty or set to "common" for multi-tenant apps
605+
tenantId: ""
606+
auth:
607+
existingSecret: azuredevops-app
608+
600609
global:
601610
security:
602611
# This allows using the bitnamilegacy image repo.

0 commit comments

Comments
 (0)