This template deploys a linux VM with an MSI that has access to a storage account in a different resource group.
{"type": "microsoft.compute/virtualmachines", "apiversion": "2019-03-01", "name": "[parameters('vmname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/networkinterfaces/", variables('networkinterfacename'))]"], "identity": {"type": "systemassigned"}, "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[parameters('vmname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "storageprofile": {"osdisk": {"createoption": "fromimage", "manageddisk": {"storageaccounttype": "[variables('osdisktype')]"}}, "imagereference": {"publisher": "canonical", "offer": "ubuntuserver", "sku": "[parameters('ubuntuosversion')]", "version": "latest"}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", variables('networkinterfacename'))]"}]}}} 