1. Packages
  2. Azure DevOps Provider
  3. API Docs
  4. getSecurityNamespaces
Viewing docs for Azure DevOps v3.14.0
published on Tuesday, Mar 24, 2026 by Pulumi
azuredevops logo
Viewing docs for Azure DevOps v3.14.0
published on Tuesday, Mar 24, 2026 by Pulumi

    Use this data source to access information about security namespaces within Azure DevOps. Security namespaces define the security model for different resources and operations in Azure DevOps.

    NOTE: If you need to find a specific security namespace by name or ID, consider using the azuredevops.getSecurityNamespace data source.

    Example Usage

    List All Security Namespaces

    import * as pulumi from "@pulumi/pulumi";
    import * as azuredevops from "@pulumi/azuredevops";
    
    const all = azuredevops.getSecurityNamespaces({});
    export const namespaces = all.then(all => all.namespaces);
    
    import pulumi
    import pulumi_azuredevops as azuredevops
    
    all = azuredevops.get_security_namespaces()
    pulumi.export("namespaces", all.namespaces)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azuredevops/sdk/v3/go/azuredevops"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		all, err := azuredevops.GetSecurityNamespaces(ctx, map[string]interface{}{}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("namespaces", all.Namespaces)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureDevOps = Pulumi.AzureDevOps;
    
    return await Deployment.RunAsync(() => 
    {
        var all = AzureDevOps.GetSecurityNamespaces.Invoke();
    
        return new Dictionary<string, object?>
        {
            ["namespaces"] = all.Apply(getSecurityNamespacesResult => getSecurityNamespacesResult.Namespaces),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azuredevops.AzuredevopsFunctions;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var all = AzuredevopsFunctions.getSecurityNamespaces(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference);
    
            ctx.export("namespaces", all.namespaces());
        }
    }
    
    variables:
      all:
        fn::invoke:
          function: azuredevops:getSecurityNamespaces
          arguments: {}
    outputs:
      namespaces: ${all.namespaces}
    

    Discover Available Permissions for a Namespace

    import * as pulumi from "@pulumi/pulumi";
    import * as azuredevops from "@pulumi/azuredevops";
    
    const all = azuredevops.getSecurityNamespaces({});
    const projectNamespace = all.then(all => .filter(ns => ns.name == "Project").map(ns => (ns))[0]);
    export const projectPermissions = .reduce((__obj, action) => ({ ...__obj, [action.name]: {
        displayName: action.displayName,
        bit: action.bit,
    } }));
    
    import pulumi
    import pulumi_azuredevops as azuredevops
    
    all = azuredevops.get_security_namespaces()
    project_namespace = [ns for ns in all.namespaces if ns.name == "Project"][0]
    pulumi.export("projectPermissions", {action.name: {
        "displayName": action.display_name,
        "bit": action.bit,
    } for action in project_namespace.actions})
    
    Example coming soon!
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureDevOps = Pulumi.AzureDevOps;
    
    return await Deployment.RunAsync(() => 
    {
        var all = AzureDevOps.GetSecurityNamespaces.Invoke();
    
        var projectNamespace = .Where(ns => ns.Name == "Project").Select(ns => 
        {
            return ns;
        }).ToList()[0];
    
        return new Dictionary<string, object?>
        {
            ["projectPermissions"] = .ToDictionary(item => {
                var action = item.Value;
                return action.Name;
            }, item => {
                var action = item.Value;
                return 
                {
                    { "displayName", action.DisplayName },
                    { "bit", action.Bit },
                };
            }),
        };
    });
    
    Example coming soon!
    
    Example coming soon!
    

    Common Security Namespaces

    The following are common security namespaces available in Azure DevOps:

    Namespace NameNamespace IDDescription
    Collection3e65f728-f8bc-4ecd-8764-7e378b19bfa7Organization/collection-level security
    Project52d39943-cb85-4d7f-8fa8-c6baac873819Project-level security
    Git Repositories2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87Git repository security
    Analytics58450c49-b02d-465a-ab12-59ae512d6531Analytics security
    AnalyticsViewsd34d3680-dfe5-4cc6-a949-7d9c68f73cbaAnalytics Views security
    Process2dab47f9-bd70-49ed-9bd5-8eb051e59c02Process template security
    AuditLoga6cc6381-a1ca-4b36-b3c1-4e65211e82b6Audit log security
    BuildAdministration302acaca-b667-436d-a946-87133492041cBuild administration security
    Server1f4179b3-6bac-4d01-b421-71ea09171400Server-level security
    VersionControlPrivileges66312704-deb5-43f9-b51c-ab4ff5e351c3Version control privileges

    PAT Permissions Required

    • Project & Team: Read

    Notes

    • Security namespaces define the security model for different resources and operations in Azure DevOps
    • Each namespace has a unique identifier (UUID) that doesn’t change across organizations
    • Namespaces contain actions (permissions) that can be granted or denied to users and groups
    • Permission bits are used to calculate effective permissions when multiple permissions are set
    • This data source is useful for discovering available permissions and namespace IDs for use with azuredevops.SecurityPermissions resources

    Using getSecurityNamespaces

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getSecurityNamespaces(opts?: InvokeOptions): Promise<GetSecurityNamespacesResult>
    function getSecurityNamespacesOutput(opts?: InvokeOptions): Output<GetSecurityNamespacesResult>
    def get_security_namespaces(opts: Optional[InvokeOptions] = None) -> GetSecurityNamespacesResult
    def get_security_namespaces_output(opts: Optional[InvokeOptions] = None) -> Output[GetSecurityNamespacesResult]
    func GetSecurityNamespaces(ctx *Context, opts ...InvokeOption) (*GetSecurityNamespacesResult, error)
    func GetSecurityNamespacesOutput(ctx *Context, opts ...InvokeOption) GetSecurityNamespacesResultOutput

    > Note: This function is named GetSecurityNamespaces in the Go SDK.

    public static class GetSecurityNamespaces 
    {
        public static Task<GetSecurityNamespacesResult> InvokeAsync(InvokeOptions? opts = null)
        public static Output<GetSecurityNamespacesResult> Invoke(InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetSecurityNamespacesResult> getSecurityNamespaces(InvokeOptions options)
    public static Output<GetSecurityNamespacesResult> getSecurityNamespaces(InvokeOptions options)
    
    fn::invoke:
      function: azuredevops:index/getSecurityNamespaces:getSecurityNamespaces
      arguments:
        # arguments dictionary

    getSecurityNamespaces Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Namespaces List<Pulumi.AzureDevOps.Outputs.GetSecurityNamespacesNamespace>
    A set of security namespaces. Each namespace block exports the following:
    Id string
    The provider-assigned unique ID for this managed resource.
    Namespaces []GetSecurityNamespacesNamespace
    A set of security namespaces. Each namespace block exports the following:
    id String
    The provider-assigned unique ID for this managed resource.
    namespaces List<GetSecurityNamespacesNamespace>
    A set of security namespaces. Each namespace block exports the following:
    id string
    The provider-assigned unique ID for this managed resource.
    namespaces GetSecurityNamespacesNamespace[]
    A set of security namespaces. Each namespace block exports the following:
    id str
    The provider-assigned unique ID for this managed resource.
    namespaces Sequence[GetSecurityNamespacesNamespace]
    A set of security namespaces. Each namespace block exports the following:
    id String
    The provider-assigned unique ID for this managed resource.
    namespaces List<Property Map>
    A set of security namespaces. Each namespace block exports the following:

    Supporting Types

    GetSecurityNamespacesNamespace

    Actions List<Pulumi.AzureDevOps.Inputs.GetSecurityNamespacesNamespaceAction>
    A set of available actions (permissions) in this namespace. Each action block exports the following:
    DisplayName string
    The display name of the action/permission.
    Id string
    The unique identifier (UUID) of the security namespace.
    Name string
    The name of the action/permission.
    Actions []GetSecurityNamespacesNamespaceAction
    A set of available actions (permissions) in this namespace. Each action block exports the following:
    DisplayName string
    The display name of the action/permission.
    Id string
    The unique identifier (UUID) of the security namespace.
    Name string
    The name of the action/permission.
    actions List<GetSecurityNamespacesNamespaceAction>
    A set of available actions (permissions) in this namespace. Each action block exports the following:
    displayName String
    The display name of the action/permission.
    id String
    The unique identifier (UUID) of the security namespace.
    name String
    The name of the action/permission.
    actions GetSecurityNamespacesNamespaceAction[]
    A set of available actions (permissions) in this namespace. Each action block exports the following:
    displayName string
    The display name of the action/permission.
    id string
    The unique identifier (UUID) of the security namespace.
    name string
    The name of the action/permission.
    actions Sequence[GetSecurityNamespacesNamespaceAction]
    A set of available actions (permissions) in this namespace. Each action block exports the following:
    display_name str
    The display name of the action/permission.
    id str
    The unique identifier (UUID) of the security namespace.
    name str
    The name of the action/permission.
    actions List<Property Map>
    A set of available actions (permissions) in this namespace. Each action block exports the following:
    displayName String
    The display name of the action/permission.
    id String
    The unique identifier (UUID) of the security namespace.
    name String
    The name of the action/permission.

    GetSecurityNamespacesNamespaceAction

    Bit int
    The bit value for this permission (used in permission calculations).
    DisplayName string
    The display name of the action/permission.
    Name string
    The name of the action/permission.
    Bit int
    The bit value for this permission (used in permission calculations).
    DisplayName string
    The display name of the action/permission.
    Name string
    The name of the action/permission.
    bit Integer
    The bit value for this permission (used in permission calculations).
    displayName String
    The display name of the action/permission.
    name String
    The name of the action/permission.
    bit number
    The bit value for this permission (used in permission calculations).
    displayName string
    The display name of the action/permission.
    name string
    The name of the action/permission.
    bit int
    The bit value for this permission (used in permission calculations).
    display_name str
    The display name of the action/permission.
    name str
    The name of the action/permission.
    bit Number
    The bit value for this permission (used in permission calculations).
    displayName String
    The display name of the action/permission.
    name String
    The name of the action/permission.

    Package Details

    Repository
    Azure DevOps pulumi/pulumi-azuredevops
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azuredevops Terraform Provider.
    azuredevops logo
    Viewing docs for Azure DevOps v3.14.0
    published on Tuesday, Mar 24, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.