Skip to main content

azure_synapse_notebook Resource

[edit on GitHub]

Use the azure_synapse_notebook InSpec audit resource to test properties related to a Azure Synapse notebook in a Synapse workspace.

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

This resource requires the endpoint and name parameters for a valid query.

describe azure_synapse_notebook(endpoint: 'WORKSPACE_DEVELOPMENT_ENDPOINT', name: 'NOTEBOOK_NAME') do
  it { should exist }
end
describe azure_synapse_notebook(endpoint: 'WORKSPACE_DEVELOPMENT_ENDPOINT', name: 'NOTEBOOK_NAME') do
  it                                      { should exist }
  its('name')                             { should eq 'NOTEBOOK_NAME' }
  its('type')                             { should eq 'Microsoft.Synapse/workspaces/notebooks' }
  its('properties.sessionProperties.executorCores')          { should eq CORE_NUMBER }
end

Parameters

endpoint
The Azure Synapse workspace development endpoint.
name
Name of the Azure Synapse Notebook to test.

This resource requires the endpoint and name parameters for a valid query.

Properties

id
Fully qualified resource ID for the resource.
name
The name of the resource.
type
The type of the resource.
etag
The resource Etag.
properties
The properties of the notebook.

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

Also, refer to Azure documentation for other available properties.

Access any property in the response by separating the key names with a period (.).

Examples

Test that there are four cores for each executor.

describe azure_synapse_notebook(endpoint: 'WORKSPACE_DEVELOPMENT_ENDPOINT', name: 'NOTEBOOK_NAME') do
  its('properties.sessionProperties.executorCores') { should eq 4 }
end

Test that the notebook uses the Python kernel.

describe azure_synapse_notebook(endpoint: 'WORKSPACE_DEVELOPMENT_ENDPOINT', name: 'NOTEBOOK_NAME') do
  its('properties.metadata.language_info.name') { should 'Python' }
end

Matchers

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

exists

If a Synapse Notebook is found it will exist

describe azure_synapse_notebook(endpoint: 'WORKSPACE_DEVELOPMENT_ENDPOINT', name: 'NOTEBOOK_NAME') do
  it { should exist }
end

Synapse Notebooks that aren’t found will not exist

describe azure_synapse_notebook(endpoint: 'WORKSPACE_DEVELOPMENT_ENDPOINT', name: 'NOTEBOOK_NAME') do
  it { should_not exist }
end

Azure Permissions

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

Was this page helpful?

×









Search Results