Edit

New-AzNetAppFilesBucketCredential

Generates a new Access Key / Secret Key pair for an Azure NetApp Files (ANF) Bucket and returns the credentials in cleartext.

Syntax

ByFieldsParameterSet (Default)

New-AzNetAppFilesBucketCredential
    -ResourceGroupName <String>
    -AccountName <String>
    -PoolName <String>
    -VolumeName <String>
    -Name <String>
    [-KeyPairExpiryDay <Int32>]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByResourceIdParameterSet

New-AzNetAppFilesBucketCredential
    -ResourceId <String>
    [-KeyPairExpiryDay <Int32>]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByObjectParameterSet

New-AzNetAppFilesBucketCredential
    -InputObject <PSNetAppFilesBucket>
    [-KeyPairExpiryDay <Int32>]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The New-AzNetAppFilesBucketCredential cmdlet generates the Access Key and Secret Key pair used to access an ANF Bucket and returns them in the response. The generated key pair expires after KeyPairExpiryDay days (defaults to the service default if not specified). This cmdlet returns the credentials in cleartext; if you prefer the key pair to be written to Azure Key Vault instead, use Set-AzNetAppFilesBucketAkvCredential.

Examples

Example 1: Generate credentials expiring in 7 days

New-AzNetAppFilesBucketCredential -ResourceGroupName "MyRG" -AccountName "MyAnfAccount" -PoolName "MyAnfPool" -VolumeName "MyAnfVolume" -Name "MyAnfBucket" -KeyPairExpiryDay 7
AccessKey     : AKIA************************
SecretKey     : ****************************************
KeyPairExpiry : 6/8/2026 12:00:00 AM

Returns a new Access Key / Secret Key pair valid for 7 days.

Example 2: Generate credentials via pipeline

Get-AzNetAppFilesBucket -ResourceGroupName "MyRG" -AccountName "MyAnfAccount" -PoolName "MyAnfPool" -VolumeName "MyAnfVolume" -Name "MyAnfBucket" | New-AzNetAppFilesBucketCredential -KeyPairExpiryDay 3

Pipes the Bucket object into the cmdlet to generate credentials valid for 3 days.

Parameters

-AccountName

The name of the ANF account

Parameter properties

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

Parameter sets

ByFieldsParameterSet
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

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

Parameter sets

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

-DefaultProfile

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

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

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

-InputObject

The bucket object for which credentials should be generated

Parameter properties

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

Parameter sets

ByObjectParameterSet
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-KeyPairExpiryDay

Number of days from now until the newly generated Access and Secret key pair will expire.

Parameter properties

Type:

Nullable<T>[Int32]

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 ANF bucket

Parameter properties

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

Parameter sets

ByFieldsParameterSet
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-PoolName

The name of the ANF capacity pool

Parameter properties

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

Parameter sets

ByFieldsParameterSet
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ResourceGroupName

The resource group of the ANF account

Parameter properties

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

Parameter sets

ByFieldsParameterSet
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ResourceId

The resource id of the ANF bucket

Parameter properties

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

Parameter sets

ByResourceIdParameterSet
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-VolumeName

The name of the ANF volume

Parameter properties

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

Parameter sets

ByFieldsParameterSet
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

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

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.

Inputs

String

PSNetAppFilesBucket

Outputs

PSNetAppFilesBucketCredential