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

New-AzMapsAccountKey

Regenerate either the primary or secondary key for use with the Maps APIs. The old key will stop working immediately.

Syntax

New-AzMapsAccountKey
   -Name <String>
   -ResourceGroupName <String>
   -KeyType <KeyType>
   [-SubscriptionId <String>]
   [-DefaultProfile <PSObject>]
   [-Confirm]
   [-WhatIf]
   [<CommonParameters>]
New-AzMapsAccountKey
   -InputObject <IMapsIdentity>
   -KeyType <KeyType>
   [-DefaultProfile <PSObject>]
   [-Confirm]
   [-WhatIf]
   [<CommonParameters>]

Description

Regenerate either the primary or secondary key for use with the Maps APIs. The old key will stop working immediately.

Examples

Example 1: Regenerate either the primary or secondary key for use with the Maps APIs

New-AzMapsAccountKey -ResourceGroupName azure-rg-test -Name pwsh-mapsAccount01 -KeyType primary

PrimaryKey                                  PrimaryKeyLastUpdated        SecondaryKey                                SecondaryKeyLastUpdated
----------                                  ---------------------        ------------                                -----------------------
W5VYcbrpyt4urV2-4C-lXepnHoy6EIOHnoLL_wjEtaw 2021-05-20T05:50:27.1509422Z zi6W1bw4zIYLjDj_DRRrC3jBkX-APgBebwx4cZBKJOU 2021-05-20T05:41:03.452571Z

This command regenerate either the primary or secondary key for use with the Maps APIs. The old key will stop working immediately.

Example 2: Regenerate either the primary or secondary key for use with the Maps APIs by pipeline

Get-AzMapsAccount -ResourceGroupName azure-rg-test -Name pwsh-mapsAccount01 | New-AzMapsAccountKey -KeyType primary

PrimaryKey                                  PrimaryKeyLastUpdated        SecondaryKey                                SecondaryKeyLastUpdated
----------                                  ---------------------        ------------                                -----------------------
xoGsuTFWuG6xq0re7EdA7nCbDhvRoisZfLHvKfdzIhQ 2021-05-20T05:55:21.7797268Z zi6W1bw4zIYLjDj_DRRrC3jBkX-APgBebwx4cZBKJOU 2021-05-20T05:41:03.452571Z

This command regenerate either the primary or secondary key for use with the Maps APIs by pipeline. The old key will stop working immediately.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

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

-DefaultProfile

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

Type:PSObject
Aliases:AzureRMContext, AzureCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-InputObject

Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table.

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

-KeyType

Whether the operation refers to the primary or secondary key.

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

-Name

The name of the Maps Account.

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

-ResourceGroupName

The name of the resource group. The name is case insensitive.

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

-SubscriptionId

The ID of the target subscription.

Type:String
Position:Named
Default value:(Get-AzContext).Subscription.Id
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

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

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

Inputs

IMapsIdentity

Outputs

IMapsAccountKeys

Notes

ALIASES

COMPLEX PARAMETER PROPERTIES

To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.

INPUTOBJECT <IMapsIdentity>: Identity Parameter

  • [AccountName <String>]: The name of the Maps Account.
  • [CreatorName <String>]: The name of the Maps Creator instance.
  • [Id <String>]: Resource identity path
  • [ResourceGroupName <String>]: The name of the resource group. The name is case insensitive.
  • [SubscriptionId <String>]: The ID of the target subscription.