Skip to main content

mongo_user_definitions

Creates, updates, deletes, gets or lists a mongo_user_definitions resource.

Overview

Namemongo_user_definitions
TypeResource
Idazure.cosmos_db.mongo_user_definitions

Fields

NameDatatypeDescription
idtextThe unique resource identifier of the database account.
nametextThe name of the database account.
accountNametextfield from the properties object
custom_datatextfield from the properties object
database_nametextfield from the properties object
mechanismstextfield from the properties object
mongoUserDefinitionIdtextfield from the properties object
passwordtextfield from the properties object
resourceGroupNametextfield from the properties object
rolestextfield from the properties object
subscriptionIdtextfield from the properties object
typetextThe type of Azure resource.
user_nametextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
getSELECTaccountName, mongoUserDefinitionId, resourceGroupName, subscriptionIdRetrieves the properties of an existing Azure Cosmos DB Mongo User Definition with the given Id.
listSELECTaccountName, resourceGroupName, subscriptionIdRetrieves the list of all Azure Cosmos DB Mongo User Definition.
create_updateINSERTaccountName, mongoUserDefinitionId, resourceGroupName, subscriptionIdCreates or updates an Azure Cosmos DB Mongo User Definition.
deleteDELETEaccountName, mongoUserDefinitionId, resourceGroupName, subscriptionIdDeletes an existing Azure Cosmos DB Mongo User Definition.

SELECT examples

Retrieves the list of all Azure Cosmos DB Mongo User Definition.

SELECT
id,
name,
accountName,
custom_data,
database_name,
mechanisms,
mongoUserDefinitionId,
password,
resourceGroupName,
roles,
subscriptionId,
type,
user_name
FROM azure.cosmos_db.vw_mongo_user_definitions
WHERE accountName = '{{ accountName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';

INSERT example

Use the following StackQL query and manifest file to create a new mongo_user_definitions resource.

/*+ create */
INSERT INTO azure.cosmos_db.mongo_user_definitions (
accountName,
mongoUserDefinitionId,
resourceGroupName,
subscriptionId,
properties
)
SELECT
'{{ accountName }}',
'{{ mongoUserDefinitionId }}',
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ properties }}'
;

DELETE example

Deletes the specified mongo_user_definitions resource.

/*+ delete */
DELETE FROM azure.cosmos_db.mongo_user_definitions
WHERE accountName = '{{ accountName }}'
AND mongoUserDefinitionId = '{{ mongoUserDefinitionId }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';