แชร์ผ่าน


Gateways - Add Datasource User

Grants or updates the permissions required to use the specified data source for the specified user.

Permissions

The user must have gateway admin permissions.

Required Scope

Dataset.ReadWrite.All

Limitations

Virtual network (VNet) gateways aren't supported. Adding groups through the API is not supported.

POST https://api.powerbi.com/v1.0/myorg/gateways/{gatewayId}/datasources/{datasourceId}/users

URI Parameters

Name In Required Type Description
datasourceId
path True

string

uuid

The data source ID

gatewayId
path True

string

uuid

The gateway ID. When using a gateway cluster, the gateway ID refers to the primary (first) gateway in the cluster. In such cases, gateway ID is similar to gateway cluster ID.

Request Body

Name Required Type Description
datasourceAccessRight True

DatasourceUserAccessRight

The access right (permission level) that a user has on the data source

displayName

string

The display name of the principal

emailAddress

string

The email address of the user

identifier

string

The object ID of the principal

principalType

PrincipalType

The principal type

profile

ServicePrincipalProfile

A Power BI service principal profile. Only relevant for Power BI Embedded multi-tenancy solution.

Responses

Name Type Description
200 OK

OK

Examples

Assign the ReadOverrideEffectiveIdentity user access right to a service principal example
Example

Assign the ReadOverrideEffectiveIdentity user access right to a service principal example

Sample request

POST https://api.powerbi.com/v1.0/myorg/gateways/1f69e798-5852-4fdd-ab01-33bb14b6e934/datasources/252b9de8-d915-4788-aaeb-ec8c2395f970/users
{
  "identifier": "3d9b93c6-7b6d-4801-a491-1738910904fd",
  "datasourceAccessRight": "ReadOverrideEffectiveIdentity"
}

Sample response

Example

Sample request

POST https://api.powerbi.com/v1.0/myorg/gateways/1f69e798-5852-4fdd-ab01-33bb14b6e934/datasources/252b9de8-d915-4788-aaeb-ec8c2395f970/users
{
  "emailAddress": "john@contoso.com",
  "datasourceAccessRight": "Read"
}

Sample response

Definitions

Name Description
DatasourceUser

A Power BI user with access to the data source

DatasourceUserAccessRight

The access right (permission level) that a user has on the data source

PrincipalType

The principal type

ServicePrincipalProfile

A Power BI service principal profile. Only relevant for Power BI Embedded multi-tenancy solution.

DatasourceUser

A Power BI user with access to the data source

Name Type Description
datasourceAccessRight

DatasourceUserAccessRight

The access right (permission level) that a user has on the data source

displayName

string

The display name of the principal

emailAddress

string

The email address of the user

identifier

string

The object ID of the principal

principalType

PrincipalType

The principal type

profile

ServicePrincipalProfile

A Power BI service principal profile. Only relevant for Power BI Embedded multi-tenancy solution.

DatasourceUserAccessRight

The access right (permission level) that a user has on the data source

Name Type Description
None

string

No permission to access the data source. Only applies when updating user permissions.

Read

string

Datasets owned by the user have read access to the data source

ReadOverrideEffectiveIdentity

string

The user can override the effective identity for Power BI Embedded. Applicable only for on-premises Analysis Services data sources.

PrincipalType

The principal type

Name Type Description
App

string

Service principal type

Group

string

Group principal type

None

string

No principal type. Use for whole organization level access.

User

string

User principal type

ServicePrincipalProfile

A Power BI service principal profile. Only relevant for Power BI Embedded multi-tenancy solution.

Name Type Description
displayName

string

The service principal profile name

id

string

The service principal profile ID