i managed to fix it without registering the enterprise app in tenant 1.
I attempted again by running the put request with the bearer token from the owner of the enrollment account for tenant 2, and this time it worked,
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have 2 azure tenants (tenant 1 and tenant 2).
We also have one Enterprise agreement that we use to create subscriptions for both tenant 1 and tenant 2, the billing account that has the EA is in tenant 1, and we have an enrollment account in tenant 2 that is connected to the billing account in tenant 1.
We need to assign the subscription creator role to a service principal in tenant 2, and have used the steps in this ms learn documentation
Since the PUT request needed to assign this role expects the service principal to be in the same tenant as the billing account, i have also added the sp to tenant 1.
But, when running the PUT request to give the service principal the access to create subscriptions with the enrollment account in tenant 2, it just returns an error "role cannot be assigned since user tenant is different from account owner tenant.".
When i got that error, i had the value for principalTenantId set to the tenant ID of tenant1.
I tried again, but this time with principalTenantId being set to the value of tenant2, and then i got this error: "The provided principal Tenant Id =
i managed to fix it without registering the enterprise app in tenant 1.
I attempted again by running the put request with the bearer token from the owner of the enrollment account for tenant 2, and this time it worked,