Edit

Set-AzNetAppFilesBucketAkvCredential

Generates an Azure NetApp Files (ANF) Bucket Access Key / Secret Key pair and stores it in Azure Key Vault.

Syntax

ByFieldsParameterSet (Default)

Set-AzNetAppFilesBucketAkvCredential
    -ResourceGroupName <String>
    -AccountName <String>
    -PoolName <String>
    -VolumeName <String>
    -Name <String>
    [-KeyPairExpiryDay <Int32>]
    [-PassThru]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByResourceIdParameterSet

Set-AzNetAppFilesBucketAkvCredential
    -ResourceId <String>
    [-KeyPairExpiryDay <Int32>]
    [-PassThru]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByObjectParameterSet

Set-AzNetAppFilesBucketAkvCredential
    -InputObject <PSNetAppFilesBucket>
    [-KeyPairExpiryDay <Int32>]
    [-PassThru]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Set-AzNetAppFilesBucketAkvCredential cmdlet generates the Access Key and Secret Key pair used to access an ANF Bucket and stores the key pair as a secret in the Azure Key Vault configured on the Bucket (via CredentialsKeyVaultUri / CredentialsSecretName on New-AzNetAppFilesBucket or Update-AzNetAppFilesBucket). The generated key pair expires after KeyPairExpiryDay days. Unlike New-AzNetAppFilesBucketCredential, this cmdlet does not return the credentials to the caller - consumers should retrieve them from Azure Key Vault. Use -PassThru to receive a boolean indicating whether the operation succeeded.

Examples

Example 1: Store bucket credentials in Azure Key Vault

Set-AzNetAppFilesBucketAkvCredential -ResourceGroupName "MyRG" -AccountName "MyAnfAccount" -PoolName "MyAnfPool" -VolumeName "MyAnfVolume" -Name "MyAnfBucket" -KeyPairExpiryDay 30 -PassThru

Generates a new Access Key / Secret Key pair valid for 30 days and writes the pair as a secret into the Azure Key Vault configured on the Bucket.

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 AKV-stored 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

-PassThru

Return whether the operation completed successfully

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

-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

Boolean