Export existing Azure resources to Bicep
With the new release of Bicep (v0.4.1124) it is now possible to export existing Azure resources to Bicep code. This means you do not have to export your resources to ARM and then do a decompile.
Exporting your existing resources is very easy and can be done within Visual Studio Code.
Get Resource ID
To be able to export the resource to Bicep you need to have the resource ID of the resource. You can find this resource very easily by opening the resource within Azure and opening the “properties” blade. One of the properties in this blade is the Resource ID

Export Bicep
To export the template follow these steps:
- Open Visual Studio Code
- Open an existing “bicep” file or create a new one.
- Press ctrl+shift+p or open the command pallet.
- Search for “Bicep” and select the option “Insert resource”.
- This will ask for the resource ID. Paste the resource ID and press enter.
- The resource is now imported within your Bicep file.

Good information, In my case nothing is happening. bicep file stays blank.
I have logged into Azure portal via cli and set account subscription to correct one.
Could you point out what could be missing ?
I don’t think that you are missing something if you have logged in into the build in console of for example visual studio code. Sometimes a good configuration of your config file helps.
Same here. Installed the Bicep and Azure Tools extension, signed into Azure CLI and Azure tools with the same account. Verified I have the right subscription selected…
Insert Resource does not do anything. No error message in the output pane as well.
I also have problems from time to time. If I run into issues I try cleaning out my logged in sessions and then it most of the time works
Nothing happens when I click Bicep: Insert Resource…
You should then check the signed in user.