1. Packages
  2. Azure Classic
  3. API Docs
  4. cosmosdb
  5. getSqlRoleDefinition

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi

azure.cosmosdb.getSqlRoleDefinition

Explore with Pulumi AI

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi

Use this data source to access information about an existing Cosmos DB SQL Role Definition.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const example = azure.cosmosdb.getSqlRoleDefinition({
    resourceGroupName: "tfex-cosmosdb-sql-role-definition-rg",
    accountName: "tfex-cosmosdb-sql-role-definition-account-name",
    roleDefinitionId: "00000000-0000-0000-0000-000000000000",
});
Copy
import pulumi
import pulumi_azure as azure

example = azure.cosmosdb.get_sql_role_definition(resource_group_name="tfex-cosmosdb-sql-role-definition-rg",
    account_name="tfex-cosmosdb-sql-role-definition-account-name",
    role_definition_id="00000000-0000-0000-0000-000000000000")
Copy
package main

import (
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/cosmosdb"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := cosmosdb.LookupSqlRoleDefinition(ctx, &cosmosdb.LookupSqlRoleDefinitionArgs{
			ResourceGroupName: "tfex-cosmosdb-sql-role-definition-rg",
			AccountName:       "tfex-cosmosdb-sql-role-definition-account-name",
			RoleDefinitionId:  "00000000-0000-0000-0000-000000000000",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;

return await Deployment.RunAsync(() => 
{
    var example = Azure.CosmosDB.GetSqlRoleDefinition.Invoke(new()
    {
        ResourceGroupName = "tfex-cosmosdb-sql-role-definition-rg",
        AccountName = "tfex-cosmosdb-sql-role-definition-account-name",
        RoleDefinitionId = "00000000-0000-0000-0000-000000000000",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.cosmosdb.CosmosdbFunctions;
import com.pulumi.azure.cosmosdb.inputs.GetSqlRoleDefinitionArgs;
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 example = CosmosdbFunctions.getSqlRoleDefinition(GetSqlRoleDefinitionArgs.builder()
            .resourceGroupName("tfex-cosmosdb-sql-role-definition-rg")
            .accountName("tfex-cosmosdb-sql-role-definition-account-name")
            .roleDefinitionId("00000000-0000-0000-0000-000000000000")
            .build());

    }
}
Copy
variables:
  example:
    fn::invoke:
      function: azure:cosmosdb:getSqlRoleDefinition
      arguments:
        resourceGroupName: tfex-cosmosdb-sql-role-definition-rg
        accountName: tfex-cosmosdb-sql-role-definition-account-name
        roleDefinitionId: 00000000-0000-0000-0000-000000000000
Copy

Using getSqlRoleDefinition

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 getSqlRoleDefinition(args: GetSqlRoleDefinitionArgs, opts?: InvokeOptions): Promise<GetSqlRoleDefinitionResult>
function getSqlRoleDefinitionOutput(args: GetSqlRoleDefinitionOutputArgs, opts?: InvokeOptions): Output<GetSqlRoleDefinitionResult>
Copy
def get_sql_role_definition(account_name: Optional[str] = None,
                            resource_group_name: Optional[str] = None,
                            role_definition_id: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetSqlRoleDefinitionResult
def get_sql_role_definition_output(account_name: Optional[pulumi.Input[str]] = None,
                            resource_group_name: Optional[pulumi.Input[str]] = None,
                            role_definition_id: Optional[pulumi.Input[str]] = None,
                            opts: Optional[InvokeOptions] = None) -> Output[GetSqlRoleDefinitionResult]
Copy
func LookupSqlRoleDefinition(ctx *Context, args *LookupSqlRoleDefinitionArgs, opts ...InvokeOption) (*LookupSqlRoleDefinitionResult, error)
func LookupSqlRoleDefinitionOutput(ctx *Context, args *LookupSqlRoleDefinitionOutputArgs, opts ...InvokeOption) LookupSqlRoleDefinitionResultOutput
Copy

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

public static class GetSqlRoleDefinition 
{
    public static Task<GetSqlRoleDefinitionResult> InvokeAsync(GetSqlRoleDefinitionArgs args, InvokeOptions? opts = null)
    public static Output<GetSqlRoleDefinitionResult> Invoke(GetSqlRoleDefinitionInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetSqlRoleDefinitionResult> getSqlRoleDefinition(GetSqlRoleDefinitionArgs args, InvokeOptions options)
public static Output<GetSqlRoleDefinitionResult> getSqlRoleDefinition(GetSqlRoleDefinitionArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: azure:cosmosdb/getSqlRoleDefinition:getSqlRoleDefinition
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

AccountName This property is required. string
The name of the Cosmos DB Account.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the Resource Group in which the Cosmos DB SQL Role Definition is created.
RoleDefinitionId This property is required. string
The GUID as the name of the Cosmos DB SQL Role Definition.
AccountName This property is required. string
The name of the Cosmos DB Account.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the Resource Group in which the Cosmos DB SQL Role Definition is created.
RoleDefinitionId This property is required. string
The GUID as the name of the Cosmos DB SQL Role Definition.
accountName This property is required. String
The name of the Cosmos DB Account.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the Resource Group in which the Cosmos DB SQL Role Definition is created.
roleDefinitionId This property is required. String
The GUID as the name of the Cosmos DB SQL Role Definition.
accountName This property is required. string
The name of the Cosmos DB Account.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the Resource Group in which the Cosmos DB SQL Role Definition is created.
roleDefinitionId This property is required. string
The GUID as the name of the Cosmos DB SQL Role Definition.
account_name This property is required. str
The name of the Cosmos DB Account.
resource_group_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the Resource Group in which the Cosmos DB SQL Role Definition is created.
role_definition_id This property is required. str
The GUID as the name of the Cosmos DB SQL Role Definition.
accountName This property is required. String
The name of the Cosmos DB Account.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the Resource Group in which the Cosmos DB SQL Role Definition is created.
roleDefinitionId This property is required. String
The GUID as the name of the Cosmos DB SQL Role Definition.

getSqlRoleDefinition Result

The following output properties are available:

AccountName string
AssignableScopes List<string>
A list of fully qualified scopes at or below which Role Assignments may be created using this Cosmos DB SQL Role Definition.
Id string
The provider-assigned unique ID for this managed resource.
Name string
The role name of the Cosmos DB SQL Role Definition.
Permissions List<GetSqlRoleDefinitionPermission>
A permissions block as defined below.
ResourceGroupName string
RoleDefinitionId string
Type string
The type of the Cosmos DB SQL Role Definition.
AccountName string
AssignableScopes []string
A list of fully qualified scopes at or below which Role Assignments may be created using this Cosmos DB SQL Role Definition.
Id string
The provider-assigned unique ID for this managed resource.
Name string
The role name of the Cosmos DB SQL Role Definition.
Permissions []GetSqlRoleDefinitionPermission
A permissions block as defined below.
ResourceGroupName string
RoleDefinitionId string
Type string
The type of the Cosmos DB SQL Role Definition.
accountName String
assignableScopes List<String>
A list of fully qualified scopes at or below which Role Assignments may be created using this Cosmos DB SQL Role Definition.
id String
The provider-assigned unique ID for this managed resource.
name String
The role name of the Cosmos DB SQL Role Definition.
permissions List<GetSqlRoleDefinitionPermission>
A permissions block as defined below.
resourceGroupName String
roleDefinitionId String
type String
The type of the Cosmos DB SQL Role Definition.
accountName string
assignableScopes string[]
A list of fully qualified scopes at or below which Role Assignments may be created using this Cosmos DB SQL Role Definition.
id string
The provider-assigned unique ID for this managed resource.
name string
The role name of the Cosmos DB SQL Role Definition.
permissions GetSqlRoleDefinitionPermission[]
A permissions block as defined below.
resourceGroupName string
roleDefinitionId string
type string
The type of the Cosmos DB SQL Role Definition.
account_name str
assignable_scopes Sequence[str]
A list of fully qualified scopes at or below which Role Assignments may be created using this Cosmos DB SQL Role Definition.
id str
The provider-assigned unique ID for this managed resource.
name str
The role name of the Cosmos DB SQL Role Definition.
permissions Sequence[GetSqlRoleDefinitionPermission]
A permissions block as defined below.
resource_group_name str
role_definition_id str
type str
The type of the Cosmos DB SQL Role Definition.
accountName String
assignableScopes List<String>
A list of fully qualified scopes at or below which Role Assignments may be created using this Cosmos DB SQL Role Definition.
id String
The provider-assigned unique ID for this managed resource.
name String
The role name of the Cosmos DB SQL Role Definition.
permissions List<Property Map>
A permissions block as defined below.
resourceGroupName String
roleDefinitionId String
type String
The type of the Cosmos DB SQL Role Definition.

Supporting Types

GetSqlRoleDefinitionPermission

DataActions This property is required. List<string>
A list of data actions that are allowed for the Cosmos DB SQL Role Definition.
DataActions This property is required. []string
A list of data actions that are allowed for the Cosmos DB SQL Role Definition.
dataActions This property is required. List<String>
A list of data actions that are allowed for the Cosmos DB SQL Role Definition.
dataActions This property is required. string[]
A list of data actions that are allowed for the Cosmos DB SQL Role Definition.
data_actions This property is required. Sequence[str]
A list of data actions that are allowed for the Cosmos DB SQL Role Definition.
dataActions This property is required. List<String>
A list of data actions that are allowed for the Cosmos DB SQL Role Definition.

Package Details

Repository
Azure Classic pulumi/pulumi-azure
License
Apache-2.0
Notes
This Pulumi package is based on the azurerm Terraform Provider.

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi