ServicePrincipalsOperations Class

ServicePrincipalsOperations operations.

Inheritance
builtins.object
ServicePrincipalsOperations

Constructor

ServicePrincipalsOperations(client, config, serializer, deserializer)

Parameters

Name Description
client
Required

Client for service requests.

config
Required

Configuration of service client.

serializer
Required

An object model serializer.

deserializer
Required

An object model deserializer.

Variables

Name Description
api_version

Client API version. Constant value: "1.6".

Methods

create

Creates a service principal in the directory.

delete

Deletes a service principal from the directory.

get

Gets service principal information from the directory. Query by objectId or pass a filter to query by appId.

list

Gets a list of service principals from the current tenant.

list_key_credentials

Get the keyCredentials associated with the specified service principal.

list_owners

Directory objects that are owners of this service principal.

The owners are a set of non-admin users who are allowed to modify this object.

list_password_credentials

Gets the passwordCredentials associated with a service principal.

update

Updates a service principal in the directory.

update_key_credentials

Update the keyCredentials associated with a service principal.

update_password_credentials

Updates the passwordCredentials associated with a service principal.

create

Creates a service principal in the directory.

create(parameters, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
parameters
Required

Parameters to create a service principal.

custom_headers

headers that will be added to the request

default value: None
raw

returns the direct response alongside the deserialized response

default value: False
operation_config
Required

Operation configuration overrides.

Returns

Type Description
<xref:msrest.pipeline.ClientRawResponse>

ServicePrincipal or ClientRawResponse if raw=true

Exceptions

Type Description

delete

Deletes a service principal from the directory.

delete(object_id, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
object_id
Required
str

The object ID of the service principal to delete.

custom_headers

headers that will be added to the request

default value: None
raw

returns the direct response alongside the deserialized response

default value: False
operation_config
Required

Operation configuration overrides.

Returns

Type Description
None,
<xref:msrest.pipeline.ClientRawResponse>

None or ClientRawResponse if raw=true

Exceptions

Type Description

get

Gets service principal information from the directory. Query by objectId or pass a filter to query by appId.

get(object_id, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
object_id
Required
str

The object ID of the service principal to get.

custom_headers

headers that will be added to the request

default value: None
raw

returns the direct response alongside the deserialized response

default value: False
operation_config
Required

Operation configuration overrides.

Returns

Type Description
<xref:msrest.pipeline.ClientRawResponse>

ServicePrincipal or ClientRawResponse if raw=true

Exceptions

Type Description

list

Gets a list of service principals from the current tenant.

list(filter=None, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
filter
str

The filter to apply to the operation.

default value: None
custom_headers

headers that will be added to the request

default value: None
raw

returns the direct response alongside the deserialized response

default value: False
operation_config
Required

Operation configuration overrides.

Returns

Type Description

An iterator like instance of ServicePrincipal

Exceptions

Type Description

list_key_credentials

Get the keyCredentials associated with the specified service principal.

list_key_credentials(object_id, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
object_id
Required
str

The object ID of the service principal for which to get keyCredentials.

custom_headers

headers that will be added to the request

default value: None
raw

returns the direct response alongside the deserialized response

default value: False
operation_config
Required

Operation configuration overrides.

Returns

Type Description

An iterator like instance of KeyCredential

Exceptions

Type Description

list_owners

Directory objects that are owners of this service principal.

The owners are a set of non-admin users who are allowed to modify this object.

list_owners(object_id, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
object_id
Required
str

The object ID of the service principal for which to get owners.

custom_headers

headers that will be added to the request

default value: None
raw

returns the direct response alongside the deserialized response

default value: False
operation_config
Required

Operation configuration overrides.

Returns

Type Description

An iterator like instance of DirectoryObject

Exceptions

Type Description

list_password_credentials

Gets the passwordCredentials associated with a service principal.

list_password_credentials(object_id, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
object_id
Required
str

The object ID of the service principal.

custom_headers

headers that will be added to the request

default value: None
raw

returns the direct response alongside the deserialized response

default value: False
operation_config
Required

Operation configuration overrides.

Returns

Type Description

An iterator like instance of PasswordCredential

Exceptions

Type Description

update

Updates a service principal in the directory.

update(object_id, parameters, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
object_id
Required
str

The object ID of the service principal to delete.

parameters
Required

Parameters to update a service principal.

custom_headers

headers that will be added to the request

default value: None
raw

returns the direct response alongside the deserialized response

default value: False
operation_config
Required

Operation configuration overrides.

Returns

Type Description
None,
<xref:msrest.pipeline.ClientRawResponse>

None or ClientRawResponse if raw=true

Exceptions

Type Description

update_key_credentials

Update the keyCredentials associated with a service principal.

update_key_credentials(object_id, value, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
object_id
Required
str

The object ID for which to get service principal information.

value
Required

A collection of KeyCredentials.

custom_headers

headers that will be added to the request

default value: None
raw

returns the direct response alongside the deserialized response

default value: False
operation_config
Required

Operation configuration overrides.

Returns

Type Description
None,
<xref:msrest.pipeline.ClientRawResponse>

None or ClientRawResponse if raw=true

Exceptions

Type Description

update_password_credentials

Updates the passwordCredentials associated with a service principal.

update_password_credentials(object_id, value, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
object_id
Required
str

The object ID of the service principal.

value
Required

A collection of PasswordCredentials.

custom_headers

headers that will be added to the request

default value: None
raw

returns the direct response alongside the deserialized response

default value: False
operation_config
Required

Operation configuration overrides.

Returns

Type Description
None,
<xref:msrest.pipeline.ClientRawResponse>

None or ClientRawResponse if raw=true

Exceptions

Type Description

Attributes

models

models = <module 'azure.graphrbac.models' from 'C:\\hostedtoolcache\\windows\\Python\\3.11.9\\x64\\Lib\\site-packages\\azure\\graphrbac\\models\\__init__.py'>