Jul 10 2020 09:53 PM
Hi All,
I am trying to provision Azure ADDS managed domain to prepare POC for my client. I used the same set of command earlier multiple times and didn't get any error. But today when I tried doing the same using PowerShell, I got below error
New-AzResource : BadRequest : The property 'ReplicaSets' is missing.
CorrelationId: 7588b953-9e72-4c23-8d20-a0a632928778
At line:1 char:1
+ New-AzResource -ResourceId "/subscriptions/$AzureSubscriptionId/resou ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [New-AzResource], ErrorResponseMessageException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceCmdlet
I am following Microsoft Document and my command is as below
$AzureSubscriptionId = "MY_AZURE_SUBSCRIPTION_ID"
$ManagedDomainName = "My Domain"
# Enable Azure AD Domain Services for the directory.
New-AzResource -ResourceId "/subscriptions/$AzureSubscriptionId/resourceGroups/$ResourceGroupName/providers/Microsoft.AAD/DomainServices/$ManagedDomainName" `
-Location $AzureLocation `
-Properties @{"DomainName"=$ManagedDomainName; `
"SubnetId"="/subscriptions/$AzureSubscriptionId/resourceGroups/$ResourceGroupName/providers/Microsoft.Network/virtualNetworks/$VnetName/subnets/DomainServices"} `
-Force -Verbose
I get same error when I try from Azure PowerShell prompt as well.
Any help in this regard is helpful.
Jul 14 2020 12:45 PM
Jul 14 2020 12:49 PM
Jul 17 2020 05:30 AM
Thank you for your reply. I can provision from console but cannot do so using PowerShell from my system and PowerShell prompt of console. I have created dedicated subnets as well. Here is full script that I am trying.
Connect to Azure AD
Create Group, user and add user to group
Register-AzResourceProvider -ProviderNamespace Microsoft.AAD
$ResourceGroupName = "abhayadadds"
$AzureLocation = "eastus"
# Create the resource group.
New-AzResourceGroup `
-Name $ResourceGroupName `
-Location $AzureLocation
$VnetName = "abhayVnet"
# Create the dedicated subnet for AAD Domain Services.
$AaddsSubnet = New-AzVirtualNetworkSubnetConfig `
-Name DomainServices `
-AddressPrefix 10.0.0.0/24
$WorkloadSubnet = New-AzVirtualNetworkSubnetConfig `
-Name Workloads `
-AddressPrefix 10.0.1.0/24
# Create the virtual network in which you will enable Azure AD Domain Services.
$Vnet= New-AzVirtualNetwork `
-ResourceGroupName $ResourceGroupName `
-Location $AzureLocation `
-Name $VnetName `
-AddressPrefix 10.0.0.0/16 `
-Subnet $AaddsSubnet,$WorkloadSubnet
$AzureSubscriptionId = "My Subscription ID"
$ManagedDomainName = "Managed domain name"
# Enable Azure AD Domain Services for the directory.
New-AzResource -ResourceId "/subscriptions/$AzureSubscriptionId/resourceGroups/$ResourceGroupName/providers/Microsoft.AAD/DomainServices/$ManagedDomainName" `
-Location $AzureLocation `
-Properties @{"DomainName"=$ManagedDomainName; `
"SubnetId"="/subscriptions/$AzureSubscriptionId/resourceGroups/$ResourceGroupName/providers/Microsoft.Network/virtualNetworks/$VnetName/subnets/DomainServices"} `
-Force -Verbose
Aug 24 2020 06:35 AM
Hi, I have the same problem. My deployment script was running perfectly one month ago and now runs into this error.
New-AzResource : BadRequest : The property 'ReplicaSets' is missing.
It seems like a bug that made the property ReplicaSets mandatory.
Sep 15 2020 10:21 AM
Same here!
Sep 30 2020 11:42 AM
@Abhay PujariSame issue here, on any tenant. I posted the bug report: https://github.com/MicrosoftDocs/azure-docs/issues/63558
I am going to try going with a JSON template and see if that fixes it. Documentation says ReplicaSets is non mandatory and it was added in 2020 as optional but its kicking back as missing from the list of properties.
Sep 30 2020 02:29 PM
@Abhay PujariThe fix is to specify the ApiVersion when you kick off New-AzResource... the code would be:
New-AzResource -ResourceId "/subscriptions/$AzureSubscriptionId/resourceGroups/$ResourceGroupName/providers/Microsoft.AAD/DomainServices/$ManagedDomainName" `
-Location $AzureLocation `
-Properties @{"DomainName"=$ManagedDomainName; `
"SubnetId"="/subscriptions/$AzureSubscriptionId/resourceGroups/$ResourceGroupName/providers/Microsoft.Network/virtualNetworks/$VnetName/subnets/DomainServices"} ` -ApiVersion "2017-06-01" -Force -Verbose