az iot central api-token

Create and Manage API tokens.

Commands

az iot central api-token create

Create a new API token in the application.

az iot central api-token delete

Delete an API token from the application.

az iot central api-token list

Get a list of all token meta data (e.g. Role as a GUID and expiration).

az iot central api-token show

Get token meta data (e.g. role as a GUID, expiration).

az iot central api-token create

Create a new API token in the application.

The only time you will see the value of this token is when creating the token. Ensure you store this token somewhere securely, as if you lose it, you will need to create another.

az iot central api-token create --app-id
                                --role {admin, builder, operator}
                                --tkid
                                [--central-api-uri]
                                [--token]

Examples

Add new API token

az iot central api-token create --token-id {tokenId} --app-id {appId} --role admin

Required Parameters

--app-id -n

Target App.

--role -r

Role for the user/service-principal you are adding to the app.

accepted values: admin, builder, operator
--tkid --token-id

Unique ID for the API token.

Optional Parameters

--central-api-uri --central-dns-suffix

Central dns suffix. This enables running cli commands against non public/prod environments.

default value: azureiotcentral.com
--token

Authorization token for request. More info available here: https://docs.microsoft.com/en-us/learn/modules/manage-iot-central-apps-with-rest-api/ MUST INCLUDE type (e.g. 'SharedAccessToken ...', 'Bearer ...'). Example: 'Bearer someBearerTokenHere'.

az iot central api-token delete

Delete an API token from the application.

az iot central api-token delete --app-id
                                --tkid
                                [--central-api-uri]
                                [--token]

Examples

Delete an API token

az iot central api-token delete --app-id {appid} --token-id {tokenId}

Required Parameters

--app-id -n

Target App.

--tkid --token-id

Unique ID for the API token.

Optional Parameters

--central-api-uri --central-dns-suffix

Central dns suffix. This enables running cli commands against non public/prod environments.

default value: azureiotcentral.com
--token

Authorization token for request. More info available here: https://docs.microsoft.com/en-us/learn/modules/manage-iot-central-apps-with-rest-api/ MUST INCLUDE type (e.g. 'SharedAccessToken ...', 'Bearer ...'). Example: 'Bearer someBearerTokenHere'.

az iot central api-token list

Get a list of all token meta data (e.g. Role as a GUID and expiration).

Information in the list contains basic information about the tokens in the application and does not include token values.

az iot central api-token list --app-id
                              [--central-api-uri]
                              [--token]

Examples

List of API tokens

az iot central api-token list --app-id {appid}

Required Parameters

--app-id -n

Target App.

Optional Parameters

--central-api-uri --central-dns-suffix

Central dns suffix. This enables running cli commands against non public/prod environments.

default value: azureiotcentral.com
--token

Authorization token for request. More info available here: https://docs.microsoft.com/en-us/learn/modules/manage-iot-central-apps-with-rest-api/ MUST INCLUDE type (e.g. 'SharedAccessToken ...', 'Bearer ...'). Example: 'Bearer someBearerTokenHere'.

az iot central api-token show

Get token meta data (e.g. role as a GUID, expiration).

API token information contains basic information about the token and does not include the value of the token.

az iot central api-token show --app-id
                              --tkid
                              [--central-api-uri]
                              [--token]

Examples

Get API token

az iot central api-token show --app-id {appid} --token-id {tokenId}

Required Parameters

--app-id -n

Target App.

--tkid --token-id

Unique ID for the API token.

Optional Parameters

--central-api-uri --central-dns-suffix

Central dns suffix. This enables running cli commands against non public/prod environments.

default value: azureiotcentral.com
--token

Authorization token for request. More info available here: https://docs.microsoft.com/en-us/learn/modules/manage-iot-central-apps-with-rest-api/ MUST INCLUDE type (e.g. 'SharedAccessToken ...', 'Bearer ...'). Example: 'Bearer someBearerTokenHere'.