Error Creating Modern Team site - Current site is not a tenant administration site

I'm using the flow action Create Modern SharePoint site
to create a site as TeamSiteWithoutGroup.
When it run I get the error
Current site is not a tenant administration site.

I'm using an Admin API key for auth due to MFA authentication and this works for other action like setting the description of site using Update Site Properties action.

Any ideas?
Thanks,
Gavin

Hello Gavin! To create sites, you need to use a custom credential API key, it is required by SharePoint security settings. In the case of MFA, you need to create the key using an app password.

Hi Evgeniy,
also resolved this with a support ticket.
This is with a new Office 365 tenancy using the security defaults, so App passwords are disabled and for the sake of just this action I'm not switching the security defaults off.

I ended up using the out of the send http to sharepoint action and using REST api to create the modern site. - Create Modern SharePoint Sites using REST | Microsoft Learn

Thanks,
Gavin

Hello Gavin! Thank you for sharing results of the case. I passed your reply to developers, perhaps they will be able to find out how to avoid using the custom credential API key.

I have this error too.

In my flow I can create a team-site and provision a pnp.template to it. But for one template type, it displays the message: Current site is not a tenant administration site. The site I apply the template to has been created with a sent https request. The exact same settings for meeting site condition. A meeting site uses a teamsite with no connected groups and then it applies the pnp template.

How can i solve it?

I built a switch in the workflow based on template value. For a meeting-site, it works. If I pick a team-site, it fails with this message. I created the pnp template the same way.

{
"statusCode": 400,
"headers": {
"Transfer-Encoding": "chunked",
"x-jobid": "0HN2TCHREQ91Efa9d8470",
"Date": "Tue, 16 Apr 2024 09:52:18 GMT",
"Referrer-Policy": "strict-origin-when-cross-origin",
"Content-Type": "application/json; charset=utf-8",
"Content-Length": "204"
},
"body": {
"request": {
"url": null,
"traceId": "0HN2TCHREQ91Efa9d8470"
},
"error": {
"code": "ApplicationResultException",
"message": "Current site is not a tenant administration site.",
"date": "2024-04-16T09:52:19.2019749Z"
}
}
}

Ron, could you also share the raw inputs of the failed action and screenshots of the flow configuration in the ticket you raised? When taking the screenshots, please ensure that all steps are unfolded and fully visible so that we can re-produce your automation.