Modifier

Partager via


Set-AzSqlServerDnsAlias

Modifies the server to which Azure SQL Server DNS Alias is pointing

Syntax

Set-AzSqlServerDnsAlias
   -Name <String>
   -TargetServerName <String>
   [-ResourceGroupName] <String>
   -SourceServerName <String>
   -SourceServerResourceGroupName <String>
   -SourceServerSubscriptionId <Guid>
   [-AsJob]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

This command is updating the server to which alias is pointing. This command needs to be issued while logged into subscription where new server to which alias is going to point is located.

Examples

Example 1

Set-AzSqlServerDnsAlias -ResourceGroupName rg -DnsAliasName aliasName -TargetServerName newServer -SourceServerName oldServer -SourceServerResourceGroupName SourceServerRG -SourceServerSubscriptionId 0000-0000-0000-0000

This command is updating alias which was previously pointing to oldServer to point to server newServer

Parameters

-AsJob

Run cmdlet in the background

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

-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

-Name

The Azure Sql Server Dns Alias name.

Type:String
Aliases:DnsAliasName
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ResourceGroupName

The name of the resource group.

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

-SourceServerName

The name of Azure Sql Server to which alias is currently pointing.

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

-SourceServerResourceGroupName

The name of resource group of the source server.

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

-SourceServerSubscriptionId

The subscription id of the source server

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

-TargetServerName

The name of Azure Sql Server to which alias should point.

Type:String
Position:Named
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

String

Outputs

AzureSqlServerDnsAliasModel