We recommend using Azure Native.
azure.streamanalytics.OutputCosmosdb
Explore with Pulumi AI
Manages a Stream Analytics Output to CosmosDB.
Example Usage
Coming soon!
Coming soon!
Coming soon!
Coming soon!
Coming soon!
resources:
  exampleResourceGroup:
    type: azure:core:ResourceGroup
    name: example
    properties:
      name: rg-example
      location: West Europe
  exampleAccount:
    type: azure:cosmosdb:Account
    name: example
    properties:
      name: exampledb
      resourceGroupName: ${exampleResourceGroup.name}
      location: ${exampleResourceGroup.location}
      offerType: Standard
      kind: GlobalDocumentDB
      consistencyPolicy:
        consistencyLevel: BoundedStaleness
        maxIntervalInSeconds: 10
        maxStalenessPrefix: 200
      geoLocations:
        - location: ${exampleResourceGroup.location}
          failoverPriority: 0
  exampleSqlDatabase:
    type: azure:cosmosdb:SqlDatabase
    name: example
    properties:
      name: cosmos-sql-db
      resourceGroupName: ${exampleAccount.resourceGroupName}
      accountName: ${exampleAccount.name}
      throughput: 400
  exampleSqlContainer:
    type: azure:cosmosdb:SqlContainer
    name: example
    properties:
      name: examplecontainer
      resourceGroupName: ${exampleAccount.resourceGroupName}
      accountName: ${exampleAccount.name}
      databaseName: ${exampleSqlDatabase.name}
      partitionKeyPath: foo
  exampleOutputCosmosdb:
    type: azure:streamanalytics:OutputCosmosdb
    name: example
    properties:
      name: output-to-cosmosdb
      streamAnalyticsJobId: ${example.id}
      cosmosdbAccountKey: ${exampleAccount.primaryKey}
      cosmosdbSqlDatabaseId: ${exampleSqlDatabase.id}
      containerName: ${exampleSqlContainer.name}
      documentId: exampledocumentid
variables:
  example:
    fn::invoke:
      function: azure:streamanalytics:getJob
      arguments:
        name: example-job
        resourceGroupName: ${exampleResourceGroup.name}
Create OutputCosmosdb Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new OutputCosmosdb(name: string, args: OutputCosmosdbArgs, opts?: CustomResourceOptions);@overload
def OutputCosmosdb(resource_name: str,
                   args: OutputCosmosdbArgs,
                   opts: Optional[ResourceOptions] = None)
@overload
def OutputCosmosdb(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   container_name: Optional[str] = None,
                   cosmosdb_account_key: Optional[str] = None,
                   cosmosdb_sql_database_id: Optional[str] = None,
                   stream_analytics_job_id: Optional[str] = None,
                   authentication_mode: Optional[str] = None,
                   document_id: Optional[str] = None,
                   name: Optional[str] = None,
                   partition_key: Optional[str] = None)func NewOutputCosmosdb(ctx *Context, name string, args OutputCosmosdbArgs, opts ...ResourceOption) (*OutputCosmosdb, error)public OutputCosmosdb(string name, OutputCosmosdbArgs args, CustomResourceOptions? opts = null)
public OutputCosmosdb(String name, OutputCosmosdbArgs args)
public OutputCosmosdb(String name, OutputCosmosdbArgs args, CustomResourceOptions options)
type: azure:streamanalytics:OutputCosmosdb
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args OutputCosmosdbArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args OutputCosmosdbArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args OutputCosmosdbArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args OutputCosmosdbArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args OutputCosmosdbArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var outputCosmosdbResource = new Azure.StreamAnalytics.OutputCosmosdb("outputCosmosdbResource", new()
{
    ContainerName = "string",
    CosmosdbAccountKey = "string",
    CosmosdbSqlDatabaseId = "string",
    StreamAnalyticsJobId = "string",
    AuthenticationMode = "string",
    DocumentId = "string",
    Name = "string",
    PartitionKey = "string",
});
example, err := streamanalytics.NewOutputCosmosdb(ctx, "outputCosmosdbResource", &streamanalytics.OutputCosmosdbArgs{
	ContainerName:         pulumi.String("string"),
	CosmosdbAccountKey:    pulumi.String("string"),
	CosmosdbSqlDatabaseId: pulumi.String("string"),
	StreamAnalyticsJobId:  pulumi.String("string"),
	AuthenticationMode:    pulumi.String("string"),
	DocumentId:            pulumi.String("string"),
	Name:                  pulumi.String("string"),
	PartitionKey:          pulumi.String("string"),
})
var outputCosmosdbResource = new OutputCosmosdb("outputCosmosdbResource", OutputCosmosdbArgs.builder()
    .containerName("string")
    .cosmosdbAccountKey("string")
    .cosmosdbSqlDatabaseId("string")
    .streamAnalyticsJobId("string")
    .authenticationMode("string")
    .documentId("string")
    .name("string")
    .partitionKey("string")
    .build());
