Skip to main content

assets

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

Overview

Nameassets
TypeResource
Idazure_extras.media.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.
alternateIdstringThe alternate ID of the Asset.
assetIdstringThe Asset ID.
containerstringThe name of the asset blob container.
createdstring (date-time)The creation date of the Asset.
descriptionstringThe Asset description.
lastModifiedstring (date-time)The last modified date of the Asset.
storageAccountNamestringThe name of the storage account.
storageEncryptionFormatstringThe Asset encryption format. One of None or MediaStorageEncryption. Known values are: "None" and "MediaStorageClientEncryption".
systemDataobjectThe system metadata relating to this resource.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, account_name, asset_name, subscription_idGet an Asset. Get the details of an Asset in the Media Services account.
listselectresource_group_name, account_name, subscription_id$filter, $top, $orderbyList Assets. List Assets in the Media Services account with optional filtering and ordering.
create_or_updateinsertresource_group_name, account_name, asset_name, subscription_idCreate or update an Asset. Creates or updates an Asset in the Media Services account.
updateupdateresource_group_name, account_name, asset_name, subscription_idUpdate an Asset. Updates an existing Asset in the Media Services account.
create_or_updatereplaceresource_group_name, account_name, asset_name, subscription_idCreate or update an Asset. Creates or updates an Asset in the Media Services account.
deletedeleteresource_group_name, account_name, asset_name, subscription_idDelete an Asset. Deletes an Asset in the Media Services account.
list_container_sasexecresource_group_name, account_name, asset_name, subscription_idList the Asset URLs. Lists storage container URLs with shared access signatures (SAS) for uploading and downloading Asset content. The signatures are derived from the storage account keys.
list_streaming_locatorsexecresource_group_name, account_name, asset_name, subscription_idList Streaming Locators. Lists Streaming Locators which are associated with this asset.
get_encryption_keyexecresource_group_name, account_name, asset_name, subscription_idGets the Asset storage key. Gets the Asset storage encryption keys used to decrypt content created by version 2 of the Media Services API.

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
account_namestringThe Media Services account name. Required.
asset_namestringThe Asset name. Required.
resource_group_namestringThe name of the resource group within the Azure subscription. Required.
subscription_idstring
$filterstringRestricts the set of items returned. Default value is None.
$orderbystringSpecifies the key by which the result collection should be ordered. Default value is None.
$topintegerSpecifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. Default value is None.

SELECT examples

Get an Asset. Get the details of an Asset in the Media Services account.

SELECT
id,
name,
alternateId,
assetId,
container,
created,
description,
lastModified,
storageAccountName,
storageEncryptionFormat,
systemData,
type
FROM azure_extras.media.assets
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND account_name = '{{ account_name }}' -- required
AND asset_name = '{{ asset_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Create or update an Asset. Creates or updates an Asset in the Media Services account.

INSERT INTO azure_extras.media.assets (
properties,
resource_group_name,
account_name,
asset_name,
subscription_id
)
SELECT
'{{ properties }}',
'{{ resource_group_name }}',
'{{ account_name }}',
'{{ asset_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
properties,
systemData,
type
;

UPDATE examples

Update an Asset. Updates an existing Asset in the Media Services account.

UPDATE azure_extras.media.assets
SET
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND account_name = '{{ account_name }}' --required
AND asset_name = '{{ asset_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
properties,
systemData,
type;

REPLACE examples

Create or update an Asset. Creates or updates an Asset in the Media Services account.

REPLACE azure_extras.media.assets
SET
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND account_name = '{{ account_name }}' --required
AND asset_name = '{{ asset_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
properties,
systemData,
type;

DELETE examples

Delete an Asset. Deletes an Asset in the Media Services account.

DELETE FROM azure_extras.media.assets
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND account_name = '{{ account_name }}' --required
AND asset_name = '{{ asset_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;

Lifecycle Methods

List the Asset URLs. Lists storage container URLs with shared access signatures (SAS) for uploading and downloading Asset content. The signatures are derived from the storage account keys.

EXEC azure_extras.media.assets.list_container_sas 
@resource_group_name='{{ resource_group_name }}' --required,
@account_name='{{ account_name }}' --required,
@asset_name='{{ asset_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"permissions": "{{ permissions }}",
"expiryTime": "{{ expiryTime }}"
}'
;