Add support for creation_option "Restore" on managed disks (issue #3421) #3598
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.
First time contributing and go rookie so I'm open to feedback and let me know if I'm violating any guidelines.
Took a stab at issue #3421. The documentation doesn't really document the Restore option other than that it is a valid value for createOption. Based on this issue and my own experience in our Azure environment, however, this gets set when a disk is restored from backup or created during failover in Azure Site Recovery. Along with it, the sourceResourceId gets set.
For reference, below is some sanitized output from the Azure CLI of a disk created during Site Recovery failover (Azure to Azure):
Acceptance tests are difficult for this one. I'm not sure if it is actually possible to create a disk using the "Restore" option using the normal disk API since I cannot find IDs in that format anywhere within Azure and it is not documented in the API docs (https://docs.microsoft.com/de-de/azure/templates/microsoft.compute/2018-09-30/disks#creationdata-object).
Fixes #3421