Unable to create a VM using azure power powershell

srinath sarman 41 Reputation points
2021-04-09T06:17:23+00:00

I am facing some issues while creating VM using Azure PowerShell where i could create and play around directly through portal. Below is the error i am getting. Comments are most welcome to rectify this and Thanks in Advance!

cmdlet New-AzVM at command pipeline position 1 Supply values for the following parameters: Name: test New-AzVM : Resource 'test' was disallowed by policy. Policy identifiers: '[{"policyAssignment":{"name":"Not allowed resource types","id":"/subscriptions/XXXXXXXXXXX/providers/Microsoft.Authorization/policyAssignment s/XXXXXXXXXX"},"policyDefinition":{"name":"Not allowed resource types","id":"/providers/Microsoft.Authorization/policyDefinitions/XXXXXXXX"}}]'. At line:1 char:1

New-AzVM

  • CategoryInfo : CloseError: (:) [New-AzVM], CloudException
  • FullyQualifiedErrorId : Microsoft.Azure.Commands.Compute.NewAzureVMCommand
Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,072 questions
Azure Policy
Azure Policy
An Azure service that is used to implement corporate governance and standards at scale for Azure resources.
787 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Andreas Baumgarten 95,336 Reputation points MVP
    2021-04-09T06:27:46.163+00:00

    Hi @srinath sarman ,

    the error messages shows the following detail:

    86114-image.png

    It looks like resources with name "test" are not allowed by an Azure Policy of your organization.

    If the name "test" is not allowed by your Azure Policies you should just try a different name for the resource.

    ----------

    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards
    Andreas Baumgarten


  2. Vaibhav Chaudhari 38,561 Reputation points
    2021-04-09T08:37:11.28+00:00

    There is some policy defined on RG or maybe subscription in which, you are not allowed to create VM. Check for the policies or contact admin.


    Please don't forget to Accept Answer and Up-vote if the response helped -- Vaibhav

    0 comments No comments