Skip to main content

assets

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

Overview

Nameassets
TypeResource
Idazure.device_registry.assets

Fields

NameDatatypeDescription
descriptiontextfield from the properties object
assetNametextfield from the properties object
asset_endpoint_profile_reftextfield from the properties object
attributestextfield from the properties object
datasetstextfield from the properties object
default_datasets_configurationtextfield from the properties object
default_events_configurationtextfield from the properties object
default_topictextfield from the properties object
discovered_asset_refstextfield from the properties object
display_nametextfield from the properties object
documentation_uritextfield from the properties object
enabledtextfield from the properties object
eventstextfield from the properties object
extended_locationtextfield from the properties object
external_asset_idtextfield from the properties object
hardware_revisiontextfield from the properties object
locationtextThe geo-location where the resource lives
manufacturertextfield from the properties object
manufacturer_uritextfield from the properties object
modeltextfield from the properties object
product_codetextfield from the properties object
provisioning_statetextfield from the properties object
resourceGroupNametextfield from the properties object
serial_numbertextfield from the properties object
software_revisiontextfield from the properties object
statustextfield from the properties object
subscriptionIdtextfield from the properties object
tagstextResource tags.
uuidtextfield from the properties object
versiontextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
getSELECTassetName, resourceGroupName, subscriptionIdGet a Asset
list_by_resource_groupSELECTresourceGroupName, subscriptionIdList Asset resources by resource group
list_by_subscriptionSELECTsubscriptionIdList Asset resources by subscription ID
create_or_replaceINSERTassetName, resourceGroupName, subscriptionId, data__extendedLocationCreate a Asset
deleteDELETEassetName, resourceGroupName, subscriptionIdDelete a Asset
updateUPDATEassetName, resourceGroupName, subscriptionIdUpdate a Asset

SELECT examples

List Asset resources by subscription ID

SELECT
description,
assetName,
asset_endpoint_profile_ref,
attributes,
datasets,
default_datasets_configuration,
default_events_configuration,
default_topic,
discovered_asset_refs,
display_name,
documentation_uri,
enabled,
events,
extended_location,
external_asset_id,
hardware_revision,
location,
manufacturer,
manufacturer_uri,
model,
product_code,
provisioning_state,
resourceGroupName,
serial_number,
software_revision,
status,
subscriptionId,
tags,
uuid,
version
FROM azure.device_registry.vw_assets
WHERE subscriptionId = '{{ subscriptionId }}';

INSERT example

Use the following StackQL query and manifest file to create a new assets resource.

/*+ create */
INSERT INTO azure.device_registry.assets (
assetName,
resourceGroupName,
subscriptionId,
data__extendedLocation,
properties,
extendedLocation,
tags,
location
)
SELECT
'{{ assetName }}',
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ data__extendedLocation }}',
'{{ properties }}',
'{{ extendedLocation }}',
'{{ tags }}',
'{{ location }}'
;

UPDATE example

Updates a assets resource.

/*+ update */
UPDATE azure.device_registry.assets
SET
tags = '{{ tags }}',
properties = '{{ properties }}'
WHERE
assetName = '{{ assetName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';

DELETE example

Deletes the specified assets resource.

/*+ delete */
DELETE FROM azure.device_registry.assets
WHERE assetName = '{{ assetName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';