AzureCosmosDBResource
Class net10.0
A resource that represents an Azure Cosmos DB.
namespace Aspire.Hosting;
public class AzureCosmosDBResource : Aspire.Hosting.Azure.AzureProvisioningResource, Aspire.Hosting.ApplicationModel.IManifestExpressionProvider, Aspire.Hosting.ApplicationModel.IResource, Aspire.Hosting.ApplicationModel.IResourceWithConnectionString, Aspire.Hosting.ApplicationModel.IResourceWithEndpoints, Aspire.Hosting.ApplicationModel.IValueProvider, Aspire.Hosting.ApplicationModel.IValueWithReferences, Aspire.Hosting.Azure.IResourceWithAzureFunctionsConfig{ // ...} AzureProvisioningResourceIManifestExpressionProviderIResourceIResourceWithConnectionStringIResourceWithEndpointsIValueProviderIValueWithReferencesIResourceWithAzureFunctionsConfig
11 members
Constructors1
Section titled ConstructorsProperties8
Section titled PropertiesAccountKeygetReferenceExpression? Gets the account key expression for the Cosmos DB account.
ConnectionStringgetobsoleteBicepSecretOutputReference Gets the "connectionString" reference from the secret outputs of the Azure Cosmos DB resource.
ConnectionStringExpressiongetReferenceExpression Gets the connection string template for the manifest for the Azure Cosmos DB resource.
ConnectionStringOutputgetBicepOutputReference Gets the "connectionString" output reference from the bicep template for the Azure Cosmos DB resource. This is used when Entra ID authentication is used. The connection string is an output of the bicep template.
IsEmulatorgetbool Gets a value indicating whether the Azure Cosmos DB resource is running in the local emulator.
NameOutputReferencegetBicepOutputReference Gets the "name" output reference for the resource.
UriExpressiongetReferenceExpression Gets the account endpoint URI expression for the Cosmos DB account.
UseAccessKeyAuthenticationgetbool Gets a value indicating whether the resource uses access key authentication.
Methods2
Section titled MethodsAddAsExistingResource(AzureResourceInfrastructure)ProvisionableResource Adds a new
Primitives.ProvisionableResource into infra. The new resource represents a reference to the current Azure.AzureProvisioningResource via https://learn.microsoft.com/azure/azure-resource-manager/bicep/existing-resource. AddRoleAssignments(IAddRoleAssignmentsContext) Adds role assignments to this Azure resource.