Skip to main content

azure_data_factories resource

Use the azure_data_factories InSpec audit resource to test the properties related to data factories for a resource group or the entire subscription.

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_factories resource block returns all Azure data factories, either within a resource group (if provided) or within an entire Subscription.

describe azure_data_factories do
  #...
end

or

describe azure_data_factories(resource_group: 'RESOURCE_GROUP') do
  #...
end

Parameters

resource_group
Azure resource group where the targeted resource resides.

Properties

names
A list of the unique resource names.

Field: name

ids
A list of data factory IDs.

Field: id

tags
A list of tag:value pairs for the resource.

Field: tag

provisioning_states
The Data Factory provisioning state.

Field: provisioning_state

types
The resource type.

Field: type

repo_configuration_types
The Git or VSTS repository configuration types.

Field: repo type

repo_configuration_project_names
The VSTS repository project names.

Field: project_name

repo_configuration_account_names
The Git or VSTS repository account names.

Field: account_name

repo_configuration_repository_names
The Git or VSTS repository names.

Field: repository_name

repo_configuration_collaboration_branches
The Git or VSTS repository collaboration branches.

Field: collaboration_branch

repo_configuration_root_folders
The Git or VSTS repository root folders.

Field: root_folder

repo_configuration_tenant_ids
The VSTS tenant IDs.

Field: tenant_id

Note

For information on using filter criteria on plural resources, see the documentation on FilterTable

Examples

Test if any Data Factories exist in the resource group:

describe azure_data_factories(resource_group: 'RESOURCE_GROUP') do
  it { should exist }
  its('names') { should include "factory_name" }
end

Test that there are not any Data Factories in a resource group:

# Should not exist if no Data Factory is in the resource group.

describe azure_data_factories(resource_group: 'RESOURCE_GROUP') do
  it { should_not exist }
end

Filter Data Factories in a resource group by properties:

describe azure_data_factories(resource_group: 'RESOURCE_GROUP') do
  its('repo_configuration_type') { should include CONFIGURATION_TYPE }
  its('repo_configuration_project_name') { should include PROJECT_NAME }
  its('repo_configuration_account_name') { should include ACCOUNT_NAME }
  its('repo_configuration_repository_name') { should include REPOSITORY_NAME }
  its('repo_configuration_collaboration_branch') { should include COLLABORATION_BRANCH }
  its('repo_configuration_root_folder') { should include ROOT_FOLDER }
end

Azure permissions

Your Service Principal must be set up with at least a contributor role on the subscription you wish to test.

Thank you for your feedback!

×