output_cosmosdb_resource = azure.streamanalytics.OutputCosmosdb("outputCosmosdbResource",
    container_name="string",
    cosmosdb_account_key="string",
    cosmosdb_sql_database_id="string",
    stream_analytics_job_id="string",
    authentication_mode="string",
    document_id="string",
    name="string",
    partition_key="string")
const outputCosmosdbResource = new azure.streamanalytics.OutputCosmosdb("outputCosmosdbResource", {
    containerName: "string",
    cosmosdbAccountKey: "string",
    cosmosdbSqlDatabaseId: "string",
    streamAnalyticsJobId: "string",
    authenticationMode: "string",
    documentId: "string",
    name: "string",
    partitionKey: "string",
});
type: azure:streamanalytics:OutputCosmosdb
properties:
    authenticationMode: string
    containerName: string
    cosmosdbAccountKey: string
    cosmosdbSqlDatabaseId: string
    documentId: string
    name: string
    partitionKey: string
    streamAnalyticsJobId: string
OutputCosmosdb Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The OutputCosmosdb resource accepts the following input properties:
- ContainerName string
- The name of the CosmosDB container.
- CosmosdbAccount stringKey 
- The account key for the CosmosDB database.
- CosmosdbSql stringDatabase Id 
- The ID of the CosmosDB database.
- StreamAnalytics stringJob Id 
- The ID of the Stream Analytics Job. Changing this forces a new resource to be created.
- AuthenticationMode string
- The authentication mode for the CosmosDB database. Possible values are ConnectionStringandMsi. Defaults toConnectionString.
- DocumentId string
- The name of the field in output events used to specify the primary key which insert or update operations are based on.
- Name string
- The name of the Stream Analytics Output. Changing this forces a new resource to be created.
- PartitionKey string
- The name of the field in output events used to specify the key for partitioning output across collections. If container_namecontains{partition}token, this property is required to be specified.
- ContainerName string
- The name of the CosmosDB container.
- CosmosdbAccount stringKey 
- The account key for the CosmosDB database.
- CosmosdbSql stringDatabase Id 
- The ID of the CosmosDB database.
- StreamAnalytics stringJob Id 
- The ID of the Stream Analytics Job. Changing this forces a new resource to be created.
- AuthenticationMode string
- The authentication mode for the CosmosDB database. Possible values are ConnectionStringandMsi. Defaults toConnectionString.
- DocumentId string
- The name of the field in output events used to specify the primary key which insert or update operations are based on.
- Name string
- The name of the Stream Analytics Output. Changing this forces a new resource to be created.
- PartitionKey string
- The name of the field in output events used to specify the key for partitioning output across collections. If container_namecontains{partition}token, this property is required to be specified.
- containerName String
- The name of the CosmosDB container.
- cosmosdbAccount StringKey 
- The account key for the CosmosDB database.
- cosmosdbSql StringDatabase Id 
- The ID of the CosmosDB database.
- streamAnalytics StringJob Id 
- The ID of the Stream Analytics Job. Changing this forces a new resource to be created.
- authenticationMode String
- The authentication mode for the CosmosDB database. Possible values are ConnectionStringandMsi. Defaults toConnectionString.
- documentId String
- The name of the field in output events used to specify the primary key which insert or update operations are based on.
- name String
- The name of the Stream Analytics Output. Changing this forces a new resource to be created.
- partitionKey String
- The name of the field in output events used to specify the key for partitioning output across collections. If container_namecontains{partition}token, this property is required to be specified.
- containerName string
- The name of the CosmosDB container.
- cosmosdbAccount stringKey 
- The account key for the CosmosDB database.
- cosmosdbSql stringDatabase Id 
- The ID of the CosmosDB database.
- streamAnalytics stringJob Id 
- The ID of the Stream Analytics Job. Changing this forces a new resource to be created.
- authenticationMode string
- The authentication mode for the CosmosDB database. Possible values are ConnectionStringandMsi. Defaults toConnectionString.
- documentId string
- The name of the field in output events used to specify the primary key which insert or update operations are based on.
- name string
- The name of the Stream Analytics Output. Changing this forces a new resource to be created.
- partitionKey string
- The name of the field in output events used to specify the key for partitioning output across collections. If container_namecontains{partition}token, this property is required to be specified.
- container_name str
- The name of the CosmosDB container.
- cosmosdb_account_ strkey 
- The account key for the CosmosDB database.
- cosmosdb_sql_ strdatabase_ id 
- The ID of the CosmosDB database.
- stream_analytics_ strjob_ id 
- The ID of the Stream Analytics Job. Changing this forces a new resource to be created.
- authentication_mode str
- The authentication mode for the CosmosDB database. Possible values are ConnectionStringandMsi. Defaults toConnectionString.
- document_id str
- The name of the field in output events used to specify the primary key which insert or update operations are based on.
- name str
- The name of the Stream Analytics Output. Changing this forces a new resource to be created.
- partition_key str
- The name of the field in output events used to specify the key for partitioning output across collections. If container_namecontains{partition}token, this property is required to be specified.
- containerName String
- The name of the CosmosDB container.
- cosmosdbAccount StringKey 
- The account key for the CosmosDB database.
- cosmosdbSql StringDatabase Id 
- The ID of the CosmosDB database.
- streamAnalytics StringJob Id 
- The ID of the Stream Analytics Job. Changing this forces a new resource to be created.
- authenticationMode String
- The authentication mode for the CosmosDB database. Possible values are ConnectionStringandMsi. Defaults toConnectionString.
- documentId String
- The name of the field in output events used to specify the primary key which insert or update operations are based on.
- name String
- The name of the Stream Analytics Output. Changing this forces a new resource to be created.
- partitionKey String
- The name of the field in output events used to specify the key for partitioning output across collections. If container_namecontains{partition}token, this property is required to be specified.
Outputs
All input properties are implicitly available as output properties. Additionally, the OutputCosmosdb resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing OutputCosmosdb Resource
Get an existing OutputCosmosdb resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: OutputCosmosdbState, opts?: CustomResourceOptions): OutputCosmosdb@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        authentication_mode: Optional[str] = None,
        container_name: Optional[str] = None,
        cosmosdb_account_key: Optional[str] = None,
        cosmosdb_sql_database_id: Optional[str] = None,
        document_id: Optional[str] = None,
        name: Optional[str] = None,
        partition_key: Optional[str] = None,
        stream_analytics_job_id: Optional[str] = None) -> OutputCosmosdbfunc GetOutputCosmosdb(ctx *Context, name string, id IDInput, state *OutputCosmosdbState, opts ...ResourceOption) (*OutputCosmosdb, error)public static OutputCosmosdb Get(string name, Input<string> id, OutputCosmosdbState? state, CustomResourceOptions? opts = null)public static OutputCosmosdb get(String name, Output<String> id, OutputCosmosdbState state, CustomResourceOptions options)resources:  _:    type: azure:streamanalytics:OutputCosmosdb    get:      id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- AuthenticationMode string
