Skip to content

Condition-based elevation resource execution #1012

@Gijsreyn

Description

@Gijsreyn

Summary of the new feature / enhancement

As a user, I want to be able to simply allow certain resource instances to be skipped based on the metadata securityContext. With the condition implemented now, it would be neat if it could check the securityContext directly without the need to introduce a parameter.

Proposed technical implementation details (optional)

Something like:

$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
metadata:
  Microsoft.DSC:
    securityContext: elevated
resources:
- name: test
  type: Microsoft.DSC.Debug/Echo
  condition: "[equals([metadata('Microsoft.DSC').securityContext], True)]"
  properties:
      output: "This should only run if the user is elevated or root"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions