Convert my Powershell script to JSON

Girish Prajwal 706 Reputation points
2020-11-26T07:23:41.273+00:00

Hi Team,

I have a PowerShell script with few "foreach" loops "if statements".
Sample script : https://learn.microsoft.com/en-us/answers/questions/151254/can-we-inherit-the-tags-from-azure-vm-and-then-ass.html

I would want my powershell script to be converted to working json script (ARM template).
Well I have zero knowledge on the json part except on the basics of reding/understanding the json templates.

Please suggest if this can be achieved or not.

Regards,
Girish

Azure Role-based access control
Azure Role-based access control
An Azure service that provides fine-grained access management for Azure resources, enabling you to grant users only the rights they need to perform their jobs.
687 questions
Azure Policy
Azure Policy
An Azure service that is used to implement corporate governance and standards at scale for Azure resources.
807 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Sam Cogan 10,322 Reputation points MVP
    2020-11-26T10:48:34.247+00:00

    There is not an automated way to do this, you would need to determine what your script is doing and convert this ARM template.
    ARM has loops via the "count" functionality, but you would need to determine what else your script is doing. If it is purely creating Azure resources then it could be done.