Fix cross-subscription Gallery builds that use are using a virtual machine source #404
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Azure shipped a change in the last month adding a new field to the gallery storage profile source, `source.VirtualMachineId', this ID is only in newer versions of the API, but we are still seeing a report of the below error occuring when building cross-subscription, the error pretty straight forwardly points to the solution but IMO this is still a pretty unusual breaking change as this occurs even in previous plugin versions, it is not based on any updates we have done, but rather an Azure API change.
Before:
When building across two subscriptions (use client_id/client_secret for this and specify both subscription IDs)
Build 'azure-arm.autogenerated_1' errored after 3 minutes 4 seconds: performing CreateOrUpdate: unexpected status 400 (400 Bad Request) with error: InvalidParameter: The source VM '/subscriptions/sub1/resourceGroups/pkr-Resource-Group-q9eltm1tty/providers/Microsoft.Compute/virtualMachines/pkrvmq9eltm1tty' is a cross subscription source for the galleryImageVersion created in subscription 'sub2'. Please retry the call by specifying the VM id in 'galleryImageVersion.properties.storageProfile.source.virtualMachineId' instead. See https://aka.ms/acgsecurityupdates for more details.
After:
The build succeeds.
Closes #403