Dynamically creating and overall management of Virtual Networks is quite hacky.
First, this what you see is not a "hidden REST Call". What you see is the management portal call to its backend. Management portal is HTML5 / jQuery / knockout based. It does not call directly the Azure Management API.
Now the theory - what we call in portal a Virtual Network
is actually a Virtual Network Site
for the API. Check the Azure Virtual Network Configuration Schema. So, in order to "create a new Virtual Network", we actually create a "new VNet site" within our Virtual Network.
Note that Virtual Network Configuration is only one per subscription! All we do, is changing this configuration.
Having said the above, dynamically changing this configuration is doable, but with the following constraints:
- You can only perform one change at a time
- You have to wait for running operation to complete in order to do the next change
Then, in order to make the things, you have to work with the XML network configuration directly. The easiest would be with PowerShell. I have some scripts in the shelf, will update the answer later when I find them. In short, you have to work with following cmdlets:
Update
Yes, two different people, admin and co-admin of same subscription cannot create two different virtual networks on the portal at the same time for the same subscription. Because changing a Virtual network configuration requires exclusive access - all operations on the Virtual network are blocked until first operation finishes.
Second - about reverse engineering the Portal and calling a custom, unofficial, unsupported API - You don't want to base your production deployments on a non-documented, non-supported API. Do I have to enlist reasons? Pick up some from:
- This API is not documented, you will not get any support, and may change in any point of time
- Speaking about change, there is Preview Portal: http://portal.azure.com which will replace the current portal. Which probably uses another API
- it is unclear how the portal API authenticate requests
- you do not know when it changes
- you do not have a documentation and have base your code on assumptions
You question is something like:
When I browse my mailbox in outlook.com I see some hidden REST requests to
https://xxx.mail.live.com/ol/mail.fpp?cnmn=Microsoft.Msn.Hotmail.xx=0&a=yyy%3d%3d&au=1872538104324017787
Can I use this API to base my Office365 Plugin application.
POST: {"subscriptionId":"88349849384932809","location":"East US","virtualNetwork":{"name":"customer-10-network","AddressSpace":["10.0.0.0/24"],"Subnets":[{"name":"Subnet-1","AddressPrefix":"10.0.0.0/24"}],"DnsServersRef":[],"Gateway":null},"isWideVNetEnabled":true}
– am5