Skip to main content

azure_data_factory_linked_services Resource

Use the azure_data_factory_linked_services InSpec audit resource to test the properties related to linked services 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.


This resource is available in the Chef InSpec Azure resource pack.

For information on configuring your Azure environment for Chef InSpec and creating an InSpec profile that uses the InSpec Azure resource pack, see the Chef InSpec documentation for the Azure cloud platform.


An azure_data_factory_linked_services resource block returns all Azure Linked Services, either within a resource group (if provided) or an entire Subscription.

describe (resource_group: `RESOURCE_GROUP`, factory_name: 'FACTORY_NAME') do

resource_group and factory_name are required parameters.


Azure resource group where the targeted resource resides.
Azure factory name for which linked services are retrieved.


A list of the unique resource names.

Field: name

A list of Linked Services IDs.

Field: id

A list of properties for the resource.

Field: properties

The linked services provisioning state.

Field: provisioning_state

The type of linked service resource.

Field: linked_service_type

The linked service type of properties.

Field: type_properties


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


Test if any linked services exist in the resource group

describe azure_data_factory_linked_services(resource_group: `RESOURCE_GROUP`, factory_name: 'FACTORY_NAME') do
  it { should exist }
  its('names') { should include "factory_name" }

Test that there are not any linked services in a resource group

# Should not exist if no Linked Services are in the resource group.

describe azure_data_factory_linked_services(resource_group: `RESOURCE_GROUP`, factory_name: 'FACTORY_NAME') do
  it { should_not exist }

Filter linked services in a resource group by properties

describe azure_data_factory_linked_services(resource_group: `RESOURCE_GROUP`, factory_name: 'FACTORY_NAME') do
  its('names') { should include linked_service_name1 }
  its('types') { should include 'Microsoft.DataFactory/factories/linkedservices' }
  its('linked_service_types') { should include('MySql') }

Azure Permissions

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

Edit this page on GitHub

Thank you for your feedback!


Search Results