-
Notifications
You must be signed in to change notification settings - Fork 85
Catalog: Azure DevOps Integration #3647
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 25 commits
4eb4fa8
a0da190
b3cb0ff
75307df
b215d1a
7e70121
e9757c5
2638024
ba93868
a1ad51f
ef19647
378d4e1
cc03e13
e3c7631
f6a3a61
bfefb44
d298bf6
00cc00c
0dbbb43
b496950
e14c887
ade3d26
259c40a
738f5e1
cba77e7
07873d3
c897c32
7b80514
6472fac
93cb9cf
d6b1190
42c46da
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,153 @@ | ||
| --- | ||
| title: Connect Azure DevOps repositories to Catalog with the {{site.konnect_short_name}} API | ||
| content_type: how_to | ||
| description: Learn how to connect Azure DevOps repositories to your {{site.konnect_catalog}} services in {{site.konnect_short_name}} using the Konnect API. | ||
| products: | ||
| - catalog | ||
| works_on: | ||
| - konnect | ||
| tools: | ||
| - konnect-api | ||
| tags: | ||
| - integrations | ||
|
|
||
| search_aliases: | ||
| - azure repos | ||
| - devops | ||
| - service catalog | ||
| related_resources: | ||
| - text: "{{site.konnect_catalog}}" | ||
| url: /catalog/ | ||
| - text: Integrations | ||
| url: /catalog/integrations/ | ||
| - text: Azure DevOps reference | ||
| url: /catalog/integrations/azure-devops/ | ||
| - text: "Connect Azure DevOps repositories to Catalog with the Konnect UI" | ||
| url: /how-to/connect-azure-devops-with-konnect-ui/ | ||
| automated_tests: false | ||
| tldr: | ||
| q: How do I connect Azure DevOps to {{site.konnect_short_name}} using the API? | ||
| a: Use the Konnect Integrations API to create and authorize an Azure DevOps integration instance with your organization name and PAT, then map an ingested repository to a {{site.konnect_catalog}} service. | ||
| prereqs: | ||
| inline: | ||
| - title: "{{site.konnect_short_name}} roles" | ||
| include_content: prereqs/service-catalog-integration-role | ||
| icon_url: /assets/icons/kogo-white.svg | ||
| - title: Create and configure an Azure account | ||
| content: | | ||
| 1. You need to configure the following in Azure DevOps: | ||
| - An [Azure DevOps account](https://azure.microsoft.com/en-gb/pricing/purchase-options/azure-account?icid=devops). | ||
| - An [Azure DevOps personal access token (PAT)](https://learn.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops&tabs=Windows) with `Code:Read` permission. | ||
|
|
||
| {:.warning} | ||
| > Your PAT can be created with an expiration period of your choice, up to a maximum of one year. Make sure to renew the PAT before it expires to avoid interruptions. | ||
|
|
||
| 1. Set the personal access token as an environment variable: | ||
| ```sh | ||
| export AZUREDEVOPS_PAT='YOUR-AZURE-DEV-OPS-PERSONAL-ACCESS-TOKEN' | ||
| ``` | ||
| --- | ||
|
|
||
| ## Configure the Azure DevOps integration | ||
|
|
||
| Before you can discover Azure DevOps repositories in {{site.konnect_catalog}}, export your Azure DevOps organization name exactly as it appears in Azure DevOps: | ||
|
|
||
| ```sh | ||
| export AZURE_DEVOPS_ORG_NAME="YOUR-ORG-NAME" | ||
| ``` | ||
|
|
||
| Now, configure the integration: | ||
|
|
||
| {% konnect_api_request %} | ||
| url: /v1/integration-instances | ||
| status_code: 201 | ||
| method: POST | ||
| body: | ||
| integration_name: "azure-devops" | ||
|
Check failure on line 66 in app/_how-tos/connect-azure-devops-to-the-konnect-catalog-with-the-konnect-api.md
|
||
| name: "azure-devops" | ||
| display_name: "Azure DevOps" | ||
|
Check failure on line 68 in app/_how-tos/connect-azure-devops-to-the-konnect-catalog-with-the-konnect-api.md
|
||
| config: | ||
| organization: "$AZURE_DEVOPS_ORG_NAME" | ||
| extract_body: | ||
|
Check failure on line 71 in app/_how-tos/connect-azure-devops-to-the-konnect-catalog-with-the-konnect-api.md
|
||
| - name: 'id' | ||
| variable: AZUREDEVOPS_INTEGRATION_ID | ||
| capture: AZUREDEVOPS_INTEGRATION_ID | ||
| jq: ".id" | ||
| {% endkonnect_api_request %} | ||
|
|
||
| Next, authorize the integration with your Azure DevOps PAT: | ||
|
|
||
| {% konnect_api_request %} | ||
| url: /v1/integration-instances/$AZUREDEVOPS_INTEGRATION_ID/auth-credential | ||
| status_code: 201 | ||
| method: POST | ||
| body: | ||
| type: multi_key_auth | ||
|
Check failure on line 85 in app/_how-tos/connect-azure-devops-to-the-konnect-catalog-with-the-konnect-api.md
|
||
| config: | ||
| headers: | ||
| - name: authorization | ||
| key: $AZUREDEVOPS_PAT | ||
| {% endkonnect_api_request %} | ||
|
|
||
| Once authorized, resources from your Azure DevOps account are discoverable in the UI. | ||
|
|
||
| ## Create a Service in Catalog | ||
|
|
||
| Create a service to map to your Azure DevOps resources: | ||
|
|
||
| {% konnect_api_request %} | ||
| url: /v1/catalog-services | ||
| status_code: 201 | ||
| method: POST | ||
| body: | ||
| name: "user-service" | ||
| display_name: "User Service" | ||
|
Check failure on line 104 in app/_how-tos/connect-azure-devops-to-the-konnect-catalog-with-the-konnect-api.md
|
||
| extract_body: | ||
|
Check failure on line 105 in app/_how-tos/connect-azure-devops-to-the-konnect-catalog-with-the-konnect-api.md
|
||
| - name: 'id' | ||
| variable: AZUREDEVOPS_SERVICE_ID | ||
| capture: AZUREDEVOPS_SERVICE_ID | ||
| jq: ".id" | ||
| {% endkonnect_api_request %} | ||
|
|
||
| ## List Azure DevOps resources | ||
|
|
||
| Before you map Azure DevOps resources to a service in Catalog, locate the resources that {{site.konnect_short_name}} ingests from Azure DevOps: | ||
|
|
||
| {% konnect_api_request %} | ||
| url: /v1/resources?filter%5Bintegration.name%5D=azure-devops | ||
| status_code: 200 | ||
| method: GET | ||
| extract_body: | ||
|
Check failure on line 120 in app/_how-tos/connect-azure-devops-to-the-konnect-catalog-with-the-konnect-api.md
|
||
| - name: 'id' | ||
| variable: AZUREDEVOPS_RESOURCE_ID | ||
| capture: AZUREDEVOPS_RESOURCE_ID | ||
| jq: ".data[0].id" | ||
| {% endkonnect_api_request %} | ||
|
|
||
| If you don't immediately see resources, try manually syncing your Azure DevOps integration. From the {{site.konnect_short_name}} UI, navigate to the Azure DevOps integration that you just installed. Then, from the **Actions** dropdown menu, select **Sync Now**. | ||
|
|
||
| {:.info} | ||
| > {{site.konnect_short_name}} uses the first resource in the list when you run this command. To select a different resource, replace `.data[0].id` in the `jq` filter with the index of the resource you want to use or manually specify the resource ID. | ||
|
|
||
| ## Map resources to a service | ||
|
|
||
| Now, map the Azure DevOps resource to the service: | ||
|
|
||
| {% konnect_api_request %} | ||
| url: /v1/resource-mappings | ||
| status_code: 201 | ||
| method: POST | ||
| body: | ||
| service: $AZUREDEVOPS_SERVICE_ID | ||
| resource: $AZUREDEVOPS_RESOURCE_ID | ||
| {% endkonnect_api_request %} | ||
|
|
||
| ## Validate the mapping | ||
|
|
||
| To confirm that the Azure DevOps resource is now mapped to the intended service, list the service’s mapped resources: | ||
|
|
||
| {% konnect_api_request %} | ||
| url: /v1/catalog-services/$AZUREDEVOPS_SERVICE_ID/resources | ||
| status_code: 200 | ||
| method: GET | ||
| {% endkonnect_api_request %} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| --- | ||
| title: Connect Azure DevOps repositories to Catalog with the {{site.konnect_short_name}} UI | ||
| content_type: how_to | ||
| description: Learn how to connect Azure DevOps repositories to your {{site.konnect_catalog}} services in {{site.konnect_short_name}} using the UI. | ||
| products: | ||
| - catalog | ||
| works_on: | ||
| - konnect | ||
| tags: | ||
| - integrations | ||
| search_aliases: | ||
| - devops | ||
| - azure repos | ||
| - service catalog | ||
| related_resources: | ||
| - text: "{{site.konnect_catalog}}" | ||
| url: /catalog/ | ||
| - text: Integrations | ||
| url: /catalog/integrations/ | ||
| - text: Azure DevOps reference | ||
| url: /catalog/integrations/azure-devops/ | ||
| - text: "Connect Azure DevOps repositories to Catalog with the Konnect API" | ||
| url: /how-to/connect-azure-devops-with-konnect-api/ | ||
| automated_tests: false | ||
| tldr: | ||
| q: How do I connect an Azure DevOps repository to a service in {{site.konnect_short_name}}? | ||
| a: Configure the Azure DevOps integration with your organization name and PAT, create a {{site.konnect_catalog}} service, then map the discovered Azure DevOps repository resource to that {{site.konnect_catalog}} service. | ||
| prereqs: | ||
| inline: | ||
| - title: "{{site.konnect_short_name}} roles" | ||
| include_content: prereqs/service-catalog-integration-role | ||
| icon_url: /assets/icons/kogo-white.svg | ||
| - title: Create and configure an Azure account | ||
| content: | | ||
| You need to configure the following in Azure DevOps: | ||
| - An [Azure DevOps account](https://azure.microsoft.com/en-gb/pricing/purchase-options/azure-account?icid=devops). | ||
| - An [Azure DevOps personal access token (PAT)](https://learn.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops&tabs=Windows) with `Code: Read` permission. | ||
|
|
||
| {:.warning} | ||
| > Your PAT can be created with an expiration period of your choice, up to a maximum of one year. Make sure to renew the PAT before it expires to avoid interruptions. | ||
| --- | ||
|
|
||
| ## Configure the Azure DevOps integration | ||
|
|
||
| Before you can discover Azure DevOps repositories in {{site.konnect_catalog}}, you must configure the integration: | ||
|
|
||
| 1. In the {{site.konnect_short_name}} sidebar, click **Catalog**. | ||
| 1. In the {{site.konnect_catalog}} sidebar, click **Integrations**. | ||
| 1. Click **Azure DevOps**. | ||
| 1. Click **Add Azure DevOps instance**. | ||
Guaris marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 1. In the **Azure DevOps organization name** field, enter your organization name exactly as it appears in Azure DevOps. | ||
| 1. In the **Azure DevOps personal access token (PAT)** field, enter your Azure DevOps token. | ||
| 1. In the **Display name** field, enter `azure-devops-repository-service`. | ||
| 1. In the **Instance name** field, enter `azure-devops-repository-service`. | ||
| 1. (Optional) In the **Description** field, enter a description for this instance. | ||
TuannasCodeCatastrophe marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 1. Click **Save**. | ||
|
|
||
| If you don't immediately see resources, try manually syncing your Azure DevOps integration. From the {{site.konnect_short_name}} UI, navigate to the Azure DevOps integration that you just installed. Then, from the **Actions** dropdown menu, select **Sync Now**. | ||
|
|
||
| ## Create a {{site.konnect_catalog}} service and map the Azure DevOps resources | ||
|
|
||
| After you configure the Azure DevOps integration, create a service in {{site.konnect_catalog}} and map an Azure DevOps repository resource to it. This links your {{site.konnect_catalog}} service to its source code location in Azure DevOps. | ||
|
|
||
| {:.info} | ||
| > In this tutorial, we’ll refer to your Azure DevOps repository as `azure-devops-repository`. | ||
|
|
||
| 1. In the {{site.konnect_short_name}} sidebar, click **Catalog**. | ||
| 1. In the {{site.konnect_catalog}} sidebar, click **Services**. | ||
| 1. Click **New service**. | ||
| 1. In the **Display Name** field, enter `azure-devops-repository-service`. | ||
| 1. Click **Create**. | ||
| 1. Click **Map Resources**. | ||
| 1. Select the `azure-devops-repository` checkbox. | ||
| 1. Click **Map 1 Resource**. | ||
|
|
||
| ## Validate the mapping | ||
| To confirm that the Azure DevOps resource is now mapped to the intended service, navigate to the new service: | ||
| 1. In the {{site.konnect_short_name}} sidebar, click **Catalog**. | ||
| 1. In the {{site.konnect_catalog}} sidebar, click **Services**. | ||
| 1. Click the `azure-devops-repository-service` service. | ||
| 1. Click the **Resources** tab. | ||
|
|
||
| You'll see the `azure-devops-repository-service` resource listed. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,131 @@ | ||
| --- | ||
| title: "Azure DevOps" | ||
| content_type: reference | ||
| layout: reference | ||
| icon: /assets/icons/azure-devops.svg | ||
|
|
||
| products: | ||
| - catalog | ||
| - gateway | ||
|
|
||
| tags: | ||
| - integrations | ||
|
|
||
| search_aliases: | ||
| - service catalog | ||
| breadcrumbs: | ||
| - /catalog/ | ||
| - /catalog/integrations/ | ||
|
|
||
| discovery_support: true | ||
|
|
||
| works_on: | ||
| - konnect | ||
| description: "description: Provides information about the Azure DevOps integration, which lets the Konnect {{site.konnect_catalog}} read repository metadata from Azure DevOps and use it for service mapping and governance workflows." | ||
|
|
||
|
|
||
| related_resources: | ||
| - text: "{{site.konnect_catalog}}" | ||
| url: /catalog/ | ||
| - text: "Connect Azure DevOps repositories to Catalog with the Konnect API" | ||
| url: /how-to/connect-azure-devops-to-the-konnect-catalog-with-the-konnect-api/ | ||
| - text: "Connect Azure DevOps repositories to Catalog with the Konnect UI" | ||
| url: /how-to/connect-azure-devops-to-the-konnect-catalog-with-the-konnect-ui/ | ||
| --- | ||
|
|
||
| The Azure DevOps integration lets Konnect {{site.konnect_catalog}} securely read and ingest repository metadata from Azure DevOps using a PAT with `Code:Read` access. Teams can reference and manage their source-code assets inside {{site.konnect_catalog}} and prepare for future governance and scorecard workflows. | ||
|
|
||
| For a complete tutorial, choose one of the following: | ||
| - [Connect Azure DevOps repositories to Catalog with the Konnect API](/how-to/connect-azure-devops-to-the-konnect-catalog-with-the-konnect-api/) | ||
| - [Connect Azure DevOps repositories to Catalog with the Konnect UI](/how-to/connect-azure-devops-to-the-konnect-catalog-with-the-konnect-ui/) | ||
|
|
||
| ### Prerequisites | ||
| You need to configure the following: | ||
| - An [Azure DevOps account](https://azure.microsoft.com/en-gb/pricing/purchase-options/azure-account?icid=devops). | ||
| - An [Azure DevOps personal access token (PAT)](https://learn.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops&tabs=Windows) with `Code:Read` permission. | ||
|
|
||
| ### Authenticate the Azure DevOps integration | ||
| {% navtabs "azure-devops-integration" %} | ||
| {% navtab "UI" %} | ||
|
|
||
| 1. In the Konnect sidebar, click **Catalog**. | ||
| 1. In the {{site.konnect_catalog}} sidebar, click **Integrations**. | ||
| 1. Click **Azure DevOps**. | ||
| 1. Click **Add Azure DevOps instance**. | ||
| 1. In the **Azure DevOps organization name** field, enter your organization name exactly as it is in Azure DevOps. | ||
| 1. In the **Azure DevOps personal access token (PAT)** field, enter your Azure DevOps token. | ||
| 1. (Optional) In the **Description** field, enter a description for this instance. | ||
| 1. Click **Save**. | ||
|
|
||
| {% endnavtab %} | ||
| {% navtab "API" %} | ||
|
|
||
| Before you can discover Azure DevOps repositories in {{site.konnect_catalog}}, export your Azure organization name exactly as it appears in Azure DevOps: | ||
|
|
||
| ```sh | ||
| export AZURE_ORG_NAME="YOUR-ORG-NAME" | ||
| ``` | ||
|
|
||
| Now, configure the integration: | ||
|
|
||
| {% konnect_api_request %} | ||
| url: /v1/integration-instances | ||
| status_code: 201 | ||
| method: POST | ||
| body: | ||
| integration_name: "azure-devops" | ||
|
Check failure on line 76 in app/catalog/integrations/azure-devops.md
|
||
| name: "azure-devops" | ||
| display_name: "Azure DevOps" | ||
|
Check failure on line 78 in app/catalog/integrations/azure-devops.md
|
||
| config: | ||
| organization: "$AZURE_ORG_NAME" | ||
| extract_body: | ||
| - name: 'id' | ||
| variable: AZUREDEVOPS_INTEGRATION_ID | ||
| capture: AZUREDEVOPS_INTEGRATION_ID | ||
| jq: ".id" | ||
| {% endkonnect_api_request %} | ||
|
|
||
| Next, authorize the integration with your Azure DevOps PAT: | ||
|
|
||
| {% konnect_api_request %} | ||
| url: /v1/integration-instances/$AZUREDEVOPS_INTEGRATION_ID/auth-credential | ||
| status_code: 201 | ||
| method: POST | ||
| body: | ||
| type: multi_key_auth | ||
| config: | ||
| headers: | ||
| - name: authorization | ||
| key: $AZUREDEVOPS_PAT | ||
| {% endkonnect_api_request %} | ||
|
|
||
| {% endnavtab %} | ||
| {% endnavtabs %} | ||
|
|
||
| For additional Azure DevOps resources, use the following table: | ||
|
|
||
| {% table %} | ||
| columns: | ||
| - title: Entity | ||
| key: entity | ||
| - title: Description | ||
| key: description | ||
| rows: | ||
| - entity: "[OAuth 2.0 Scopes](https://learn.microsoft.com/en-us/azure/devops/integrate/get-started/authentication/oauth?view=azure-devops)" | ||
| description: "Define and control the specific resources an OAuth application can access in Azure DevOps by requesting granular scopes." | ||
| - entity: "[Personal Access Tokens (PATs)](https://learn.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops&tabs=Window)" | ||
| description: "Authenticate with Azure DevOps by generating a time-limited token that grants scoped access, follow least-privilege practices by selecting only required permissions, and store the token securely to prevent misuse." | ||
| {% endtable %} | ||
|
|
||
|
|
||
| ## Discovery information | ||
|
|
||
| <!-- vale off--> | ||
|
|
||
| {% include_cached catalog/service-catalog-discovery.html | ||
| discovery_support=page.discovery_support | ||
| discovery_default=page.discovery_default | ||
| bindable_entities=page.bindable_entities | ||
| mechanism=page.mechanism %} | ||
|
|
||
| <!-- vale on--> | ||
Uh oh!
There was an error while loading. Please reload this page.