-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
azure: support for marketplace plan information #5970
Conversation
3043767
to
d2e593d
Compare
Idle/bikeshed thought -- I wonder if, from a UX perspective, it makes more sense to have these options bundled into a map like with source_ami_filter, since they're related so closely. |
Good question. Let me describe what this represents, and you can tell me if it maps well. I think the source filter is more about image selection process, whereas this is more for billing. Azure has platform images for things like Windows, Linux, FreeBSD, etc. There are also Marketplace images, which are images that have a slight different rate plan (way customers are charged). Marketplace images have to be called out specially with these additional plan metadata. It isn't part of a selection process, but rather a billing calculation. |
I think it's ultimately fine either way. My instinct was just that it feels like these four items represent one feature rather than several features, so it might help users to have them explicitly combined in that way, under, for example, a |
Explain more. I think I misunderstood your first request, and I like the idea of making them logically combined. Do you have a code example that I can refer too? |
The mapstructure module is pretty smart, so you can just change your config to something like this
which allows you to read a map of strings from the packer config, e.g.
And then you can access that information through normal struct access methods. So your validation for example would be
My gut just says doing it this way would help the user and people reading the docs understand explicitly that those items are only used as part of the same feature, and are tied to one another. But like I said, this is more of an idle thought / bikeshed and I'm happy to keep it your way. |
Boom! That's great! I wish I had done this for some of the other things I had implemented. I will make this change, and update the code and docs. Thank you for the review! |
🎉 glad it was helpful! |
Thanks @boumenot this is great. We need to have the plan information that you are taking added to Tags for the generated Images . Tags will look like Key Value Enable access to image : https://aka.ms/azuremarketplaceapideployment I would also like to point out that not all Azure marketplace images would work for programatic deployments as publishers control that, so we may have failures. I am happy to do integration testing, just give me a private. |
There is a limitation on the number of tags a user can set. If there are too many tags defined as a result of the user setting them, and this feature setting them I am going to just error out with an appropriate message. I posted a private build for Linux, Mac, and Windows in #3506 . This build does not have any of the changes recommended in this thread, but I will add them. |
5d1f147
to
1ef491d
Compare
@boumenot ping me when you're ready for final review/merge :) |
@SwampDragons - I'm ready. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good .. thanks Chirs .. I will test today with the binary that you provided
@@ -162,6 +162,17 @@ Providing `temp_resource_group_name` or `location` in combination with `build_re | |||
`Linux` this configures an SSH authorized key. For `Windows` this | |||
configures a WinRM certificate. | |||
|
|||
- `plan_name` (string) The plan name. This setting (`plan_product`, `plan_publisher`, and `plan_promotion_code`) are | |||
only needed for Marketplace images. Please refer to [Deploy an image with Marketplace terms](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/cli-ps-findimage#deploy-an-image-with-marketplace-terms) for more details. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also put that if the above step is not done then the image creation will fail. Also using of the built image will also require the same step for the subscription where the images will get used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Yet another attempt at supporting Marketplace images (aka plan info). This PR differs from the previous attempt in that it explicitly provides settings for plan info whereas the previous attempt allowed arbitrary patching.
The following settings are required to use plan info. There's an optional fourth option called
plan_promotion_code
.Closes #3506