Source Control - list Repositories
Gets a list of repositories metadata.
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/listRepositories?api-version=2025-03-01
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
resource
|
path | True |
string minLength: 1maxLength: 90 |
The name of the resource group. The name is case insensitive. |
subscription
|
path | True |
string (uuid) |
The ID of the target subscription. The value must be an UUID. |
workspace
|
path | True |
string minLength: 1maxLength: 90 pattern: ^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$ |
The name of the workspace. |
api-version
|
query | True |
string minLength: 1 |
The API version to use for this operation. |
Request Body
Name | Required | Type | Description |
---|---|---|---|
properties.repositoryAccess.kind | True |
The kind of repository access credentials |
|
properties.repositoryAccess.clientId |
string |
OAuth ClientId. Required when |
|
properties.repositoryAccess.code |
string |
OAuth Code. Required when |
|
properties.repositoryAccess.installationId |
string |
Application installation ID. Required when |
|
properties.repositoryAccess.state |
string |
OAuth State. Required when |
|
properties.repositoryAccess.token |
string |
Personal Access Token. Required when |
Responses
Name | Type | Description |
---|---|---|
200 OK |
OK |
|
Other Status Codes |
Error response describing why the operation failed. |
Security
azure_auth
Azure Active Directory OAuth2 Flow
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name | Description |
---|---|
user_impersonation | impersonate your user account |
Examples
Get repository list.
Sample request
POST https://management.azure.com/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/listRepositories?api-version=2025-03-01
{
"etag": "\"0300bf09-0000-0000-0000-5c37296e0000\"",
"properties": {
"repositoryAccess": {
"kind": "OAuth",
"code": "939fd7c6caf754f4f41f",
"state": "state",
"clientId": "54b3c2c0-1f48-4a1c-af9f-6399c3240b73"
}
}
}
Sample response
{
"value": [
{
"url": "https://api.github.com/repos/user/reponame",
"fullName": "reponame",
"installationId": 42424242,
"branches": [
"master",
"develop"
]
}
]
}
Definitions
Name | Description |
---|---|
Cloud |
Error response structure. |
Cloud |
Error details. |
Repo |
Represents a repository. |
Repo |
List all the source controls. |
Repository |
The kind of repository access credentials |
Repository |
Credentials to access repository. |
CloudError
Error response structure.
Name | Type | Description |
---|---|---|
error |
Error data |
CloudErrorBody
Error details.
Name | Type | Description |
---|---|---|
code |
string |
An identifier for the error. Codes are invariant and are intended to be consumed programmatically. |
message |
string |
A message describing the error, intended to be suitable for display in a user interface. |
Repo
Represents a repository.
Name | Type | Description |
---|---|---|
branches |
string[] |
Array of branches. |
fullName |
string |
The name of the repository. |
installationId |
integer (int64) |
The installation id of the repository. |
url |
string |
The url to access the repository. |
RepoList
List all the source controls.
Name | Type | Description |
---|---|---|
nextLink |
string |
URL to fetch the next set of repositories. |
value |
Repo[] |
Array of repositories. |
RepositoryAccessKind
The kind of repository access credentials
Value | Description |
---|---|
OAuth | |
PAT | |
App |
RepositoryAccessProperties
Credentials to access repository.
Name | Type | Description |
---|---|---|
properties.repositoryAccess.clientId |
string |
OAuth ClientId. Required when |
properties.repositoryAccess.code |
string |
OAuth Code. Required when |
properties.repositoryAccess.installationId |
string |
Application installation ID. Required when |
properties.repositoryAccess.kind |
The kind of repository access credentials |
|
properties.repositoryAccess.state |
string |
OAuth State. Required when |
properties.repositoryAccess.token |
string |
Personal Access Token. Required when |