Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azurerm_data_factory_linked_service_azure_blob_storage - support for storage_kind #16403

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,17 @@ func resourceDataFactoryLinkedServiceAzureBlobStorage() *pluginsdk.Resource {
ExactlyOneOf: []string{"connection_string", "sas_uri", "service_endpoint"},
},

"storage_kind": {
Type: pluginsdk.TypeString,
Optional: true,
ValidateFunc: validation.StringInSlice([]string{
"Storage",
"StorageV2",
"BlobStorage",
"BlockBlobStorage",
}, false),
},

"sas_uri": {
Type: pluginsdk.TypeString,
Optional: true,
Expand Down Expand Up @@ -242,6 +253,10 @@ func resourceDataFactoryLinkedServiceBlobStorageCreateUpdate(d *pluginsdk.Resour
blobStorageLinkedService.ConnectVia = expandDataFactoryLinkedServiceIntegrationRuntime(v.(string))
}

if v, ok := d.GetOk("storage_kind"); ok {
blobStorageLinkedService.AccountKind = utils.String(v.(string))
}

if v, ok := d.GetOk("additional_properties"); ok {
blobStorageLinkedService.AdditionalProperties = v.(map[string]interface{})
}
Expand Down Expand Up @@ -309,6 +324,7 @@ func resourceDataFactoryLinkedServiceBlobStorageRead(d *pluginsdk.ResourceData,
}

if properties := blobStorage.AzureBlobStorageLinkedServiceTypeProperties; properties != nil {
d.Set("storage_kind", properties.AccountKind)
if sasToken := properties.SasToken; sasToken != nil {
if keyVaultPassword, ok := sasToken.AsAzureKeyVaultSecretReference(); ok {
if err := d.Set("key_vault_sas_token", flattenAzureKeyVaultSecretReference(keyVaultPassword)); err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ resource "azurerm_data_factory_linked_service_azure_blob_storage" "test" {
data_factory_id = azurerm_data_factory.test.id
service_endpoint = azurerm_storage_account.test.primary_blob_endpoint
use_managed_identity = true
storage_kind = "StorageV2"
}
`, data.RandomInteger, data.Locations.Primary)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ A `key_vault_sas_token` block supports the following:

* `service_principal_key` - (Optional) The service principal key in which to authenticate against the AAzure Blob Storage account. Required if `service_principal_id` is set.

* `storage_kind` - (Optional) Specify the kind of the storage account. Allowed values are `Storage`, `StorageV2`, `BlobStorage` and `BlockBlobStorage`.

* `tenant_id` - (Optional) The tenant id or name in which to authenticate against the Azure Blob Storage account.

## Attributes Reference
Expand Down