1. Packages
  2. Azure Native v2
  3. API Docs
  4. datamigration
  5. File
These are the docs for Azure Native v2. We recommenend using the latest version, Azure Native v3.
Azure Native v2 v2.90.0 published on Thursday, Mar 27, 2025 by Pulumi

azure-native-v2.datamigration.File

Explore with Pulumi AI

These are the docs for Azure Native v2. We recommenend using the latest version, Azure Native v3.
Azure Native v2 v2.90.0 published on Thursday, Mar 27, 2025 by Pulumi

A file resource Azure REST API version: 2021-06-30. Prior API version in Azure Native 1.x: 2018-07-15-preview.

Other available API versions: 2022-03-30-preview, 2023-07-15-preview.

Example Usage

Files_CreateOrUpdate

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var file = new AzureNative.DataMigration.File("file", new()
    {
        FileName = "x114d023d8",
        GroupName = "DmsSdkRg",
        ProjectName = "DmsSdkProject",
        Properties = new AzureNative.DataMigration.Inputs.ProjectFilePropertiesArgs
        {
            FilePath = "DmsSdkFilePath/DmsSdkFile.sql",
        },
        ServiceName = "DmsSdkService",
    });

});
Copy
package main

import (
	datamigration "github.com/pulumi/pulumi-azure-native-sdk/datamigration/v2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := datamigration.NewFile(ctx, "file", &datamigration.FileArgs{
			FileName:    pulumi.String("x114d023d8"),
			GroupName:   pulumi.String("DmsSdkRg"),
			ProjectName: pulumi.String("DmsSdkProject"),
			Properties: &datamigration.ProjectFilePropertiesArgs{
				FilePath: pulumi.String("DmsSdkFilePath/DmsSdkFile.sql"),
			},
			ServiceName: pulumi.String("DmsSdkService"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.datamigration.File;
import com.pulumi.azurenative.datamigration.FileArgs;
import com.pulumi.azurenative.datamigration.inputs.ProjectFilePropertiesArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var file = new File("file", FileArgs.builder()
            .fileName("x114d023d8")
            .groupName("DmsSdkRg")
            .projectName("DmsSdkProject")
            .properties(ProjectFilePropertiesArgs.builder()
                .filePath("DmsSdkFilePath/DmsSdkFile.sql")
                .build())
            .serviceName("DmsSdkService")
            .build());

    }
}
Copy
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const file = new azure_native.datamigration.File("file", {
    fileName: "x114d023d8",
    groupName: "DmsSdkRg",
    projectName: "DmsSdkProject",
    properties: {
        filePath: "DmsSdkFilePath/DmsSdkFile.sql",
    },
    serviceName: "DmsSdkService",
});
Copy
import pulumi
import pulumi_azure_native as azure_native

file = azure_native.datamigration.File("file",
    file_name="x114d023d8",
    group_name="DmsSdkRg",
    project_name="DmsSdkProject",
    properties={
        "file_path": "DmsSdkFilePath/DmsSdkFile.sql",
    },
    service_name="DmsSdkService")
Copy
resources:
  file:
    type: azure-native:datamigration:File
    properties:
      fileName: x114d023d8
      groupName: DmsSdkRg
      projectName: DmsSdkProject
      properties:
        filePath: DmsSdkFilePath/DmsSdkFile.sql
      serviceName: DmsSdkService
Copy

Create File Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new File(name: string, args: FileArgs, opts?: CustomResourceOptions);
@overload
def File(resource_name: str,
         args: FileArgs,
         opts: Optional[ResourceOptions] = None)

@overload
def File(resource_name: str,
         opts: Optional[ResourceOptions] = None,
         group_name: Optional[str] = None,
         project_name: Optional[str] = None,
         service_name: Optional[str] = None,
         file_name: Optional[str] = None,
         properties: Optional[ProjectFilePropertiesArgs] = None)
