C#renaming a Power BI workspace through a service principal could have offered much-desired API support if there had been one for renaming workspaces; however, implementing a workspace rename is possible by creating a new one with the desired name, migrating contents into it, and deleting the old one.
1. Create a New Workspace: Use the Create Group API (POST /groups) for this.
2. Migrate Content: Pull reports, dashboards, and datasets out of the old workspace (GET /groups/{groupId}/reports) and upload or rebind in the new.
3. Set Correct Permissions for Workspace: Make sure all users and service principals have the correct permissions from above in the new workspace.
4. Delete the Old Workspace: After migration, delete the first workspace DELETE /groups/{groupId} (for non-premium workspaces only).
Renaming is a common requirement; therefore, consider using PowerShell (Set-PowerBIWorkspace) for this purpose. This tool uses the admin API to allow renaming but requires tenant-level admin permissions.