Skip to main content

notification_channels

Creates, updates, deletes, gets or lists a notification_channels resource.

Overview

Namenotification_channels
TypeResource
Idazure.dev_test_labs.notification_channels

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe identifier of the resource.
namestringThe name of the resource.
createdDatestring (date-time)The creation date of the notification channel.
descriptionstringDescription of notification.
emailRecipientstringThe email recipient to send notifications to (can be a list of semi-colon separated email addresses).
eventsarrayThe list of event for which this notification is enabled.
locationstringThe location of the resource.
notificationLocalestringThe locale to use when sending a notification (fallback for unsupported languages is EN).
provisioningStatestringThe provisioning status of the resource.
tagsobjectThe tags of the resource.
typestringThe type of the resource.
uniqueIdentifierstringThe unique immutable identifier of a resource (Guid).
webHookUrlstringThe webhook URL to send notifications to.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, lab_name, name, subscription_id$expandGet notification channel.
listselectresource_group_name, lab_name, subscription_id$expand, $filter, $top, $orderbyList notification channels in a given lab.
create_or_updateinsertresource_group_name, lab_name, name, subscription_idCreate or replace an existing notification channel.
updateupdateresource_group_name, lab_name, name, subscription_idAllows modifying tags of notification channels. All other properties will be ignored.
create_or_updatereplaceresource_group_name, lab_name, name, subscription_idCreate or replace an existing notification channel.
deletedeleteresource_group_name, lab_name, name, subscription_idDelete notification channel.
notifyexecresource_group_name, lab_name, name, subscription_idSend notification to provided channel.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
lab_namestringThe name of the lab. Required.
namestringThe name of the notification channel. Required.
resource_group_namestringThe name of the resource group. Required.
subscription_idstring
$expandstringSpecify the $expand query. Example: 'properties($select=webHookUrl)'. Default value is None.
$filterstringThe filter to apply to the operation. Example: '$filter=contains(name,'myName'). Default value is None.
$orderbystringThe ordering expression for the results, using OData notation. Example: '$orderby=name desc'. Default value is None.
$topintegerThe maximum number of resources to return from the operation. Example: '$top=10'. Default value is None.

SELECT examples

Get notification channel.

SELECT
id,
name,
createdDate,
description,
emailRecipient,
events,
location,
notificationLocale,
provisioningState,
tags,
type,
uniqueIdentifier,
webHookUrl
FROM azure.dev_test_labs.notification_channels
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND lab_name = '{{ lab_name }}' -- required
AND name = '{{ name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND $expand = '{{ $expand }}'
;

INSERT examples

Create or replace an existing notification channel.

INSERT INTO azure.dev_test_labs.notification_channels (
location,
tags,
properties,
resource_group_name,
lab_name,
name,
subscription_id
)
SELECT
'{{ location }}',
'{{ tags }}',
'{{ properties }}',
'{{ resource_group_name }}',
'{{ lab_name }}',
'{{ name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
location,
properties,
tags,
type
;

UPDATE examples

Allows modifying tags of notification channels. All other properties will be ignored.

UPDATE azure.dev_test_labs.notification_channels
SET
-- No updatable properties
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND lab_name = '{{ lab_name }}' --required
AND name = '{{ name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
location,
properties,
tags,
type;

REPLACE examples

Create or replace an existing notification channel.

REPLACE azure.dev_test_labs.notification_channels
SET
location = '{{ location }}',
tags = '{{ tags }}',
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND lab_name = '{{ lab_name }}' --required
AND name = '{{ name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
location,
properties,
tags,
type;

DELETE examples

Delete notification channel.

DELETE FROM azure.dev_test_labs.notification_channels
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND lab_name = '{{ lab_name }}' --required
AND name = '{{ name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;

Lifecycle Methods

Send notification to provided channel.

EXEC azure.dev_test_labs.notification_channels.notify 
@resource_group_name='{{ resource_group_name }}' --required,
@lab_name='{{ lab_name }}' --required,
@name='{{ name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;