func NewFile(ctx *Context, name string, args FileArgs, opts ...ResourceOption) (*File, error)
public File(string name, FileArgs args, CustomResourceOptions? opts = null)
public File(String name, FileArgs args)
public File(String name, FileArgs args, CustomResourceOptions options)
type: azure-native:datamigration:File
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. FileArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. FileArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. FileArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. FileArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. FileArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var fileResource = new AzureNative.Datamigration.File("fileResource", new()
{
    GroupName = "string",
    ProjectName = "string",
    ServiceName = "string",
    FileName = "string",
    Properties = 
    {
        { "extension", "string" },
        { "filePath", "string" },
        { "mediaType", "string" },
    },
});
Copy
example, err := datamigration.NewFile(ctx, "fileResource", &datamigration.FileArgs{
	GroupName:   "string",
	ProjectName: "string",
	ServiceName: "string",
	FileName:    "string",
	Properties: map[string]interface{}{
		"extension": "string",
		"filePath":  "string",
		"mediaType": "string",
	},
})
Copy
var fileResource = new File("fileResource", FileArgs.builder()
    .groupName("string")
    .projectName("string")
    .serviceName("string")
    .fileName("string")
    .properties(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
    .build());
Copy
file_resource = azure_native.datamigration.File("fileResource",
    group_name=string,
    project_name=string,
    service_name=string,
    file_name=string,
    properties={
        extension: string,
        filePath: string,
        mediaType: string,
    })
Copy
const fileResource = new azure_native.datamigration.File("fileResource", {
    groupName: "string",
    projectName: "string",
    serviceName: "string",
    fileName: "string",
    properties: {
        extension: "string",
        filePath: "string",
        mediaType: "string",
    },
});
Copy
type: azure-native:datamigration:File
properties:
    fileName: string
    groupName: string
    projectName: string
    properties:
        extension: string
        filePath: string
        mediaType: string
    serviceName: string
Copy

File Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The File resource accepts the following input properties:

GroupName
This property is required.
Changes to this property will trigger replacement.
string
Name of the resource group
ProjectName
This property is required.
Changes to this property will trigger replacement.
string
Name of the project
ServiceName
This property is required.
Changes to this property will trigger replacement.
string
Name of the service
FileName Changes to this property will trigger replacement. string
Name of the File
Properties Pulumi.AzureNative.DataMigration.Inputs.ProjectFileProperties
Custom file properties
GroupName
This property is required.
Changes to this property will trigger replacement.
string
Name of the resource group
ProjectName
This property is required.
Changes to this property will trigger replacement.
string
Name of the project
ServiceName
This property is required.
Changes to this property will trigger replacement.
string
Name of the service
FileName Changes to this property will trigger replacement. string
Name of the File
Properties ProjectFilePropertiesArgs
Custom file properties
groupName
This property is required.
Changes to this property will trigger replacement.
String
Name of the resource group
projectName
This property is required.
Changes to this property will trigger replacement.
String
Name of the project
serviceName
This property is required.
Changes to this property will trigger replacement.
String
Name of the service
fileName Changes to this property will trigger replacement. String
Name of the File
properties ProjectFileProperties
Custom file properties
groupName
This property is required.
Changes to this property will trigger replacement.
string
Name of the resource group
projectName
This property is required.
Changes to this property will trigger replacement.
string
Name of the project
serviceName
This property is required.
Changes to this property will trigger replacement.
string
Name of the service
fileName Changes to this property will trigger replacement. string
Name of the File
properties ProjectFileProperties
Custom file properties
group_name
This property is required.
Changes to this property will trigger replacement.
str
Name of the resource group
project_name
This property is required.
Changes to this property will trigger replacement.
str
Name of the project
service_name
This property is required.
Changes to this property will trigger replacement.
str
Name of the service
file_name Changes to this property will trigger replacement. str
Name of the File
properties ProjectFilePropertiesArgs
Custom file properties
groupName
This property is required.
Changes to this property will trigger replacement.
String
Name of the resource group
projectName
This property is required.
Changes to this property will trigger replacement.
String
Name of the project
serviceName
This property is required.
Changes to this property will trigger replacement.
String
Name of the service
fileName Changes to this property will trigger replacement. String
Name of the File
properties Property Map
Custom file properties

Outputs

All input properties are implicitly available as output properties. Additionally, the File resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Name string
Resource name.
SystemData Pulumi.AzureNative.DataMigration.Outputs.SystemDataResponse
Metadata pertaining to creation and last modification of the resource.
Type string
Resource type.
Etag string
HTTP strong entity tag value. This is ignored if submitted.
Id string
The provider-assigned unique ID for this managed resource.
Name string
Resource name.
SystemData SystemDataResponse
Metadata pertaining to creation and last modification of the resource.
Type string
Resource type.
Etag string
HTTP strong entity tag value. This is ignored if submitted.
id String
The provider-assigned unique ID for this managed resource.
name String
Resource name.
systemData SystemDataResponse
Metadata pertaining to creation and last modification of the resource.
type String
Resource type.
etag String
HTTP strong entity tag value. This is ignored if submitted.
id string
The provider-assigned unique ID for this managed resource.
name string
Resource name.
systemData SystemDataResponse
Metadata pertaining to creation and last modification of the resource.
type string
Resource type.
etag string
HTTP strong entity tag value. This is ignored if submitted.
id str
The provider-assigned unique ID for this managed resource.
name str
Resource name.
system_data SystemDataResponse
Metadata pertaining to creation and last modification of the resource.
type str
Resource type.
etag str
HTTP strong entity tag value. This is ignored if submitted.
id String
The provider-assigned unique ID for this managed resource.
name String
Resource name.
systemData Property Map
Metadata pertaining to creation and last modification of the resource.
type String
Resource type.
etag String
HTTP strong entity tag value. This is ignored if submitted.

Supporting Types

ProjectFileProperties
, ProjectFilePropertiesArgs

Extension string
Optional File extension. If submitted it should not have a leading period and must match the extension from filePath.
FilePath string
Relative path of this file resource. This property can be set when creating or updating the file resource.
MediaType string
File content type. This property can be modified to reflect the file content type.
Extension string
Optional File extension. If submitted it should not have a leading period and must match the extension from filePath.
FilePath string
Relative path of this file resource. This property can be set when creating or updating the file resource.
MediaType string
File content type. This property can be modified to reflect the file content type.
extension String
Optional File extension. If submitted it should not have a leading period and must match the extension from filePath.
filePath String
Relative path of this file resource. This property can be set when creating or updating the file resource.
mediaType String
File content type. This property can be modified to reflect the file content type.
extension string
Optional File extension. If submitted it should not have a leading period and must match the extension from filePath.
filePath string
Relative path of this file resource. This property can be set when creating or updating the file resource.
mediaType string
File content type. This property can be modified to reflect the file content type.
extension str
Optional File extension. If submitted it should not have a leading period and must match the extension from filePath.
file_path str
Relative path of this file resource. This property can be set when creating or updating the file resource.
media_type str
File content type. This property can be modified to reflect the file content type.
extension String
Optional File extension. If submitted it should not have a leading period and must match the extension from filePath.
filePath String
Relative path of this file resource. This property can be set when creating or updating the file resource.
mediaType String
File content type. This property can be modified to reflect the file content type.

ProjectFilePropertiesResponse
, ProjectFilePropertiesResponseArgs

LastModified This property is required. string
Modification DateTime.
Size This property is required. double
File size.
Extension string
Optional File extension. If submitted it should not have a leading period and must match the extension from filePath.
FilePath string
Relative path of this file resource. This property can be set when creating or updating the file resource.
MediaType string
File content type. This property can be modified to reflect the file content type.
LastModified This property is required. string
Modification DateTime.
Size This property is required. float64
File size.
Extension string
Optional File extension. If submitted it should not have a leading period and must match the extension from filePath.
FilePath string
Relative path of this file resource. This property can be set when creating or updating the file resource.
MediaType string
File content type. This property can be modified to reflect the file content type.
lastModified This property is required. String
Modification DateTime.
size This property is required. Double
File size.
extension String
Optional File extension. If submitted it should not have a leading period and must match the extension from filePath.
filePath String
Relative path of this file resource. This property can be set when creating or updating the file resource.
mediaType String
File content type. This property can be modified to reflect the file content type.
lastModified This property is required. string
Modification DateTime.
size This property is required. number
File size.
extension string
Optional File extension. If submitted it should not have a leading period and must match the extension from filePath.
filePath string
Relative path of this file resource. This property can be set when creating or updating the file resource.
mediaType string
File content type. This property can be modified to reflect the file content type.
last_modified This property is required. str
Modification DateTime.
size This property is required. float
File size.
extension str
Optional File extension. If submitted it should not have a leading period and must match the extension from filePath.
file_path str
Relative path of this file resource. This property can be set when creating or updating the file resource.
media_type str
File content type. This property can be modified to reflect the file content type.
lastModified This property is required. String
Modification DateTime.
size This property is required. Number
File size.
extension String
Optional File extension. If submitted it should not have a leading period and must match the extension from filePath.
filePath String
Relative path of this file resource. This property can be set when creating or updating the file resource.
mediaType String
File content type. This property can be modified to reflect the file content type.

SystemDataResponse
, SystemDataResponseArgs

CreatedAt string
The timestamp of resource creation (UTC).
CreatedBy string
The identity that created the resource.
CreatedByType string
The type of identity that created the resource.
LastModifiedAt string
The timestamp of resource last modification (UTC)
LastModifiedBy string
The identity that last modified the resource.
LastModifiedByType string
The type of identity that last modified the resource.
CreatedAt string
The timestamp of resource creation (UTC).
CreatedBy string
The identity that created the resource.
CreatedByType string
The type of identity that created the resource.
LastModifiedAt string
The timestamp of resource last modification (UTC)
LastModifiedBy string
The identity that last modified the resource.
LastModifiedByType string
The type of identity that last modified the resource.
createdAt String
The timestamp of resource creation (UTC).
createdBy String
The identity that created the resource.
createdByType String
The type of identity that created the resource.
lastModifiedAt String
The timestamp of resource last modification (UTC)
lastModifiedBy String
The identity that last modified the resource.
lastModifiedByType String
The type of identity that last modified the resource.
createdAt string
The timestamp of resource creation (UTC).
createdBy string
The identity that created the resource.
createdByType string
The type of identity that created the resource.
lastModifiedAt string
The timestamp of resource last modification (UTC)
lastModifiedBy string
The identity that last modified the resource.
lastModifiedByType string
The type of identity that last modified the resource.
created_at str
The timestamp of resource creation (UTC).
created_by str
The identity that created the resource.
created_by_type str
The type of identity that created the resource.
last_modified_at str
The timestamp of resource last modification (UTC)
last_modified_by str
The identity that last modified the resource.
last_modified_by_type str
The type of identity that last modified the resource.
createdAt String
The timestamp of resource creation (UTC).
createdBy String
The identity that created the resource.
createdByType String
The type of identity that created the resource.
lastModifiedAt String
The timestamp of resource last modification (UTC)
lastModifiedBy String
The identity that last modified the resource.
lastModifiedByType String
The type of identity that last modified the resource.

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:datamigration:File x114d023d8 /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName} 
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
azure-native-v2 pulumi/pulumi-azure-native
License
Apache-2.0
These are the docs for Azure Native v2. We recommenend using the latest version, Azure Native v3.
Azure Native v2 v2.90.0 published on Thursday, Mar 27, 2025 by Pulumi