Skip to main content

source_controls

Creates, updates, deletes, gets or lists a source_controls resource.

Overview

Namesource_controls
TypeResource
Idazure.security_insight.source_controls

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
contentTypesarrayArray of source control content types. Required.
descriptionstringA description of the source control.
displayNamestringThe display name of the source control. Required.
etagstringEtag of the azure resource.
lastDeploymentInfoobjectInformation regarding the latest deployment for the source control.
pullRequestobjectInformation regarding the pull request of the source control.
repoTypestringThe repository type of the source control. Required. Known values are: "Github" and "AzureDevOps". (Github, AzureDevOps)
repositoryobjectRepository metadata. Required.
repositoryAccessobjectRepository access credentials. This is write-only object and it never returns back to a user.
repositoryResourceInfoobjectInformation regarding the resources created in user's repository.
servicePrincipalobjectService principal metadata.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".
versionstringThe version number associated with the source control. Known values are: "V1" and "V2". (V1, V2)
workloadIdentityFederationobjectWorkload Identity metadata.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, workspace_name, source_control_id, subscription_idGets a source control byt its identifier.
listselectresource_group_name, workspace_name, subscription_idGets all source controls, without source control items.
createinsertresource_group_name, workspace_name, source_control_id, subscription_id, propertiesCreates a source control.
deletedeleteresource_group_name, workspace_name, source_control_id, subscription_idDelete 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.

NameDatatypeDescription
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
source_control_idstringSource control Id. Required.
subscription_idstring
workspace_namestringThe name of the monitor workspace. Required.

SELECT examples

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
;

INSERT examples

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
;

DELETE examples

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
;