Get CosmosDbEntraIdToken - PlagueHO/CosmosDB GitHub Wiki
Generates a secure string token for use with Azure Cosmos DB by calling the Entra ID service using the Get-AzAccessToken cmdlet.
Get-CosmosDbEntraIdToken [[-Endpoint] <String>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
Generates a secure string token for use with Azure Cosmos DB by calling the Entra ID service using the Get-AzAccessToken cmdlet. This requires that a user or service principal has been authenticated using the Connect-AzAccount cmdlet. If the user is not authenticated, the cmdlet will return null but display an error message.
PS C:\> Get-CosmosDbEntraIdToken
This will return a secure string token that can be used with Azure Cosmos DB. The token will use the default resource URI of https://cosmos.azure.com.
This parameter allows the resource URI of the token to be specified. The default value is https://cosmos.azure.com.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.