Search code examples
jsonazureazure-resource-managerazure-rm-templateazure-marketplace

How to check if name already exists? Azure Ressource Manager Template


is it possible to check, in an ARM Template, if the name for my Virtual Machine already exists?

I am developing a Solution Template for the Azure Marketplace. Maybe it is possible to set a paramter in the UiDefinition uniqe?

The goal is to reproduce this green Hook

enter image description here


Solution

  • A couple notes...

    • VM Names only need to be unique within a resourceGroup, not within the subscription
    • Solution Templates must be deployed to empty resourceGroups, so collisions with existing resources aren't possible
    • For solution templates the preference is that you simply name the VMs for the user, rather than asking - use something that is appropriate for the workload (e.g. jumpbox) - not all solutions do this but we're trying to improve that experience

    Given that it's not likely we'll ever build a control that checks for naming collisions on resources without globally unique constraints.

    That help?