Create Pull Request
| Date | Scan | Status | Result |
|---|---|---|---|
| 2026-01-14 00:00 | #250 | in_progress |
Biased
|
| 2026-01-13 00:00 | #246 | completed |
Biased
|
| 2026-01-11 00:00 | #240 | completed |
Biased
|
| 2026-01-10 00:00 | #237 | completed |
Biased
|
| 2026-01-09 00:34 | #234 | completed |
Biased
|
| 2026-01-08 00:53 | #231 | completed |
Biased
|
| 2026-01-06 18:15 | #225 | cancelled |
Clean
|
| 2025-08-17 00:01 | #83 | cancelled |
Clean
|
| 2025-07-13 21:37 | #48 | completed |
Biased
|
| 2025-07-12 23:44 | #41 | cancelled |
Biased
|
param(
[Parameter(Mandatory = $true)] [string]$subscriptionId,
[Parameter(Mandatory = $true)] [string]$workspaceName,
[Parameter(Mandatory = $true)] [string]$resourceGroupName,
[Parameter(Mandatory = $true)] [string]$connectorName,
[Parameter(Mandatory = $true)] [string]$clientId,
[Parameter(Mandatory = $true)] [string]$keyVaultName,
[Parameter(Mandatory = $true)] [string]$secretName
)
# Import the required modules
Import-Module Az.Accounts
Import-Module Az.KeyVault
try {
# Login to Azure
Login-AzAccount
# Retrieve BTP client secret from Key Vault
$clientSecret = (Get-AzKeyVaultSecret -VaultName $keyVaultName -Name $secretName).SecretValue
if (!($clientSecret)) {
throw "Failed to retrieve the client secret from Azure Key Vault"
}
# Get the connector from data connectors API
$path = "/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.OperationalInsights/workspaces/{2}/providers/Microsoft.SecurityInsights/dataConnectors/{3}?api-version=2024-01-01-preview" -f $subscriptionId, $resourceGroupName, $workspaceName, $connectorName
$connector = (Invoke-AzRestMethod -Path $path -Method GET).Content | ConvertFrom-Json
if (!($connector)) {
throw "Failed to retrieve the connector"
}
# Add the updated client ID and client secret to the connector
$connector.properties.auth | Add-Member -Type NoteProperty -Name "clientId" -Value $clientId
$connector.properties.auth | Add-Member -Type NoteProperty -Name "clientSecret" -Value ($clientSecret | ConvertFrom-SecureString -AsPlainText)
# Update the connector with the new auth object
Invoke-AzRestMethod -Path $path -Method PUT -Payload ($connector | ConvertTo-Json -Depth 10)
}
catch {
Write-Error "An error occurred: $_"
}