MicrosoftDocs / azure-docs

Open source documentation of Microsoft Azure
https://docs.microsoft.com/azure
Creative Commons Attribution 4.0 International
10k stars 21k forks source link

Page improvement request for 'PowerShell: How to use Packer to create virtual machine images in Azure' #122195

Open sabuncumurat opened 2 weeks ago

sabuncumurat commented 2 weeks ago

I used the old JSON-template approach on this page, which totally works, thank you. The only part that was confusing was the following:

You can also create a file named windows.pkr.hcl and paste the following content with your own values as used for the above parameters table.

Being a Packer newbie, a little research revealed that the use of the JSON-template is now outdated (although still supported) and the HCL-template is the preferred approach. As such, it would immensely improve this page to change the above to something like the following:

As HCL-based Packer template files have now been introduced and are the recommended approach, you can also create a file named windows.pkr.hcl and paste the following content with your own values as used for the above parameters table.

Even better would be to explicitly state the two approaches and mention that they are alternatives to the same end, like so: 1 - Use the legacy JSON-based template file OR 2 - Use the HCL-based template file (recommended)

Specifically, the 'you can also do this' wording completely throws off people who want to follow a tutorial to a t, so to speak.

However, I need to state that I was able to get a web server up and running in Azure by following this tutorial, which is nothing short of amazing, thanks.


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

PesalaPavan commented 2 weeks ago

@sabuncumurat Thanks for your feedback! We will investigate and update as appropriate.

sabuncumurat commented 2 weeks ago

One addition: Under the Create Azure credentials section, in the following line:

$sp = New-AzADServicePrincipal -DisplayName "PackerSp" -role Contributor -scope /subscriptions/yyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyy

The subscription string has too few y's, needs two more y's to match the length of a real subscription string. FYI.

TPavanBalaji commented 1 week ago

@sabuncumurat Thank you for bringing this to our attention. I've delegated this to content author, who will review it and offer their insightful opinions.