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:

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
getselectresource_group_name, resource_name, key_id, subscription_idGet the API Key for this key id.
listselectresource_group_name, resource_name, subscription_idGets a list of API keys of an Application Insights component.
createinsertresource_group_name, resource_name, subscription_idCreate an API Key of an Application Insights component.
deletedeleteresource_group_name, resource_name, key_id, subscription_idDelete 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
key_idstringThe API Key ID. This is unique within a Application Insights component. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
resource_namestringThe name of the Application Insights component resource. Required.
subscription_idstring

SELECT examples

Get the API Key for this key id.

SELECT
id,
name,
apiKey,
createdDate,
linkedReadProperties,
linkedWriteProperties
FROM azure.application_insights.api_keys
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND resource_name = '{{ resource_name }}' -- required
AND key_id = '{{ key_id }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Create an API Key of an Application Insights component.

INSERT INTO azure.application_insights.api_keys (
name,
linkedReadProperties,
linkedWriteProperties,
resource_group_name,
resource_name,
subscription_id
)
SELECT
'{{ name }}',
'{{ linkedReadProperties }}',
'{{ linkedWriteProperties }}',
'{{ resource_group_name }}',
'{{ resource_name }}',
'{{ subscription_id }}'
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 resource_group_name = '{{ resource_group_name }}' --required
AND resource_name = '{{ resource_name }}' --required
AND key_id = '{{ key_id }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;