Skip to main content

api_keys

Creates, updates, deletes, gets or lists an api_keys resource.

Overview

Nameapi_keys
TypeResource
Idazure.application_insights.api_keys

Fields

The following fields are returned by SELECT queries:

The API Key for this key id.

NameDatatypeDescription
idstringThe unique ID of the API key inside an Application Insights component. It is auto generated when the API key is created.
namestringThe name of the API key.
apiKeystringThe API key value. It will be only return once when the API Key was created.
createdDatestringThe create date of this API key.
linkedReadPropertiesarrayThe read access rights of this API Key.
linkedWritePropertiesarrayThe write access rights of this API Key.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresourceGroupName, subscriptionId, resourceName, keyIdGet the API Key for this key id.
listselectresourceGroupName, subscriptionId, resourceNameGets a list of API keys of an Application Insights component.
createinsertresourceGroupName, subscriptionId, resourceNameCreate an API Key of an Application Insights component.
deletedeleteresourceGroupName, subscriptionId, resourceName, keyIdDelete an API Key of an Application Insights component.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
keyIdstringThe API Key ID. This is unique within a Application Insights component.
resourceGroupNamestringThe name of the resource group. The name is case insensitive.
resourceNamestringThe name of the Application Insights component resource.
subscriptionIdstring (uuid)The ID of the target subscription. The value must be an UUID.

SELECT examples

Get the API Key for this key id.

SELECT
id,
name,
apiKey,
createdDate,
linkedReadProperties,
linkedWriteProperties
FROM azure.application_insights.api_keys
WHERE resourceGroupName = '{{ resourceGroupName }}' -- required
AND subscriptionId = '{{ subscriptionId }}' -- required
AND resourceName = '{{ resourceName }}' -- required
AND keyId = '{{ keyId }}' -- required
;

INSERT examples

Create an API Key of an Application Insights component.

INSERT INTO azure.application_insights.api_keys (
data__name,
data__linkedReadProperties,
data__linkedWriteProperties,
resourceGroupName,
subscriptionId,
resourceName
)
SELECT
'{{ name }}',
'{{ linkedReadProperties }}',
'{{ linkedWriteProperties }}',
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ resourceName }}'
RETURNING
id,
name,
apiKey,
createdDate,
linkedReadProperties,
linkedWriteProperties
;

DELETE examples

Delete an API Key of an Application Insights component.

DELETE FROM azure.application_insights.api_keys
WHERE resourceGroupName = '{{ resourceGroupName }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
AND resourceName = '{{ resourceName }}' --required
AND keyId = '{{ keyId }}' --required
;