question

Chaitanyakumar-1942 avatar image
0 Votes"
Chaitanyakumar-1942 asked HagenRahn-8871 answered

Unable to create subnets in Vnet using terraform

When I try to create Vnet, Subnets, NAT Gateway, Route tables from terraform script I'm getting following error.
Error: Error Creating/Updating Subnet "private-1" (Virtual Network "myvpc" / Resource Group "acceptanceTestResourceGroup2"): network.SubnetsClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="SubscriptionNotRegisteredForFeature" Message="Subscription 60471ca2-f532-4ac9-8736-d89df5c2b54d is not registered for feature Microsoft.Network/AllowMultipleAddressPrefixesOnSubnet required to carry out the requested operation." Details=[]
Kindly check this error and reply back ASAP.

azure-webapps-vnet
· 5
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Could you please check if Microsoft.Network is registered in your Azure Subscription?


 Open the Azure portal.
 Select Subscription from the left menu.
 Select the Azure subscription that you use to deploy the template.
 Select Resource providers.
 Verify the resources that you try to create are registered. Based on the error you are getting, it is likely that you need to register Microsoft.Network.


66880-image.png


0 Votes 0 ·
image.png (32.8 KiB)


I can see Microsoft.Network as "registered" but when I trigger "terraform apply" I'm unable to create subnets.

0 Votes 0 ·

Could you please share you Terraform code?

0 Votes 0 ·
Show more comments
AndriyBilous avatar image
3 Votes"
AndriyBilous answered

What is the value for variable var.public_cidr?
May you please share also your variables.tf file?

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

You can check my variables.tf from this image URL.


[1]: https://postimg.cc/tsSsvYLg

0 Votes 0 ·

Hi AndriyBilous,

Right now the issue is fixed. I can able to create 2subnets in my Vnet with no errors. Thanks a lot for assisting me with your valuable knowledge.

0 Votes 0 ·
GeorgeGildenhuys-5480 avatar image
0 Votes"
GeorgeGildenhuys-5480 answered GeorgeGildenhuys-5480 published

How did you fix this?

I am getting feature Microsoft.Network/AllowMultipleAddressPrefixesOnSubnet when using either terraform or azcli:

az network vnet subnet create --address-prefixes 10.120.1.0/24 10.120.2.0/24 --name dynamicsubnet --resource-group Networking --vnet-name sandboxukso-private

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

NarenderSingh avatar image
0 Votes"
NarenderSingh answered

Hi,

What was the solution of it? I am also getting the same error where I have 4 subnets in the variable list in my variable.tf?

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

HagenRahn-8871 avatar image
0 Votes"
HagenRahn-8871 answered

Currently the required resource provider is not available for public access, GA or pre. so using this feature is not possible, if you are not working as MS developer.
I have created a bug report to update terraform docu: https://github.com/hashicorp/terraform-provider-azurerm/issues/17052

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.