Skip to main content

assets

Creates, updates, deletes, gets or lists an assets resource.

Overview

Nameassets
TypeResource
Idazure.device_registry.assets

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
assetEndpointProfileRefstringA reference to the asset endpoint profile (connection information) used by brokers to connect to an endpoint that provides data points for this asset. Must provide asset endpoint profile name. Required.
attributesobjectA set of key-value pairs that contain custom attributes set by the customer.
datasetsarrayArray of datasets that are part of the asset. Each dataset describes the data points that make up the set.
defaultDatasetsConfigurationstringStringified JSON that contains connector-specific default configuration for all datasets. Each dataset can have its own configuration that overrides the default settings here.
defaultEventsConfigurationstringStringified JSON that contains connector-specific default configuration for all events. Each event can have its own configuration that overrides the default settings here.
defaultTopicobjectObject that describes the default topic information for the asset.
descriptionstringHuman-readable description of the asset.
discoveredAssetRefsarrayReference to a list of discovered assets. Populated only if the asset has been created from discovery flow. Discovered asset names must be provided.
displayNamestringHuman-readable display name.
documentationUristringReference to the documentation.
enabledbooleanEnabled/Disabled status of the asset.
eventsarrayArray of events that are part of the asset. Each event can have per-event configuration.
extendedLocationobjectThe extended location. Required.
externalAssetIdstringAsset id provided by the customer.
hardwareRevisionstringRevision number of the hardware.
locationstringThe geo-location where the resource lives. Required.
manufacturerstringAsset manufacturer name.
manufacturerUristringAsset manufacturer URI.
modelstringAsset model name.
productCodestringAsset product code.
provisioningStatestringProvisioning state of the resource. Known values are: "Succeeded", "Failed", "Canceled", "Accepted", and "Deleting". (Succeeded, Failed, Canceled, Accepted, Deleting)
serialNumberstringAsset serial number.
softwareRevisionstringRevision number of the software.
statusobjectRead only object to reflect changes that have occurred on the Edge. Similar to Kubernetes status property for custom resources.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
tagsobjectResource tags.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".
uuidstringGlobally unique, immutable, non-reusable id.
versionintegerAn integer that is incremented each time the resource is modified.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, asset_name, subscription_idGet a Asset.
list_by_resource_groupselectresource_group_name, subscription_idList Asset resources by resource group.
list_by_subscriptionselectsubscription_idList Asset resources by subscription ID.
create_or_replaceinsertresource_group_name, asset_name, subscription_id, location, extendedLocationCreate a Asset.
updateupdateresource_group_name, asset_name, subscription_idUpdate a Asset.
create_or_replacereplaceresource_group_name, asset_name, subscription_id, location, extendedLocationCreate a Asset.
deletedeleteresource_group_name, asset_name, subscription_idDelete a Asset.

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
asset_namestringAsset name parameter. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
subscription_idstring

SELECT examples

Get a Asset.

SELECT
id,
name,
assetEndpointProfileRef,
attributes,
datasets,
defaultDatasetsConfiguration,
defaultEventsConfiguration,
defaultTopic,
description,
discoveredAssetRefs,
displayName,
documentationUri,
enabled,
events,
extendedLocation,
externalAssetId,
hardwareRevision,
location,
manufacturer,
manufacturerUri,
model,
productCode,
provisioningState,
serialNumber,
softwareRevision,
status,
systemData,
tags,
type,
uuid,
version
FROM azure.device_registry.assets
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND asset_name = '{{ asset_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Create a Asset.

INSERT INTO azure.device_registry.assets (
tags,
location,
properties,
extendedLocation,
resource_group_name,
asset_name,
subscription_id
)
SELECT
'{{ tags }}',
'{{ location }}' /* required */,
'{{ properties }}',
'{{ extendedLocation }}' /* required */,
'{{ resource_group_name }}',
'{{ asset_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
extendedLocation,
location,
properties,
systemData,
tags,
type
;

UPDATE examples

Update a Asset.

UPDATE azure.device_registry.assets
SET
tags = '{{ tags }}',
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND asset_name = '{{ asset_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
extendedLocation,
location,
properties,
systemData,
tags,
type;

REPLACE examples

Create a Asset.

REPLACE azure.device_registry.assets
SET
tags = '{{ tags }}',
location = '{{ location }}',
properties = '{{ properties }}',
extendedLocation = '{{ extendedLocation }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND asset_name = '{{ asset_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND location = '{{ location }}' --required
AND extendedLocation = '{{ extendedLocation }}' --required
RETURNING
id,
name,
extendedLocation,
location,
properties,
systemData,
tags,
type;

DELETE examples

Delete a Asset.

DELETE FROM azure.device_registry.assets
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND asset_name = '{{ asset_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;