Set-AzureDnsZone

Set-AzureDnsZone

Updates a DNS zone.

Syntax

Parameter Set: Fields
Set-AzureDnsZone -Name <String> -ResourceGroupName <String> [-Profile <Microsoft.Azure.Common.Authentication.Models.AzureProfile> ] [-Tag <Hashtable[]> ] [ <CommonParameters>]

Parameter Set: Object
Set-AzureDnsZone -Zone <DnsZone> [-Overwrite] [-Profile <Microsoft.Azure.Common.Authentication.Models.AzureProfile> ] [ <CommonParameters>]

Detailed Description

The Set-AzureDnsZone cmdlet updates the specified DnsZone. This cmdlet does not update the RecordSet objects in the zone. You can pass a DnsZone object as a parameter or by using the pipeline operator, or alternatively you can specify the zone by name.

Parameters

-Name<String>

Specifies the name of the DNS zone to update.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-Overwrite

Indicates that this cmdlet ignores the Etag when deleting the record set, and that the record set is deleted even if it has changed since the last Get.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Profile<Microsoft.Azure.Common.Authentication.Models.AzureProfile>

Specifies an Azure profile.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ResourceGroupName<String>

Specifies the name of the resource group that contains the zone to update.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-Tag<Hashtable[]>

Specifies an array of tags to associate with the DNS zone. Tags are name-value pairs that are represented as hashtables, for example, @(@{"Name"="dept"; "Value"="shopping"}, @{"Name"="env"; "Value"="production"})

Aliases

Tags

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-Zone<DnsZone>

Specifies the DNS zone to update.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true(ByValue)

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • Microsoft.Azure.Commands.Dns.DnsZone

    You can pipe a DnsZone object to this cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • Microsoft.Azure.Commands.Dns.DnsZone

    This cmdlet returns a DnsZone object that represents the updated DNS zone with a new Etag.

Examples

Example 1: Update a DNS zone

The first command gets the zone named myzone.com from the specified resource group, and then stores it in the $Zone variable.

The second command updates the tags for $Zone.

The final command passes $Zone to the Set-AzureDnsZone cmdlet by using the pipeline operator.

PS C:\> $Zone = Get-AzureDnsZone -Name "myzone.com" -ResourceGroupName "MyResourceGroup"  
PS C:\> $Zone.Tags = @(@{"Name"="Dept"; "Value"="Electrical"})
PS C:\> $Zone | Set-AzureDnsZone

Example 2: Update tags for a zone

This command updates the tags for the zone named myzone.com without first explicitly getting the zone.

PS C:\> Set-AzureDNSZone -ResourceGroupName "MyResourceGroup" -Name "myzone.com" -Tag @(@{"Name"="Dept"; "Value"="Electrical"})

Get-AzureDnsZone

New-AzureDnsZone

Remove-AzureDnsZone

Using tags to organize your Azure resources