Skip to content

Duplicate resource instance name error message #1022

@ThomasNieto

Description

@ThomasNieto

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest version
  • Search the existing issues.

Summary

If multiple resource instances of the same type have the same name an error is thrown. This is to be expected but the error message should be more clear specifying the resource type.

  • Duplicate resource instance names are ALLOWED with different resource types.
  • Duplicate resource instance names are NOT ALLOWED with SAME resource types.

Steps to reproduce

$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
resources:
  - type: Microsoft.DSC.Debug/Echo
    name: test
    properties:
      output: it works

  - type: Microsoft/OSInfo
    name: test

  - type: Microsoft/OSInfo
    name: test

Expected behavior

ERROR Validation: Resource named 'test' for type 'Microsoft/OSInfo' is specified more than once in the configuration

Actual behavior

ERROR Validation: Resource named 'test' is specified more than once in the configuration

Error details

ERROR Validation: Resource named 'test' is specified more than once in the configuration

Environment data

7.5

Version

3.2.-preview3

Visuals

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions