Skip to main content

files

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

Overview

Namefiles
TypeResource
Idazure.data_migration.files

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.
etagstringHTTP strong entity tag value. This is ignored if submitted.
extensionstringOptional File extension. If submitted it should not have a leading period and must match the extension from filePath.
filePathstringRelative path of this file resource. This property can be set when creating or updating the file resource.
lastModifiedstring (date-time)Modification DateTime.
mediaTypestringFile content type. This property can be modified to reflect the file content type.
sizeintegerFile size.
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
getselectgroup_name, service_name, project_name, file_name, subscription_idGet file information. The files resource is a nested, proxy-only resource representing a file stored under the project resource. This method retrieves information about a file.
listselectgroup_name, service_name, project_name, subscription_idGet files in a project. The project resource is a nested resource representing a stored migration project. This method returns a list of files owned by a project resource.
create_or_updateinsertgroup_name, service_name, project_name, file_name, subscription_idCreate a file resource. The PUT method creates a new file or updates an existing one.
updateupdategroup_name, service_name, project_name, file_name, subscription_idUpdate a file. This method updates an existing file.
create_or_updatereplacegroup_name, service_name, project_name, file_name, subscription_idCreate a file resource. The PUT method creates a new file or updates an existing one.
deletedeletegroup_name, service_name, project_name, file_name, subscription_idDelete file. This method deletes a file.
readexecgroup_name, service_name, project_name, file_name, subscription_idRequest storage information for downloading the file content. This method is used for requesting storage information using which contents of the file can be downloaded.
read_writeexecgroup_name, service_name, project_name, file_name, subscription_idRequest information for reading and writing file content. This method is used for requesting information for reading and writing the file content.

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_namestringName of the File. Required.
group_namestringName of the resource group. Required.
project_namestringName of the project. Required.
service_namestringName of the service. Required.
subscription_idstring

SELECT examples

Get file information. The files resource is a nested, proxy-only resource representing a file stored under the project resource. This method retrieves information about a file.

SELECT
id,
name,
etag,
extension,
filePath,
lastModified,
mediaType,
size,
systemData,
type
FROM azure.data_migration.files
WHERE group_name = '{{ group_name }}' -- required
AND service_name = '{{ service_name }}' -- required
AND project_name = '{{ project_name }}' -- required
AND file_name = '{{ file_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Create a file resource. The PUT method creates a new file or updates an existing one.

INSERT INTO azure.data_migration.files (
properties,
etag,
group_name,
service_name,
project_name,
file_name,
subscription_id
)
SELECT
'{{ properties }}',
'{{ etag }}',
'{{ group_name }}',
'{{ service_name }}',
'{{ project_name }}',
'{{ file_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
etag,
properties,
systemData,
type
;

UPDATE examples

Update a file. This method updates an existing file.

UPDATE azure.data_migration.files
SET
properties = '{{ properties }}',
etag = '{{ etag }}'
WHERE
group_name = '{{ group_name }}' --required
AND service_name = '{{ service_name }}' --required
AND project_name = '{{ project_name }}' --required
AND file_name = '{{ file_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
etag,
properties,
systemData,
type;

REPLACE examples

Create a file resource. The PUT method creates a new file or updates an existing one.

REPLACE azure.data_migration.files
SET
properties = '{{ properties }}',
etag = '{{ etag }}'
WHERE
group_name = '{{ group_name }}' --required
AND service_name = '{{ service_name }}' --required
AND project_name = '{{ project_name }}' --required
AND file_name = '{{ file_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
etag,
properties,
systemData,
type;

DELETE examples

Delete file. This method deletes a file.

DELETE FROM azure.data_migration.files
WHERE group_name = '{{ group_name }}' --required
AND service_name = '{{ service_name }}' --required
AND project_name = '{{ project_name }}' --required
AND file_name = '{{ file_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;

Lifecycle Methods

Request storage information for downloading the file content. This method is used for requesting storage information using which contents of the file can be downloaded.

EXEC azure.data_migration.files.read 
@group_name='{{ group_name }}' --required,
@service_name='{{ service_name }}' --required,
@project_name='{{ project_name }}' --required,
@file_name='{{ file_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;