A cloud-based identity and access management service for securing user authentication and resource access
The error comes from the subscription not having permission to create diagnostic settings, not from the Microsoft.Insights resource provider registration itself.
When configuring diagnostic settings to export to a Log Analytics workspace, the account (or service principal) must have a role that includes the Microsoft.Insights/diagnosticSettings/write permission at subscription scope. If this permission is missing or only granted at a lower scope (for example, resource group), the portal can surface confusing errors such as “subscription … is not registered to use microsoft.insights”.
To fix this:
- In the Azure portal, go to Subscriptions and select the subscription shown in the error.
- Open Access control (IAM) → Role assignments.
- Confirm that the identity used to create the diagnostic setting has a role at subscription level that includes
Microsoft.Insights/diagnosticSettings/write. - If not, create a custom role based on Log Analytics Contributor:
- Duplicate the Log Analytics Contributor built‑in role.
- Remove any permissions that are not needed.
- Ensure
Microsoft.Insights/diagnosticSettings/writeremains in the permissions list.
- Assign this custom role to the identity at the subscription scope.
- If the role was just assigned, sign out and sign back in (or refresh credentials) and then retry creating the diagnostic setting.
This resolves the permission error that is being reported as a microsoft.insights registration issue.
References: