azure_data_factories Resource
Use the azure_data_factories
InSpec audit resource to test 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.
The api_version
can be defined as a resource parameter.
If not provided, this resource uses the latest version.
For more information, refer to the azure_generic_resource
document.
Unless defined, this resource uses the azure_cloud
global endpoint and default values for the HTTP client.
For more information, refer to the resource pack README.
Installation
This resource is available in the Chef InSpec Azure resource pack.
See the Chef InSpec documentation on cloud platforms for information on configuring your Azure environment for InSpec and creating an InSpec profile that uses the InSpec Azure resource pack.
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: 'my-rg') do
#...
end
Parameters
resource_group
- Azure resource group that the targeted resource resides in.
MyResourceGroup
.
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
See the documentation on FilterTable for information on using filter criteria on plural resources.
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 aren’t any Data Factories in a resource group.
**Should not exist if no Data Factory are 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.