I am writing a Java program that creates a VM and accesses files from a storage. However, I am having trouble to assign that VM the role "Storage contributor/owner", so that it can.
I currently have this code, but I'm not sure if it's what I need and also I don't know what to write at some places:
rbacManager = GraphRbacManager.authenticate( credentials );
rbacManager.roleAssignments()
.define("roletest")
// which object? and where to find the ID?
.forObjectId("/subscription/" + subscription + "?")
.withBuiltInRole(com.microsoft.azure.management.graphrbac.BuiltInRole.STORAGE_ACCOUNT_CONTRIBUTOR)
// what should go as resource scope?
.withResourceScope(?)
.createAsync();
Esentially I want to do this step in Java code:
Thank you in advance!