PowerBIToken.CreateProvisionToken Method (String)

 

Creates a provision token with default expiration used to manages workspaces witin a workspace collection

Namespace:   Microsoft.PowerBI.Security
Assembly:  Microsoft.PowerBI.Core (in Microsoft.PowerBI.Core.dll)

Syntax

public static PowerBIToken CreateProvisionToken(
    string workspaceCollectionName
)

Parameters

  • workspaceCollectionName
    Type: System.String

    The workspace collection name

Return Value

Type: Microsoft.PowerBI.Security.PowerBIToken

The Power BI access token

Examples

The following example creates a provision token from a Workspace Collection name.

static async Task<Workspace> CreateWorkspace(string workspaceCollectionName)
{
    // Create a provision token required to create a new workspace within your collection
    var provisionToken = PowerBIToken.CreateProvisionToken(workspaceCollectionName);
    using (var client = await CreateClient(provisionToken))
    {
        // Create a new workspace witin the specified collection
        return await client.Workspaces.PostWorkspaceAsync(workspaceCollectionName);
    }
}

See Also

CreateProvisionToken Overload
PowerBIToken Class
Microsoft.PowerBI.Security Namespace

Return to top