provide more helpful error message than the one returned by the client, without context

This commit is contained in:
Megan Marsh 2020-08-05 09:52:11 -07:00
parent 6a8f49ad1d
commit aede34079d
1 changed files with 4 additions and 0 deletions

View File

@ -787,6 +787,10 @@ func assertRequiredParametersSet(c *Config, errs *packer.MultiError) {
for _, rid := range c.UserAssignedManagedIdentities {
r, err := client.ParseResourceID(rid)
if err != nil {
err := fmt.Errorf("Error parsing resource ID from `user_assigned_managed_identities`; please make sure"+
" that this value follows the full resource id format: "+
"/subscriptions/<SUBSCRIPTON_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/<USER_ASSIGNED_IDENTITY_NAME>.\n"+
" Original error: %s", err)
errs = packer.MultiErrorAppend(errs, err)
} else {
if !strings.EqualFold(r.Provider, "Microsoft.ManagedIdentity") {