Skip to main content

azure_migrate_project Resource

Use the azure_migrate_project InSpec audit resource to test 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.

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.


name and resource_group is a required parameter.

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 projectto test.
Azure resource group that the targeted resource resides in.

The parameter set should be provided for a valid query:

  • resource_group and name


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

For properties applicable to all resources, such as type, name, id, 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 is pluralized and listed as collection.


Test That The migrate projectHas 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 projectis 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