Troubleshoot Azure Connections
Insufficient Permissions on Subscription
This error might occur if your current Azure authentication session does not have the required permissions to create resources in the specified subscription.
Solution: Ensure you are authenticated to Azure using a Non-Guest user with the Contributor or Owner role on the target subscription.
Error: Error Creating/Updating Lighthouse Definition "dd9be15b-0ee9-7daf-b942-5e173dae13fb" (Scope "/subscriptions/***"): managedservices.RegistrationDefinitionsClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: Code="InsufficientPrivilegesForManagedServiceResource" Message="The requested user doesn't have sufficient privileges to perform the operation."
with module.cloudvision_example_existing_resource_group.module.cloud_bench.module.trust_relationship["***"].azurerm_lighthouse_definition.lighthouse_definition,
on ../../../modules/services/cloud-bench/trust_relationship/main.tf line 28, in resource "azurerm_lighthouse_definition" "lighthouse_definition":
28: resource "azurerm_lighthouse_definition" "lighthouse_definition" {
Conflicting Resources
This error might occur if the specified Azure Subscription has already been onboarded to Sysdig
Solution:
You can import the resource into Terraform using the terraform import
command. This will bring the resource under management in the current Terraform workspace.
Error: A resource with the ID "/subscriptions/***/resourceGroups/sfc-resourcegroup" already exists - to be managed via Terraform this resource needs to be imported into the State. For details, see the resource documentation for `azurerm_resource_group`.
with module.cloudvision_example_existing_resource_group.module.infrastructure_eventhub.azurerm_resource_group.rg[0],
on ../../../modules/infrastructure/eventhub/main.tf line 6, in resource "azurerm_resource_group" "rg":
6: resource "azurerm_resource_group" "rg" {
Missing Microsoft.ManagedServices Namespace Registration
This error occurs if the specified Azure Subscription is not registered in the ‘Microsoft.ManagedServices’ namespace.
Solution: You can register a Resource Provider by following the Microsoft Documentation.
Error: creating/updating Lighthouse Assignment: (Lighthouse Definition ID "***" / Scope "/subscriptions/***"): managedservices.RegistrationDefinitionsClient#CreateOrUpdate: Failure sending request: StatusCode=409 -- Original Error: Code="MissingSubscriptionRegistration" Message="The managed services resource provider not allowed to access the subscription '***'. The subscription must be registered to use namespace 'Microsoft.ManagedServices'. Please see https://aka.ms/rp-not-register-error for details on how to register subscriptions." Details=[{"code":"AuthorizationFailed","message":"The client '***' with object id '***' does not have authorization to perform action 'Microsoft.Resources/subscriptions/read' over scope '/subscriptions/***' or the scope is invalid. If access was recently granted, please refresh your credentials."}]
with module.subscriptions-sysdig-sfc-agentless["***"].module.trust_relationship["***"].azurerm_lighthouse_definition.lighthouse_definition,
on .terraform\modules\subscriptions-sysdig-sfc-agentless\modules\services\cloud-bench\trust_relationship\main.tf line 24, in resource "azurerm_lighthouse_definition" "lighthouse_definition":
24: resource "azurerm_lighthouse_definition" "lighthouse_definition" {
Missing Cloud Logs
If validation is successful, but events are not flowing after setting up log ingestion:
- In the Secure UI, open Integrations > Azure and select the Subscription of your interest. On the panel on the right hand side, you can find the Event Hub name in the details of the Identity and Access Management or the Cloud Detection and Response sections.
- Using the Azure portal or the
azurerm CLI
, confirm the Event Hub is in place and check its metrics. If they are healthy, there should be no errors (Server Errors/User Errors), and there should be messages flowing, unless the subscription is silent. - If the subscription is silent, check the presence of Diagnostic settings on Azure. Each connected subscription should have Diagnostic Settings pointing to the target EventHub, as well as Entra ID, in case of Tenant setups.
Offboard Azure Subscriptions, Groups, and Tenants Using Terraform
Problem: Cannot Use Terraform Destroy to Offboard
Azure Service Principals are created at the Tenant level. Therefore, onboarded subscriptions share and use an existing service principal that is linked to the Sysdig application in the same tenant.
Once created, this service principal cannot be deleted via the Terraform module. This safeguards against unintended deletes if the service principal is in use.
As a result, trying to offboard using Terraform destroy
results in the following: Error: Instance cannot be destroyed.
Solution
To resolve this problem, remove the service_principal
resource from your Terraform state, so that Terraform will no longer control it.
terraform state list
terraform state rm module.<module-name>.azuread_service_principal.<sysdig-sp-resource-name>
terraform destroy
Problem: Terraform Fails to Destroy Organization Deployment with Enabled Security Features
Terraform fails to destroy an organization deployment when Host Scanning, Workload Scanning, or CDR is enabled, likely due to dependencies on active security configurations.
Solution
To resolve this, first manually offboard Azure. If the problem still persists, run the following terraform destroy
command:
terraform destroy -target module.onboarding.sysdig_secure_organization.azure_organization
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.