Passing multiple Vnets that each have multiple subnets using ARM Templates - azure

Please I am trying to deploy a storage account that would add multiple vnets each having their own subnets to the virtualNetworkRules
I initially used the below to add one vnet with multiple subnets and it works fine
Now I want to be able to take in multiple vnets with another array of subnets, I tried the below but it obviously doesn't work
Does anyone have any ideas, this is for an ARM template that is run with an Azure Pipeline

Related

How do I manage the resources created by AKS in Terraform?

I'm working with Azure Kubernetes Service and would like to manage my infrastructure using Terraform.
When you create a new AKS cluster in Azure, a separate resource group is created to manage the resources that the cluster depends on (e.g. virtual machine sets, load balancer, etc.)
This is no different when creating an AKS cluster using the Terraform azurerm_kubernetes_cluster resource.
However, I'd like to be able to work with the resources created in this resource group within Terraform. For example, when using the Application Gateway Ingress Controller, I'd like to be able to grab the public IP address that is created in this resource group so I can assign a DNS A record in my DNS zone. This is one such example, but the scope of my question includes any resources created in this AKS-managed resource group.
I have attempted to reference these as data resources in Terraform that depend on the creation of the AKS cluster, however this requires a role assignment to the new resource group, which my service principal will not have. Assigning the Terraform service principal to the entire subscription also feels like too much of a sledgehammer approach.
It seems I must be missing something, as this seems like a big flaw in the current approach with Terraform. Can anyone enlighten me to something I am missing?

The VNet created doesnot show up in the route table configuration in Azure

I am trying to set up a Vnet for the infra for our SharePoint project.
Using Azure Portal , I created the below in the same Resource Group:
Vnet and its two subnets
Two NSG - Associated it to the respective Subnets ( One for front end and one for backend )
Two VM( Linux)
Route table.
When I select the Subnets in Route table and click Associate, it doesnt give me the Vnet that I have created in the dropdown
enter image description here
How to fix this?
Please check if you created Route table and Vnet in same Azure Regions

Arm Template -VM from existing vnet and all dependent resources

I want to create ARM template to deploy Azure VM on its already created dependent resources. Want to deploy a vm on these existing dependent resources : Storage Account, Diagnostic Storage Account, Virtual Network, Network Interface, Public IP Address, Network Security Group.
You can use those dependent resources as parameter and use it in your arm file.
You can take help of this example:
https://github.com/Azure/azure-quickstart-templates/tree/master/201-vm-different-rg-vnet
And update the ARM template according to your requirements.

How to increase a existing subnet range by incremental deployment Azure ARM template?

2 subnets (A and B) each have 1 VM in them. Each VM and its resources has its own unique resource group value, which is different from the VNet/Subnet resource group value. The ARM template which was used to create the VNet and 2 subnets, gets its related ARM template parameters updated, to make the subnet CIDR of subnet B larger. Is it possible to do an incremental deployment that simply makes a subnet larger?
Yes, unless something is assigned to the subnet. You cant alter a subnet if something is assigned to it

How can I add Azure VM to existing Vnet or new Vnet using ARM template

I am creating JSON file for ARM template to deploy Azure VM and its dependent resources.
I have created RHEL VM with following resources(all are newly created):-
Storage Account
Diagnostic Storage Account
Virtual Network
Network Interface
Public IP Address
Network Security Group
Now I want to create Azure VM with existing Vnet, Subnet or new Vnet, subnet. Is there any example I can follow up. How can I do so?
Now I want to create Azure VM with existing Vnet
You could refer to this example.
If you want to more templates, you could search the templates gallery to discover what you need.
or new Vnet, subnet.
You could refer to this example, just use an existing resource group.
This is pretty straightforward with Microsoft's documentation.
The challenge here usually lies with understanding the dependencies. In that example, you aren't saying I want this VM to launch in this Vnet, you are saying, "I want this VM to use this NIC which is associated with this Subnet of this Vnet"
It is easiest to just use the example provided at the bottom of that link and work your way forward. With your case, you will end up being able to simply remove the Vnet resource block and add your own Vnet's properties in.
This is an extra tool for working with ARM templates.

Resources