Edit

Share via


New-AzContainerGroupVolumeObject

Create an in-memory object for Volume.

Syntax

Default (Default)

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.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-AzureFileShareName

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-AzureFileStorageAccountKey

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

Parameter properties

Type:SecureString
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-AzureFileStorageAccountName

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-EmptyDir

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

Parameter properties

Type:IVolumeEmptyDir
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-GitRepoRepositoryUrl

Repository URL.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-GitRepoRevision

Commit hash for the specified revision.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

The name of the volume.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Secret

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

Parameter properties

Type:ISecretVolume
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Outputs

Volume