az iot central api-token

Note

This reference is part of the azure-iot extension for the Azure CLI (version 2.30.0 or higher). The extension will automatically install the first time you run an az iot central api-token command. Learn more about extensions.

Manage API tokens for your IoT Central application.

IoT Central allows you to generate and manage API tokens to be used to access the IoT Central API. More information about APIs can be found at https://aka.ms/iotcentraldocsapi.

Commands

az iot central api-token create

Generate an API token associated with your IoT Central application.

az iot central api-token delete

Delete an API token associated with your IoT Central application.

az iot central api-token list

Get the list of API tokens associated with your IoT Central application.

az iot central api-token show

Get details for an API token associated with your IoT Central application.

az iot central api-token create

Generate an API token associated with your IoT Central application.

Note: Write down your token once it's been generated as you won't be able to retrieve it again.

az iot central api-token create --app-id
                                --role
                                --tkid
                                [--api-version {1.0, 1.1-preview, 2022-05-31, preview}]
                                [--central-api-uri]
                                [--org-id]
                                [--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

The App ID of the IoT Central app you want to manage. You can find the App ID in the "About" page for your application under the help menu.

--role -r

The role that will be associated with this token or user. You can specify one of the built-in roles, or specify the role ID of a custom role. See more at https://aka.ms/iotcentral-customrolesdocs.

--tkid --token-id

The IoT Central ID associated with this token, [0-9a-zA-Z-] allowed, max length limit to 40. Specify an ID that you'll then use when modifying or deleting this token later via the CLI or API.

Optional Parameters

--api-version --av

The API version for the requested operation.

accepted values: 1.0, 1.1-preview, 2022-05-31, preview
default value: 2022-05-31
--central-api-uri --central-dns-suffix

The IoT Central DNS suffix associated with your application.

default value: azureiotcentral.com
--org-id --organization-id

The ID of the organization for the token role assignment. Only available for api-version == 1.1-preview.

--token

If you'd prefer to submit your request without authenticating against the Azure CLI, you can specify a valid user token to authenticate your request. You must specify the type of key as part of the request. Learn more at https://aka.ms/iotcentraldocsapi.

az iot central api-token delete

Delete an API token associated with your IoT Central application.

az iot central api-token delete --app-id
                                --tkid
                                [--api-version {1.0, 1.1-preview, 2022-05-31, preview}]
                                [--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

The App ID of the IoT Central app you want to manage. You can find the App ID in the "About" page for your application under the help menu.

--tkid --token-id

The IoT Central ID associated with this token, [0-9a-zA-Z-] allowed, max length limit to 40. Specify an ID that you'll then use when modifying or deleting this token later via the CLI or API.

Optional Parameters

--api-version --av

The API version for the requested operation.

accepted values: 1.0, 1.1-preview, 2022-05-31, preview
default value: 2022-05-31
--central-api-uri --central-dns-suffix

The IoT Central DNS suffix associated with your application.

default value: azureiotcentral.com
--token

If you'd prefer to submit your request without authenticating against the Azure CLI, you can specify a valid user token to authenticate your request. You must specify the type of key as part of the request. Learn more at https://aka.ms/iotcentraldocsapi.

az iot central api-token list

Get the list of API tokens associated with your IoT Central application.

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
                              [--api-version {1.0, 1.1-preview, 2022-05-31, preview}]
                              [--central-api-uri]
                              [--token]

Examples

List of API tokens

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

Required Parameters

--app-id -n

The App ID of the IoT Central app you want to manage. You can find the App ID in the "About" page for your application under the help menu.

Optional Parameters

--api-version --av

The API version for the requested operation.

accepted values: 1.0, 1.1-preview, 2022-05-31, preview
default value: 2022-05-31
--central-api-uri --central-dns-suffix

The IoT Central DNS suffix associated with your application.

default value: azureiotcentral.com
--token

If you'd prefer to submit your request without authenticating against the Azure CLI, you can specify a valid user token to authenticate your request. You must specify the type of key as part of the request. Learn more at https://aka.ms/iotcentraldocsapi.

az iot central api-token show

Get details for an API token associated with your IoT Central application.

List details, like its associated role, for an API token in your IoT Central app.

az iot central api-token show --app-id
                              --tkid
                              [--api-version {1.0, 1.1-preview, 2022-05-31, preview}]
                              [--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

The App ID of the IoT Central app you want to manage. You can find the App ID in the "About" page for your application under the help menu.

--tkid --token-id

The IoT Central ID associated with this token, [0-9a-zA-Z-] allowed, max length limit to 40. Specify an ID that you'll then use when modifying or deleting this token later via the CLI or API.

Optional Parameters

--api-version --av

The API version for the requested operation.

accepted values: 1.0, 1.1-preview, 2022-05-31, preview
default value: 2022-05-31
--central-api-uri --central-dns-suffix

The IoT Central DNS suffix associated with your application.

default value: azureiotcentral.com
--token

If you'd prefer to submit your request without authenticating against the Azure CLI, you can specify a valid user token to authenticate your request. You must specify the type of key as part of the request. Learn more at https://aka.ms/iotcentraldocsapi.