- The authentication mode for the CosmosDB database. Possible values are ConnectionStringandMsi. Defaults toConnectionString.
- ContainerName string
- The name of the CosmosDB container.
- CosmosdbAccount stringKey 
- The account key for the CosmosDB database.
- CosmosdbSql stringDatabase Id 
- The ID of the CosmosDB database.
- DocumentId string
- The name of the field in output events used to specify the primary key which insert or update operations are based on.
- Name string
- The name of the Stream Analytics Output. Changing this forces a new resource to be created.
- PartitionKey string
- The name of the field in output events used to specify the key for partitioning output across collections. If container_namecontains{partition}token, this property is required to be specified.
- StreamAnalytics stringJob Id 
- The ID of the Stream Analytics Job. Changing this forces a new resource to be created.
- AuthenticationMode string
- The authentication mode for the CosmosDB database. Possible values are ConnectionStringandMsi. Defaults toConnectionString.
- ContainerName string
- The name of the CosmosDB container.
- CosmosdbAccount stringKey 
- The account key for the CosmosDB database.
- CosmosdbSql stringDatabase Id 
- The ID of the CosmosDB database.
- DocumentId string
- The name of the field in output events used to specify the primary key which insert or update operations are based on.
- Name string
- The name of the Stream Analytics Output. Changing this forces a new resource to be created.
- PartitionKey string
- The name of the field in output events used to specify the key for partitioning output across collections. If container_namecontains{partition}token, this property is required to be specified.
- StreamAnalytics stringJob Id 
- The ID of the Stream Analytics Job. Changing this forces a new resource to be created.
- authenticationMode String
- The authentication mode for the CosmosDB database. Possible values are ConnectionStringandMsi. Defaults toConnectionString.
- containerName String
- The name of the CosmosDB container.
- cosmosdbAccount StringKey 
- The account key for the CosmosDB database.
- cosmosdbSql StringDatabase Id 
- The ID of the CosmosDB database.
- documentId String
- The name of the field in output events used to specify the primary key which insert or update operations are based on.
- name String
- The name of the Stream Analytics Output. Changing this forces a new resource to be created.
- partitionKey String
- The name of the field in output events used to specify the key for partitioning output across collections. If container_namecontains{partition}token, this property is required to be specified.
- streamAnalytics StringJob Id 
- The ID of the Stream Analytics Job. Changing this forces a new resource to be created.
- authenticationMode string
- The authentication mode for the CosmosDB database. Possible values are ConnectionStringandMsi. Defaults toConnectionString.
- containerName string
- The name of the CosmosDB container.
- cosmosdbAccount stringKey 
- The account key for the CosmosDB database.
- cosmosdbSql stringDatabase Id 
- The ID of the CosmosDB database.
- documentId string
- The name of the field in output events used to specify the primary key which insert or update operations are based on.
- name string
- The name of the Stream Analytics Output. Changing this forces a new resource to be created.
- partitionKey string
- The name of the field in output events used to specify the key for partitioning output across collections. If container_namecontains{partition}token, this property is required to be specified.
- streamAnalytics stringJob Id 
- The ID of the Stream Analytics Job. Changing this forces a new resource to be created.
- authentication_mode str
- The authentication mode for the CosmosDB database. Possible values are ConnectionStringandMsi. Defaults toConnectionString.
- container_name str
- The name of the CosmosDB container.
- cosmosdb_account_ strkey 
- The account key for the CosmosDB database.
- cosmosdb_sql_ strdatabase_ id 
- The ID of the CosmosDB database.
- document_id str
- The name of the field in output events used to specify the primary key which insert or update operations are based on.
- name str
- The name of the Stream Analytics Output. Changing this forces a new resource to be created.
- partition_key str
- The name of the field in output events used to specify the key for partitioning output across collections. If container_namecontains{partition}token, this property is required to be specified.
- stream_analytics_ strjob_ id 
- The ID of the Stream Analytics Job. Changing this forces a new resource to be created.
- authenticationMode String
- The authentication mode for the CosmosDB database. Possible values are ConnectionStringandMsi. Defaults toConnectionString.
- containerName String
- The name of the CosmosDB container.
- cosmosdbAccount StringKey 
- The account key for the CosmosDB database.
- cosmosdbSql StringDatabase Id 
- The ID of the CosmosDB database.
- documentId String
- The name of the field in output events used to specify the primary key which insert or update operations are based on.
- name String
- The name of the Stream Analytics Output. Changing this forces a new resource to be created.
- partitionKey String
- The name of the field in output events used to specify the key for partitioning output across collections. If container_namecontains{partition}token, this property is required to be specified.
- streamAnalytics StringJob Id 
- The ID of the Stream Analytics Job. Changing this forces a new resource to be created.
Import
Stream Analytics Outputs for CosmosDB can be imported using the resource id, e.g.
$ pulumi import azure:streamanalytics/outputCosmosdb:OutputCosmosdb example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.StreamAnalytics/streamingJobs/job1/outputs/output1
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the azurermTerraform Provider.