你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

New-AzBatchResourceFile

Creates a Resource File for usage by New-AzBatchTask.

语法

HttpUrl (默认值)

New-AzBatchResourceFile
    -HttpUrl <String>
    -FilePath <String>
    [-FileMode <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

StorageContainerUrl

New-AzBatchResourceFile
    -StorageContainerUrl <String>
    [-FilePath <String>]
    [-FileMode <String>]
    [-BlobPrefix <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

AutoStorageContainerName

New-AzBatchResourceFile
    -AutoStorageContainerName <String>
    [-FilePath <String>]
    [-FileMode <String>]
    [-BlobPrefix <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

说明

Creates a Resource File for usage by New-AzBatchTask.

示例

Example 1: Create a resource file from an HTTP URL pointing at a single file

$file = New-AzBatchResourceFile -HttpUrl "https://testacct.blob.core.windows.net/" -FilePath "file1"
New-AzBatchTask -JobId "Job-000001" -Id "Task23" -CommandLine "cmd /c dir /s" -ResourceFiles $file -BatchContext $Context

Creates a PSResourceFile referencing an HTTP url.

Example 2: Create a resource file from an Azure Storage container URL

$file = New-AzBatchResourceFile -StorageContainerUrl "https://testacct.blob.core.windows.net/mycontainer" -FilePath "myfolder"
New-AzBatchTask -JobId "Job-000001" -Id "Task23" -CommandLine "cmd /c dir /s" -ResourceFiles $file -BatchContext $Context

Creates a PSResourceFile referencing an Azure Storage container URL. All files in the container will be downloaded to the specified folder.

Example 3: Create a resource file from an Auto Storage container name

$file = New-AzBatchResourceFile -AutoStorageContainerName "mycontainer" -FilePath "myfolder"
New-AzBatchTask -JobId "Job-000001" -Id "Task23" -CommandLine "cmd /c dir /s" -ResourceFiles $file -BatchContext $Context

Creates a PSResourceFile referencing an Auto Storage container name. All files in the container will be downloaded to the specified folder.

参数

-AutoStorageContainerName

The storage container name in the auto storage account.

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

AutoStorageContainerName
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-BlobPrefix

Gets the blob prefix to use when downloading blobs from an Azure Storage container. Only the blobs whose names begin with the specified prefix will be downloaded. This prefix can be a partial filename or a subdirectory. If a prefix is not specified, all the files in the container will be downloaded.

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

StorageContainerUrl
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False
AutoStorageContainerName
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

参数属性

类型:IAzureContextContainer
默认值:None
支持通配符:False
不显示:False
别名:AzContext, AzureRmContext, AzureCredential

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-FileMode

Gets the file permission mode attribute in octal format. This property is applicable only if the resource file is downloaded to a Linux node. If this property is not specified for a Linux node, then the default value is 0770.

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-FilePath

The location on the compute node to which to download the file(s), relative to the task's working directory. If the HttpUrl parameter is specified, the FilePath is required and describes the path which the file will be downloaded to, including the filename. Otherwise, if the AutoStorageContainerName or StorageContainerUrl parameters are specified, FilePath is optional and is the directory to download the files to. In the case where FilePath is used as a directory, any directory structure already associated with the input data will be retained in full and appended to the specified FilePath directory. The specified relative path cannot break out of the task's working directory (for example by using '..').

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

HttpUrl
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-HttpUrl

The URL of the file to download. If the URL is Azure Blob Storage, it must be readable using anonymous access; that is, the Batch service does not present any credentials when downloading the blob. There are two ways to get such a URL for a blob in Azure storage: include a Shared Access Signature (SAS) granting read permissions on the blob, or set the ACL for the blob or its container to allow public access.

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

HttpUrl
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-StorageContainerUrl

The URL of the blob container within Azure Blob Storage. This URL must be readable and listable using anonymous access; that is, the Batch service does not present any credentials when downloading blobs from the container. There are two ways to get such a URL for a container in Azure storage: include a Shared Access Signature (SAS) granting read permissions on the container, or set the ACL for the container to allow public access.

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

StorageContainerUrl
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

输入

None

输出

PSResourceFile