Azure arm intelligent provisioning - azure

I'm trying to set a standard virtual machine template via ARM deployed on the azure portal and feel I'm missing a trick.
When deploying a virtual machine via azure you can select existing vnets and based off your selection you can select a subnet.
Via the ARM template deployment method I do not see a way other then putting all the subnets in the allowed values and hoping the end user chooses the right one.
Can anyone help?

theres no easy way of doing this currently. Managed Applications might be of a value there, but they are not exactly arm templates. But they have some controls to allow for "smart" value picking.

I suppose I can generate a powershell script that queries azure dependant on selections and fill in the arm template from said selections. Just would be nice if could have built in the intelligence within ARM deployment.
Thank you for the managed applications information

Related

Is it possible to create a user group via ARM template?

I am working on IaC in Azure. I need to create a user group via ARM template. Is it possible to accomplish this task in this manner?
Unless something has change recently, no. You can use the MS Graph API. You can set up PowerShell Scripts to run. Etc. And if you need this as part of the pipeline, there is likely a plug in on marketplace, if keyed on pipeline.
But I am trying to understand the need for creating a new group as part of the IaC. Is this because you need it configurable for different types of installs through pipelines? In general, I don't mix security with infrastructure unless I am making a product for others to install, so just trying to make sure you are not heading down a bad road.Do you mean resource groups instead?

How can i pass variables to Azure Marketplace VM offer

I am publishing an app to the Azure Marketplace. My offer is a VM. My use case is that i need the customer to enter some values that will be used to call a script in the VM. How can i pass custom variables to the VM during launch?
According to this you can only customize them with SKU's, so this means any post deployment configurations are to be done by the customer.
What you see to need is an Azure Application Offer. That one would contain a way to customize it.

How to retrieve deployment username in azure vm template

I'm currently building out a number of virtual machines in azure using a template that we've built out. I would like to be able to pull the name of the user who chose to deploy this template so that we can verify a number of things exist on the server for them (i.e. userid). Is there anyway to do this? Any help would be appreciated.
No, this is not possible using arm templates (unless using some pretty horrible\unreliable\outside of arm template hacks).
You could probably work around that by creating a parameter where user inputs his details, but even that the second part of your plan will fail. You cannot really do checks on the OS level configurations from the template.
ARM templates aren't meant to actually check things, and while some interactions are possible, they are very limited (like listKeys).

DevTest Labs - Custom image with 2 NICs

I know DevTest Labs is still in Preview, but I'm currently trying to develop using the latest functionalities from Azure (not classic).
I have my own linux VHD and I decided to created a custom image under DevTest Labs. For my VM to work properly I need to add a secondary NIC to it, but I couldn't see any option/functionality to do so. I'm assuming there's another hidden way to create a secondary NIC(with Powershell, xplat-cli, wizardry..)or worst case scenario, there's no way to create a secondary NIC.
Any input if that's even possible yet ?
The primary building block of Azure Resource Management model is the Resource Manager Template, if you create a template that specifies the solution you want to create you can import that template into DevTest labs. Then deploy that as needed.
You could use this template as a starting point there are plenty of others at the Azure Quickstart Templates Site
They take a little hacking and getting used to, but once you figure them out they are a good way of managing resources.
There is also a an ARM template visualiser which is starting to get quite useful.

Azure Vitual machine deployment

Azure resource manager power shell or JSON template to create Virtual machine in existing Virtual network and Storage account.
You can of course use either.
Json Template is basically what Azure Resource Manager (ARM) uses anway. Bonus: you can run your ARM templates from PowerShell :)
The question you want to ask is:
Will I be doing this repeatedly?
If so, ARM is the natural answer. You create a resource in a file that you can version control and use to repeated deployments.
If it's only a one-time thing, then PowerShell or Azure Command Line Tools are more than enough.
At first steps JSON templates may confuse you, because files are large (hundreds of lines). But templates are really readable and you can easy configure your architecture. Also there is a chance to make a syntax mistake or to violate existing restrictions - try to use smart editor.
For example, VS Code Editor.
PowerShell and multi-platform tool Azure CLI help you make the same requests to subscriptions but contain helpers, hints and validators which would help you easy set correct options.

Resources