The subscription is not registered to Microsoft.insights resource provider


When I am creating Alert from Azure Monitor services I found below massage restricted me to complete the process of creating alert after few search on Microsoft document I found that I need to register for the Microsoft.insights provider to my subscription and they we can do it from azure portal or using PowerShell.

Creation of alert rules will fail, since the subscription is not registered to Microsoft.insights resource provider

Fix the issue using PowerShell command

Register-AzureRmResourceProvider –ProviderNamespace Microsoft.Insights

Fix the issue from Azure Portal

Under subscription in the left side select Resource provider and search about Microsoft.insights then do register for it easily

Keep Following Me

Manage Azure Policy Using PowerShell


Azure Policy is a Microsoft service in Azure used for creating and managing policies , assignments and definition and it is used to force some roles on some resources in case of some actions.

  • Policy definition: is the conditions of the policy
  • Policy assignment: in the part we can define which resource or services you need to apply this policy on it , add in your note that the policy assignment by default inherited so for example if you applied Policy on Subscription it will be inherited on all of the resource under this subscription
  • Policy parameters: it will give you the availability to custom your policy
  • Azure initiative Policy: it the like Azure policy but we can use when you need to do group of policy in one step and it is containing the 3 parts (initiative definition, initiative assignment, initiative parameters) “Policy Combo
Azure Policy

Today we will create Azure policy to enforce any new resource for using tag let’s go to see how we can create this policy using PowerShell Command.

IF you need to check all of my azure posts ➡ Latest Microsoft Azure Articles and Posts

  • Create Resource Group “IF you need it is not mandatory”
  • Save the Resource Group in PowerShell variable ($resource)
  • Call the Resource Group ID
  • Get the Azure Policy definition of required to assign tag for any new resource will be created
  • Save the Azure policy information into PowerShell variable ($Policy)
  • Create Azure Policy
Continue reading “Manage Azure Policy Using PowerShell”

How to Solve Error Azure Recovery Services vault cannot be deleted


Today when I am doing cleaning for the azure resources that I don’t need it to reduce the cost, I tried to remove Resource Group contain Recovery Service vault Services but it gives me error

Failed to delete resource group prodresouorcegroup: Deletion of resource group ‘prodresouorcegroup’ failed as resources with identifiers ‘Microsoft.RecoveryServices/vaults/elmasryvmbackupvault1’ could not be deleted

Then when I tried to remove the recovery services vault it gives me another error

Vault cannot be deleted as there are existing resources within the vault. Please ensure there are no backup items, protected servers or backup management servers associated with this vault. Unregister the following containers associated with this vault before proceeding for deletion. For instructions, see https://aka.ms/AB-AA4ecq5

After some Google Search I know the correct steps for deleting  Azure Recovery services vault

Continue reading “How to Solve Error Azure Recovery Services vault cannot be deleted”