Bearbeiten

Freigeben über


New-AzSearchAdminKey

Regenerates an admin key of the Azure Cognitive Search service.

Syntax

New-AzSearchAdminKey
   [-ResourceGroupName] <String>
   [-ServiceName] <String>
   -KeyKind <PSSearchAdminKeyKind>
   [-Force]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzSearchAdminKey
   [-ParentObject] <PSSearchService>
   -KeyKind <PSSearchAdminKeyKind>
   [-Force]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzSearchAdminKey
   [-ParentResourceId] <String>
   -KeyKind <PSSearchAdminKeyKind>
   [-Force]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The New-AzSearchAdminKey cmdlet regenerates an admin key of the Azure Cognitive Search service.

Examples

Example 1

New-AzSearchAdminKey -ResourceGroupName "TestAzureSearchPsGroup" -ServiceName "pstestazuresearch01" -KeyKind Primary

Confirm
Are you sure you want to regenerate 'Primary' key for Search Service 'pstestazuresearch01'?
[Y] Yes  [N] No  [S] Suspend  [?] Help (default is "Y"): y

Primary                          Secondary
-------                          ---------
85B3813D11904B591BE8A196C2C743A1 CEF791D5BAC2E6C0B232C56702F21E87

The example regenerates Primary key of the Azure Cognitive Search service.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

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

-DefaultProfile

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

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Force

Do not ask for confirmation.

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

-KeyKind

Azure Cognitive Search Service admin key kind (Primary/Secondary).

Type:PSSearchAdminKeyKind
Accepted values:Primary, Secondary
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ParentObject

Azure Cognitive Search Service Input Object.

Type:PSSearchService
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ParentResourceId

Azure Cognitive Search Service Resource Id.

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

-ResourceGroupName

Resource Group name.

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

-ServiceName

Azure Cognitive Search Service name.

Type:String
Position:1
Default value:None
Required:True
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
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

PSSearchService

String

Outputs

PSSearchAdminKey