편집

다음을 통해 공유


New-AzContainerGroupVolumeObject

Create an in-memory object for Volume.

Syntax

New-AzContainerGroupVolumeObject
   -Name <String>
   [-AzureFileReadOnly]
   [-AzureFileShareName <String>]
   [-AzureFileStorageAccountKey <SecureString>]
   [-AzureFileStorageAccountName <String>]
   [-EmptyDir <IVolumeEmptyDir>]
   [-GitRepoDirectoryName <String>]
   [-GitRepoRepositoryUrl <String>]
   [-GitRepoRevision <String>]
   [-Secret <ISecretVolume>]
   [<CommonParameters>]

Description

Create an in-memory object for Volume.

Examples

Example 1: Create a Azure File volume

$pwd = ConvertTo-SecureString -String "****" -AsPlainText -Force
New-AzContainerGroupVolumeObject -Name "myvolume" -AzureFileShareName "myshare" -AzureFileStorageAccountName "username" -AzureFileStorageAccountKey $pwd

Name
----
myvolume

This command creates a Azure File volume.

Example 2: Create an empty directory volume

New-AzContainerGroupVolumeObject -Name "emptyvolume" -EmptyDir @{} | Format-List

AzureFileReadOnly           : 
AzureFileShareName          : 
AzureFileStorageAccountKey  : 
AzureFileStorageAccountName : 
EmptyDir                    : {
                              }
GitRepoDirectory            : 
GitRepoRepository           : 
GitRepoRevision             : 
Name                        : emptyvolume
Secret                      : {
                              }

This command creates an empty directory volume.

Parameters

-AzureFileReadOnly

The flag indicating whether the Azure File shared mounted as a volume is read-only.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-AzureFileShareName

The name of the Azure File share to be mounted as a volume.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-AzureFileStorageAccountKey

The storage account access key used to access the Azure File share.

Type:SecureString
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-AzureFileStorageAccountName

The name of the storage account that contains the Azure File share.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-EmptyDir

The empty directory volume. To construct, see NOTES section for EMPTYDIR properties and create a hash table.

Type:IVolumeEmptyDir
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-GitRepoDirectoryName

Target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-GitRepoRepositoryUrl

Repository URL.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-GitRepoRevision

Commit hash for the specified revision.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

The name of the volume.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Secret

The secret volume. To construct, see NOTES section for SECRET properties and create a hash table.

Type:ISecretVolume
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Outputs

Volume