The scripts are using Management Group Name in the URIs for the REST calls, but it should be the ID. The service connection dialog asks for both MG name and MG id, but MG name is essentially a display name.
I was able to get tasks working by using the MG ID in the name field for the service connection, but obviously that is not ideal.
I forgot to create this issue earlier, apologies.
The scripts are using Management Group Name in the URIs for the REST calls, but it should be the ID. The service connection dialog asks for both MG name and MG id, but MG name is essentially a display name.
I was able to get tasks working by using the MG ID in the name field for the service connection, but obviously that is not ideal.