Skip to content

Commit 24a9637

Browse files
committed
Pass in the resource name regardless of if its a VM or managed identity
1 parent 4822516 commit 24a9637

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

authority/provisioner/azure.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -269,13 +269,8 @@ func (p *Azure) authorizeToken(token string) (*azurePayload, string, string, str
269269

270270
var subscription, group, name string
271271
identityObjectID := claims.ObjectID
272+
subscription, group, name = re[1], re[2], re[4]
272273

273-
if strings.Contains(claims.XMSMirID, "virtualMachines") {
274-
subscription, group, name = re[1], re[2], re[4]
275-
} else {
276-
// This is not a VM resource ID so we don't have the VM name so set that to the empty string
277-
subscription, group, name = re[1], re[2], ""
278-
}
279274
return &claims, name, group, subscription, identityObjectID, nil
280275
}
281276

0 commit comments

Comments
 (0)