Set-AzPrivateDnsZone

Updates a Private DNS zone from a resource group.

Syntax

Set-AzPrivateDnsZone
   -ResourceGroupName <String>
   -Name <String>
   [-Tag <Hashtable>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzPrivateDnsZone
   -ResourceId <String>
   [-Tag <Hashtable>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzPrivateDnsZone
   -PrivateZone <PSPrivateDnsZone>
   [-Tag <Hashtable>]
   [-Overwrite]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The Set-AzPrivateDnsZone cmdlet permanently updates a private Domain Name System (DNS) zone from a specified resource group. You can pass a PrivateDnsZone object using the PrivateZone parameter or by using the pipeline operator, or alternatively you can specify the Name and ResourceGroupName parameters. You can use the Confirm parameter and $ConfirmPreference Windows PowerShell variable to control whether the cmdlet prompts you for confirmation. When specifying the zone using a PrivateDnsZone object (passed via the pipeline or Zone parameter), the zone is not updated if it has been changed in Azure DNS since the local PrivateDnsZone object was retrieved (only operations directly on the DNS zone resource count as changes, operations on record sets within the zone do not). This provides protection for concurrent zone changes. This can be suppressed using the Overwrite parameter, which updates the zone regardless of concurrent changes.

Examples

Example 1: Updates a private zone

Set-AzPrivateDnsZone -Name "myzone.com" -ResourceGroupName "MyResourceGroup" -Tag @{tag1="value1";tag2="value2"}

Name                          : myzone.com
ResourceId                    : "/subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/MyResourceGroup/PrivateZones/myzone.com"
ResourceGroupName             : MyResourceGroup
Location					  : 
Etag                          : xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Tags                          : {tag1="value1";tag2="value2"}
NumberOfRecordSets            : 1
MaxNumberOfRecordSets         : 5000

This command updates the zone named myzone.com from the resource group named MyResourceGroup with the tags provided. Use Get-AzPrivateDnsZone to retrieve the updated zone.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
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

Specifies the name of the Private DNS zone that this cmdlet updates. You must also specify the ResourceGroupName parameter. Alternatively, you can specify the private DNS zone using the Zone parameter.

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

-Overwrite

When specifying the zone using a PrivateDnsZone object (passed via the pipeline or Zone parameter), the zone is not updated if it has been changed in Azure DNS since the local DnsZone object was retrieved (only operations directly on the DNS zone resource count as changes, operations on record sets within the zone do not). This provides protection for concurrent zone changes. This can be suppressed using the Overwrite parameter, which updates the zone regardless of concurrent changes.

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

-PrivateZone

The zone object to set.

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

-ResourceGroupName

Specifies the name of the resource group that contains the zone to be updated. You must also specify the ZoneName parameter. Alternatively, you can specify the private DNS zone using a DnsZone object, passed via either the pipeline or the Zone parameter.

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

-ResourceId

Private DNS Zone ResourceID.

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

-Tag

A hash table which represents resource tags.

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

Inputs

String

PSPrivateDnsZone

Outputs

PSPrivateDnsZone