ProvisionSample/Program.cs
/// <summary>
/// Creates a new instance of the PowerBIClient with the specified token
/// </summary>
/// <returns></returns>
Creates a new instance of the PowerBIClient with the specified token
Creates a new instance of the PowerBIClient with the specified token
static async Task<IPowerBIClient> CreateClient()
        {
            if (accessKeys == null)
            {
                Console.Write("Access Key: ");
                accessKey = Console.ReadLine();
                Console.WriteLine();
                accessKeys = new WorkspaceCollectionKeys()
                {
                    Key1 = accessKey
                };
            }
            if (accessKeys == null)
            {
                accessKeys = await ListWorkspaceCollectionKeys(subscriptionId, resourceGroup, workspaceCollectionName);
            }
            var credentials = new TokenCredentials(accessKeys.Key1, "AppKey");
            var client = new PowerBIClient(credentials);
            client.BaseUri = new Uri(apiEndpointUri);
            return client;
        }
static async Task < IPowerBIClient > CreateClient ( ) { if ( accessKeys == null ) { Console . Write ( " " ) ; accessKey = Console . ReadLine ( ) ; Console . WriteLine ( ) ; accessKeys = new WorkspaceCollectionKeys ( ) { Key1 = accessKey } ; } if ( accessKeys == null ) { accessKeys = await ListWorkspaceCollectionKeys ( subscriptionId , resourceGroup , workspaceCollectionName ) ; } var credentials = new TokenCredentials ( accessKeys . Key1 , " " ) ; var client = new PowerBIClient ( credentials ) ; client . BaseUri = new Uri ( apiEndpointUri ) ; return client ; }
Creates a new instance of the PowerBIClient with the specified token
Creates a new instance of the PowerBIClient with the specified token
// Create a token credentials with "AppKey" type // Instantiate your Power BI client passing in the required credentials // Override the api endpoint base URL.  Default value is https://api.powerbi.com
None