Open szesch opened 1 month ago
Hi @szesch, sorry you're running into this error. That's not expected to happen.
A few questions:
There are also experience reports on the web saying that deregistering and re-registering the microsoft.insights provider helped, which would point to an Azure issue. You might try that via the portal or az provider.
This is common for newly created Azure Subscriptions – they don't have all resource providers registered by default. When you create resources via the Azure Portal they tend to auto register those providers when they are first created which is not the case when deploying via IaC.
You can register the provider via az cli:
# Make sure you have the right subscription activated:
az account set --subscription <subscription name or guid>
az provider register --namespace Microsoft.Insights --wait
Or via the portal by navigating to the relevant Subscription and under Settings -> Resource providers select the provider you want to register.
There's a Pulumi resource - providerhub.ProviderRegistration – for those registrations but I've never been able to get it to work:
status code 400, {"error":{"code":"InvalidSubscriptionIdForProviderNamespace","message":"The resource provider namespace 'microsoft.insights' is not a part of allowed resource provider namespaces list."}}
Hi @szesch, it would be helpful if you could respond to my questions above! Also, does this error occur in all your attempts to use Microsoft.Insights?
This is not a typical issue users of this provider have, but we may have missed an edge case.
@olafurnielsen providerhub.ProviderRegistration is for a different purpose, it's for Azure's Resource Provider as a Service, i.e., register your own RP.
@thomas11 Ah I hadn't realized that :/ Is this functionality then not exposed in the API specs?
@thomas11 Ah I hadn't realized that :/ Is this functionality then not exposed in the API specs?
It is exposed in the spec but in form of a POST endpoint, which we cannot support automatically because their semantics are very different from each other. We can add such an endpoint with some hand-written code. This is tracked in #1075.
What happened?
Creating a DiagnosticSetting is failing with
error: autorest/azure: Service returned an error. Status=<nil> <nil>. The subscription '<REDACTED>' is not registered to use microsoft.insights.
My expectation is that the
microsoft.insights
would be automatically registered.Example
Output of
pulumi about
Additional context
No response
Contributing
Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).