Skip to main content

files

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

Overview

Namefiles
TypeResource
Idazure.support.files

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
namestringThe name of the resource.
chunkSizeintegerSize of each chunk. The size of each chunk should be provided in bytes and must not exceed 2.5 megabytes (MB).
createdOnstring (date-time)Time in UTC (ISO 8601 format) when file workspace was created.
fileSizeintegerSize of the file to be uploaded. The file size must not exceed 5 MB and should be provided in bytes.
numberOfChunksintegerNumber of chunks to be uploaded. The maximum number of allowed chunks is 2.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
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
getselectfile_workspace_name, file_name, subscription_idReturns details of a specific file in a work space.
listselectfile_workspace_name, subscription_idLists all the Files information under a workspace for an Azure subscription.
createinsertfile_workspace_name, file_name, subscription_idCreates a new file under a workspace for the specified subscription.
uploadexecfile_workspace_name, file_name, subscription_idThis API allows you to upload content to a file.

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
file_namestringFile Name. Required.
file_workspace_namestringFile WorkspaceName. Required.
subscription_idstring

SELECT examples

Returns details of a specific file in a work space.

SELECT
id,
name,
chunkSize,
createdOn,
fileSize,
numberOfChunks,
systemData,
type
FROM azure.support.files
WHERE file_workspace_name = '{{ file_workspace_name }}' -- required
AND file_name = '{{ file_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Creates a new file under a workspace for the specified subscription.

INSERT INTO azure.support.files (
properties,
file_workspace_name,
file_name,
subscription_id
)
SELECT
'{{ properties }}',
'{{ file_workspace_name }}',
'{{ file_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
properties,
systemData,
type
;

Lifecycle Methods

This API allows you to upload content to a file.

EXEC azure.support.files.upload 
@file_workspace_name='{{ file_workspace_name }}' --required,
@file_name='{{ file_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"content": "{{ content }}",
"chunkIndex": {{ chunkIndex }}
}'
;