azure_data_factory_datasets resource
Use the azure_data_factory_datasets
InSpec audit resource to test the properties of multiple Azure Data Factory datasets for a resource group or the entire subscription.
See the Azure Data Factories Dataset documentation
for additional information.
Azure REST API version, endpoint, and HTTP client parameters
This resource interacts with API versions supported by the resource provider.
You can specify the api_version
as a resource parameter to use a specific version of the Azure REST API.
If you don’t specify an API version, this resource uses the latest version available.
For more information about API versioning, see the azure_generic_resource
.
By default, this resource uses the azure_cloud
global endpoint and default HTTP client settings.
You can override these settings if you need to connect to a different Azure environment (such as Azure Government or Azure China).
For more information about configuration options, see the resource pack README.
Syntax
An azure_data_factory_datasets
resource block returns all Azure datasets, either within a resource group (if provided) or within an entire Subscription.
describe azure_data_factory_datasets(resource_group: 'RESOURCE_GROUP', factory_name: 'FACTORY_NAME') do
#...
end
Parameters
resource_group
(required)- Azure resource group where the targeted resource resides.
factory_name
(required)- The Azure Data factory name.
Properties
names
- A list of the unique resource names.
Field:
name
ids
- A list of dataset IDs.
Field:
id
properties
- A list of properties for the resources.
Field:
properties
types
- A list of types for each resource.
Field:
type
descriptions
- A list of descriptions of the resources.
Field:
description
linkedServiceName_referenceNames
- The list of LinkedService names.
Field:
linkedServiceName_referenceName
linkedServiceName_types
- The list of LinkedService types.
Field:
linkedServiceName_type
Note
Examples
Test if properties match:
describe azure_data_factory_datasetsazure_data_factory_datasets(resource_group: 'RESOURCE_GROUP', factory_name: 'FACTORY_NAME') do
its('names') { should include 'DATASET_NAME' }
its('types') { should include 'Microsoft.SecurityInsights/alertRules' }
its('enableds') { should include true }
end
Matchers
This InSpec audit resource has the following special matchers. For a full list of available matchers, please visit our Universal Matchers page.
Test if any Dataset exists in the Data Factory:
describe azure_data_factory_datasetsazure_data_factory_datasets(resource_group: 'RESOURCE_GROUP', factory_name: 'FACTORY_NAME') do
it { should exist }
end
Test that there are not any Datasets in a Data Factory:
# Should not exist if no datasets are in the data factory.
describe azure_data_factory_datasetsazure_data_factory_datasets(resource_group: 'RESOURCE_GROUP', factory_name: 'FACTORY_NAME') do
it { should_not exist }
end
Azure permissions
Your Service Principal must be set up with at least a contributor
role on the subscription you wish to test.