Skip to main content

api_keys

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

Overview

Nameapi_keys
TypeResource
Idazure.application_insights.api_keys

Fields

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

NameAccessible byRequired ParamsDescription
getSELECTkeyId, resourceGroupName, resourceName, subscriptionIdGet the API Key for this key id.
listSELECTresourceGroupName, resourceName, subscriptionIdGets a list of API keys of an Application Insights component.
createINSERTresourceGroupName, resourceName, subscriptionIdCreate an API Key of an Application Insights component.
deleteDELETEkeyId, resourceGroupName, resourceName, subscriptionIdDelete an API Key of an Application Insights component.

SELECT examples

Gets a list of API keys of an Application Insights component.

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

INSERT example

Use the following StackQL query and manifest file to create a new api_keys resource.

/*+ create */
INSERT INTO azure.application_insights.api_keys (
resourceGroupName,
resourceName,
subscriptionId,
name,
linkedReadProperties,
linkedWriteProperties
)
SELECT
'{{ resourceGroupName }}',
'{{ resourceName }}',
'{{ subscriptionId }}',
'{{ name }}',
'{{ linkedReadProperties }}',
'{{ linkedWriteProperties }}'
;

DELETE example

Deletes the specified api_keys resource.

/*+ delete */
DELETE FROM azure.application_insights.api_keys
WHERE keyId = '{{ keyId }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND resourceName = '{{ resourceName }}'
AND subscriptionId = '{{ subscriptionId }}';