'microsoft.insights/components/ProactiveDetectionConfigs in arm template force to multiple deploy

I'm deploying an ARM template that take care of creating an app service plan. I've exported the template from the existing plan and parametrized for our needs. sometimes we get several errors on deplying

microsoft.insights/components/ProactiveDetectionConfigs

the errors are of

Value cannot be null. Parameter name: componentEnv

if we retry many times the operations until all the ProactiveDetectionConfigs resources are deployed we can finally complete the deployment. Currently we have the following resources

microsoft.insights/components
microsoft.insights/webtests
Microsoft.Portal/dashboards
Microsoft.Web/serverfarms
microsoft.insights/components/ProactiveDetectionConfigs
Microsoft.Web/sites

I cannot figure out if i'm not considering some dependencies (currently is dependent on microsoft.insights/components and Microsoft.Web/sites) or if that kind of resource is necessary at all

thanks



Solution 1:[1]

To deploy the ProactiveDetectionConfigs into ARM template use the below code in your template

{
  "type": "Microsoft.Insights/components/ProactiveDetectionConfigs",
  "apiVersion": "2018-05-01-preview",
  "name": "string",
  "location": "string",
  "properties": {
    "CustomEmails": [ "string" ],
    "Enabled": "bool",
    "RuleDefinitions": {
      "Description": "string",
      "DisplayName": "string",
      "HelpUrl": "string",
      "IsEnabledByDefault": "bool",
      "IsHidden": "bool",
      "IsInPreview": "bool",
      "Name": "string",
      "SupportsEmailNotifications": "bool"
    },
    "SendEmailsToSubscriptionOwners": "bool"
  }
}

Check the ProactiveDetectionConfigs link for more information.

Solution 2:[2]

I had the same issue and it was transient. It worked fine in the next several deployments with no other changes.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 SaiSakethGuduru-MT
Solution 2 Andrew Stein