Microsoft.DataShare accounts/shares

Bicep resource definition

The accounts/shares resource type can be deployed with operations that target:

For a list of changed properties in each API version, see change log.

Usage Examples

Bicep Samples

A basic example of deploying Data Share.

param resourceName string = 'acctest0001'
param location string = 'westeurope'

resource account 'Microsoft.DataShare/accounts@2019-11-01' = {
  name: resourceName
  location: location
  tags: {
    env: 'Test'
  }
}

resource share 'Microsoft.DataShare/accounts/shares@2019-11-01' = {
  name: resourceName
  parent: account
  properties: {
    description: ''
    shareKind: 'CopyBased'
    terms: ''
  }
}

Azure Quickstart Samples

The following Azure Quickstart templates contain Bicep samples for deploying this resource type.

Bicep File Description
Create a data share This template creates a data share
Create a data share from a storage account This template creates a data share from a storage account

Resource format

To create a Microsoft.DataShare/accounts/shares resource, add the following Bicep to your template.

resource symbolicname 'Microsoft.DataShare/accounts/shares@2021-08-01' = {
  parent: resourceSymbolicName
  name: 'string'
  properties: {
    description: 'string'
    shareKind: 'string'
    terms: 'string'
  }
}

Property Values

Microsoft.DataShare/accounts/shares

Name Description Value
name The resource name string (required)
parent In Bicep, you can specify the parent resource for a child resource. You only need to add this property when the child resource is declared outside of the parent resource.

For more information, see Child resource outside parent resource.
Symbolic name for resource of type: accounts
properties Properties on the share ShareProperties

ShareProperties

Name Description Value
description Share description. string
shareKind Share kind. 'CopyBased'
'InPlace'
terms Share terms. string

ARM template resource definition

The accounts/shares resource type can be deployed with operations that target:

Usage Examples

Azure Quickstart Templates

The following Azure Quickstart templates deploy this resource type.

Template Description
Create a data share

Deploy to Azure
This template creates a data share
Create a data share from a storage account

Deploy to Azure
This template creates a data share from a storage account

Resource format

To create a Microsoft.DataShare/accounts/shares resource, add the following JSON to your template.

{
  "type": "Microsoft.DataShare/accounts/shares",
  "apiVersion": "2021-08-01",
  "name": "string",
  "properties": {
    "description": "string",
    "shareKind": "string",
    "terms": "string"
  }
}

Property Values

Microsoft.DataShare/accounts/shares

Name Description Value
apiVersion The api version '2021-08-01'
name The resource name string (required)
properties Properties on the share ShareProperties
type The resource type 'Microsoft.DataShare/accounts/shares'

ShareProperties

Name Description Value
description Share description. string
shareKind Share kind. 'CopyBased'
'InPlace'
terms Share terms. string

Terraform (AzAPI provider) resource definition

The accounts/shares resource type can be deployed with operations that target:

  • Resource groups For a list of changed properties in each API version, see change log.

Usage Examples

Terraform Samples

A basic example of deploying Data Share.

terraform {
  required_providers {
    azapi = {
      source = "Azure/azapi"
    }
  }
}

provider "azapi" {
  skip_provider_registration = false
}

variable "resource_name" {
  type    = string
  default = "acctest0001"
}

variable "location" {
  type    = string
  default = "westeurope"
}

resource "azapi_resource" "resourceGroup" {
  type     = "Microsoft.Resources/resourceGroups@2020-06-01"
  name     = var.resource_name
  location = var.location
}

resource "azapi_resource" "account" {
  type      = "Microsoft.DataShare/accounts@2019-11-01"
  parent_id = azapi_resource.resourceGroup.id
  name      = var.resource_name
  location  = var.location
  identity {
    type         = "SystemAssigned"
    identity_ids = []
  }
  body = {
    tags = {
      env = "Test"
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}

resource "azapi_resource" "share" {
  type      = "Microsoft.DataShare/accounts/shares@2019-11-01"
  parent_id = azapi_resource.account.id
  name      = var.resource_name
  body = {
    properties = {
      description = ""
      shareKind   = "CopyBased"
      terms       = ""
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}

Resource format

To create a Microsoft.DataShare/accounts/shares resource, add the following Terraform to your template.

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.DataShare/accounts/shares@2021-08-01"
  name = "string"
  parent_id = "string"
  body = {
    properties = {
      description = "string"
      shareKind = "string"
      terms = "string"
    }
  }
}

Property Values

Microsoft.DataShare/accounts/shares

Name Description Value
name The resource name string (required)
parent_id The ID of the resource that is the parent for this resource. ID for resource of type: accounts
properties Properties on the share ShareProperties
type The resource type "Microsoft.DataShare/accounts/shares@2021-08-01"

ShareProperties

Name Description Value
description Share description. string
shareKind Share kind. 'CopyBased'
'InPlace'
terms Share terms. string