Skip to main content

azure_migrate_project Resource

Use the azure_migrate_project InSpec audit resource to test the properties related to an Azure Migrate project.

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, the latest version will be used. For more information, refer to azure_generic_resource.

Unless defined, azure_cloud global endpoint and default values for the HTTP client will be used. 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.


name and resource_group are required parameters.

describe azure_migrate_project(resource_group: 'RESOURCE_GROUP', name: 'PROJECT_NAME') do
  it                                      { should exist }
  its('name')                             { should eq 'zoneA_migrate_project' }
  its('type')                             { should eq 'Microsoft.Migrate/MigrateProjects' }
describe azure_migrate_project(resource_group: 'RESOURCE_GROUP', name: 'PROJECT_NAME') do
  it  { should exist }


Name of the Azure Migrate project to test.
Azure resource group where the targeted resource resides.

The parameter set that should be provided for a valid query is resource_group and name.


Path reference to the Migrate project.
The eTag for concurrency control.
Unique name of a Migrate project.
Type of the object. Microsoft.Migrate/MigrateProject.
The nested properties.

For properties applicable to all resources, such as type, name, id, and properties, refer to azure_generic_resource.

Also, refer to the Azure documentation for other available properties.

Any attribute in the response nested within properties may be accessed with the key names separated by dots (.), and attributes nested in the assessment data are pluralized and listed as a collection.


Test that The Migrate project has a server instance type

describe azure_migrate_project(resource_group: 'RESOURCE_GROUP', name: 'PROJECT_NAME') do
  its('properties.summary.servers.instanceType') { should eq 'Servers' }


This InSpec audit resource has the following special matchers. For a full list of available matchers, please visit our Universal Matchers page.


# If a Migrate project is found, it exists.

describe azure_migrate_project(resource_group: 'RESOURCE_GROUP', name: 'PROJECT_NAME') do
  it { should exist }

# If Migrate project is not found, it does not exist.

describe azure_migrate_project(resource_group: 'RESOURCE_GROUP', name: 'PROJECT_NAME') do
  it { should_not exist }

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