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.
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_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
#...
end
resource_group
and factory_name
are required parameters.
Parameters
resource_group
- Azure resource group where the targeted resource resides.
factory_name
- Azure factory name for which linked services are retrieved.
Properties
names
- A list of the unique resource names.
Field:
name
ids
- A list of Linked Services IDs.
Field:
id
properties
- A list of properties for the resource.
Field:
properties
provisioning_states
- The linked services provisioning state.
Field:
provisioning_state
linked_service_types
- The type of linked service resource.
Field:
linked_service_type
type_properties
- The linked service type of properties.
Field:
type_properties
Note
Examples
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" }
end
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 }
end
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') }
end
Azure permissions
Your Service Principal must be set up with at least a contributor
role on the subscription you wish to test.