source_controls
Creates, updates, deletes, gets or lists a source_controls resource.
Overview
| Name | source_controls |
| Type | Resource |
| Id | azure.security_insight.source_controls |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
contentTypes | array | Array of source control content types. Required. |
description | string | A description of the source control. |
displayName | string | The display name of the source control. Required. |
etag | string | Etag of the azure resource. |
lastDeploymentInfo | object | Information regarding the latest deployment for the source control. |
pullRequest | object | Information regarding the pull request of the source control. |
repoType | string | The repository type of the source control. Required. Known values are: "Github" and "AzureDevOps". (Github, AzureDevOps) |
repository | object | Repository metadata. Required. |
repositoryAccess | object | Repository access credentials. This is write-only object and it never returns back to a user. |
repositoryResourceInfo | object | Information regarding the resources created in user's repository. |
servicePrincipal | object | Service principal metadata. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
version | string | The version number associated with the source control. Known values are: "V1" and "V2". (V1, V2) |
workloadIdentityFederation | object | Workload Identity metadata. |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
contentTypes | array | Array of source control content types. Required. |
description | string | A description of the source control. |
displayName | string | The display name of the source control. Required. |
etag | string | Etag of the azure resource. |
lastDeploymentInfo | object | Information regarding the latest deployment for the source control. |
pullRequest | object | Information regarding the pull request of the source control. |
repoType | string | The repository type of the source control. Required. Known values are: "Github" and "AzureDevOps". (Github, AzureDevOps) |
repository | object | Repository metadata. Required. |
repositoryAccess | object | Repository access credentials. This is write-only object and it never returns back to a user. |
repositoryResourceInfo | object | Information regarding the resources created in user's repository. |
servicePrincipal | object | Service principal metadata. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
version | string | The version number associated with the source control. Known values are: "V1" and "V2". (V1, V2) |
workloadIdentityFederation | object | Workload Identity metadata. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | resource_group_name, workspace_name, source_control_id, subscription_id | Gets a source control byt its identifier. | |
list | select | resource_group_name, workspace_name, subscription_id | Gets all source controls, without source control items. | |
create | insert | resource_group_name, workspace_name, source_control_id, subscription_id, properties | Creates a source control. | |
delete | delete | resource_group_name, workspace_name, source_control_id, subscription_id | Delete a source control. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
source_control_id | string | Source control Id. Required. |
subscription_id | string | |
workspace_name | string | The name of the monitor workspace. Required. |
SELECT examples
- get
- list
Gets a source control byt its identifier.
SELECT
id,
name,
contentTypes,
description,
displayName,
etag,
lastDeploymentInfo,
pullRequest,
repoType,
repository,
repositoryAccess,
repositoryResourceInfo,
servicePrincipal,
systemData,
type,
version,
workloadIdentityFederation
FROM azure.security_insight.source_controls
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND workspace_name = '{{ workspace_name }}' -- required
AND source_control_id = '{{ source_control_id }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Gets all source controls, without source control items.
SELECT
id,
name,
contentTypes,
description,
displayName,
etag,
lastDeploymentInfo,
pullRequest,
repoType,
repository,
repositoryAccess,
repositoryResourceInfo,
servicePrincipal,
systemData,
type,
version,
workloadIdentityFederation
FROM azure.security_insight.source_controls
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND workspace_name = '{{ workspace_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
INSERT examples
- create
- Manifest
Creates a source control.
INSERT INTO azure.security_insight.source_controls (
properties,
etag,
resource_group_name,
workspace_name,
source_control_id,
subscription_id
)
SELECT
'{{ properties }}' /* required */,
'{{ etag }}',
'{{ resource_group_name }}',
'{{ workspace_name }}',
'{{ source_control_id }}',
'{{ subscription_id }}'
RETURNING
id,
name,
etag,
properties,
systemData,
type
;
# Description fields are for documentation purposes
- name: source_controls
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the source_controls resource.
- name: workspace_name
value: "{{ workspace_name }}"
description: Required parameter for the source_controls resource.
- name: source_control_id
value: "{{ source_control_id }}"
description: Required parameter for the source_controls resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the source_controls resource.
- name: properties
description: |
source control properties. Required.
value:
id: "{{ id }}"
version: "{{ version }}"
displayName: "{{ displayName }}"
description: "{{ description }}"
repoType: "{{ repoType }}"
contentTypes:
- "{{ contentTypes }}"
repository:
url: "{{ url }}"
branch: "{{ branch }}"
displayUrl: "{{ displayUrl }}"
deploymentLogsUrl: "{{ deploymentLogsUrl }}"
servicePrincipal:
id: "{{ id }}"
tenantId: "{{ tenantId }}"
appId: "{{ appId }}"
credentialsExpireOn: "{{ credentialsExpireOn }}"
workloadIdentityFederation:
id: "{{ id }}"
tenantId: "{{ tenantId }}"
appId: "{{ appId }}"
subject: "{{ subject }}"
issuer: "{{ issuer }}"
repositoryAccess:
kind: "{{ kind }}"
code: "{{ code }}"
state: "{{ state }}"
clientId: "{{ clientId }}"
token: "{{ token }}"
installationId: "{{ installationId }}"
repositoryResourceInfo:
webhook:
webhookId: "{{ webhookId }}"
webhookUrl: "{{ webhookUrl }}"
webhookSecretUpdateTime: "{{ webhookSecretUpdateTime }}"
rotateWebhookSecret: {{ rotateWebhookSecret }}
gitHubResourceInfo:
appInstallationId: "{{ appInstallationId }}"
azureDevOpsResourceInfo:
pipelineId: "{{ pipelineId }}"
serviceConnectionId: "{{ serviceConnectionId }}"
lastDeploymentInfo:
deploymentFetchStatus: "{{ deploymentFetchStatus }}"
deployment:
deploymentId: "{{ deploymentId }}"
deploymentState: "{{ deploymentState }}"
deploymentResult: "{{ deploymentResult }}"
deploymentTime: "{{ deploymentTime }}"
deploymentLogsUrl: "{{ deploymentLogsUrl }}"
message: "{{ message }}"
pullRequest:
url: "{{ url }}"
state: "{{ state }}"
- name: etag
value: "{{ etag }}"
description: |
Etag of the azure resource.
DELETE examples
- delete
Delete a source control.
DELETE FROM azure.security_insight.source_controls
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND workspace_name = '{{ workspace_name }}' --required
AND source_control_id = '{{ source_control_id }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;