다음을 통해 공유


Application Insights에 대한 Microsoft Entra 인증

Application Insights는 이제 Microsoft Entra 인증을 지원합니다. Microsoft Entra ID를 사용하여 Application Insights 리소스에 인증된 원격 분석만 수집되도록 할 수 있습니다.

다양한 인증 시스템을 사용하면 복잡해질 수 있으며, 대규모로 자격 증명을 관리하기 어렵기 때문에 위험을 초래할 수 있습니다. 이제 로컬 인증을 옵트아웃하고 관리 ID를 사용하여 독점적으로 인증된 원격 분석과 Microsoft Entra ID만 리소스에 수집되도록 선택할 수 있습니다. 이 기능은 중요한 운영(경고자동 스케일링) 및 비즈니스 결정을 내리는 데 사용되는 원격 분석의 보안과 안정성을 강화하기 위한 단계입니다.

필수 조건

다음은 Microsoft Entra 인증 수집을 사용하도록 설정하기 위한 예비 단계입니다. 그러려면 다음 작업을 수행해야 합니다.

지원되지 않는 시나리오

다음 SDK(소프트웨어 개발 키트) 및 기능은 Microsoft Entra 인증 수집과 함께 사용할 수 없습니다.

Microsoft Entra ID 기반 인증 구성 및 사용

  1. ID가 아직 없는 경우 관리 ID 또는 서비스 주체를 사용하여 만듭니다.

    • 관리 ID를 사용하는 것이 좋습니다.

      Azure 서비스(Virtual Machines 또는 App Service)용 관리 ID를 설정합니다.

    • 서비스 주체를 사용하지 않는 것이 좋습니다.

      리소스에 액세스할 수 있는 Microsoft Entra 애플리케이션 및 서비스 주체 생성 방법에 대한 자세한 내용은 서비스 주체 생성을 참조하세요.

  2. Azure ID, 서비스 주체 또는 Azure 사용자 계정에 필요한 RBAC(역할 기반 액세스 제어) 역할을 할당합니다.

    대상 Application Insights 리소스를 역할 범위로 설정하여 예상 ID, 서비스 주체 또는 Azure 사용자 계정에 모니터링 메트릭 게시자 역할을 추가하려면 Azure 역할 할당의 단계를 따릅니다.

    참고 항목

    모니터링 메트릭 게시자 역할은 "메트릭"이라고 하지만 모든 원격 분석을 Application Insights 리소스에 게시합니다.

  3. 다음 언어에 따라 구성 지침을 따릅니다.

참고 항목

Application Insights .NET SDK에서 Microsoft Entra ID에 대한 지원은 2.18-Beta3 버전부터 포함됩니다.

Application Insights .NET SDK는 Azure ID에서 제공하는 자격 증명 클래스를 지원합니다.

  • 로컬 개발에는 DefaultAzureCredential을 권장합니다.
  • 예상되는 Azure 사용자 계정으로 Visual Studio에서 인증되었는지 확인합니다. 자세한 내용은 Visual Studio를 통해 인증을 참조하세요.
  • 시스템 할당 및 사용자 할당 관리 ID에는 ManagedIdentityCredential을 권장합니다.
    • 시스템 할당의 경우, 매개 변수 없이 기본 생성자를 사용합니다.
    • 사용자 할당의 경우 생성자에 클라이언트 ID를 제공합니다.

다음 예에서는 .NET을 사용하여 TelemetryConfiguration을 수동으로 만들고 구성하는 방법을 보여 줍니다.

TelemetryConfiguration.Active.ConnectionString = "InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://xxxx.applicationinsights.azure.com/";
var credential = new DefaultAzureCredential();
TelemetryConfiguration.Active.SetAzureTokenCredential(credential);

다음 예에서는 .NET Core를 사용하여 TelemetryConfiguration을 구성하는 방법을 보여 줍니다.

services.Configure<TelemetryConfiguration>(config =>
{
       var credential = new DefaultAzureCredential();
       config.SetAzureTokenCredential(credential);
});
services.AddApplicationInsightsTelemetry(new ApplicationInsightsServiceOptions
{
    ConnectionString = "InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://xxxx.applicationinsights.azure.com/"
});

Microsoft Entra 인증을 사용하여 Application Insights 쿼리

Azure Monitor Log Analytics 엔드포인트 https://api.applicationinsights.io를 사용하여 쿼리 요청을 제출할 수 있습니다. 엔드포인트에 액세스하려면 Microsoft Entra ID를 통해 인증해야 합니다.

인증 설정

API에 액세스하려면 Microsoft Entra ID로 클라이언트 앱을 등록하고 토큰을 요청합니다.

  1. Microsoft Entra ID에 앱을 등록합니다.

  2. 앱의 개요 페이지에서 API 권한을 선택합니다.

  3. 권한 추가를 선택합니다.

  4. 조직에서 탭에서 사용하는 API에서 Application Insights를 검색하고 목록에서 Application Insights API를 선택합니다.

  5. 위임된 권한을 선택합니다.

  6. Data.Read 확인란을 선택합니다.

  7. 권한 추가를 선택합니다.

이제 앱이 등록되고 API를 사용할 수 있는 권한이 있으므로 앱에 Application Insights 리소스에 대한 액세스 권한을 부여합니다.

  1. Application Insights 리소스 개요 페이지에서 액세스 제어(IAM)를 선택합니다.

  2. 역할 할당 추가를 선택합니다.

  3. 읽기 권한자 역할을 선택한 다음, 구성원을 선택합니다.

  4. 구성원 탭에서 구성원 선택을 선택합니다.

  5. 선택 상자에 앱의 이름을 입력합니다.

  6. 앱을 선택하고 선택을 선택합니다.

  7. 검토 + 할당을 선택합니다.

  8. Active Directory 설정 및 권한을 완료한 후 권한 부여 토큰을 요청합니다.

참고 항목

이 예제에서는 읽기 권한자 역할을 적용했습니다. 이 역할은 많은 기본 제공 역할 중 하나이며 필요한 것보다 더 많은 권한을 포함할 수 있습니다. 더 세분화된 역할 및 권한을 만들 수 있습니다.

권한 부여 토큰 요청

시작하기 전에 요청을 성공적으로 수행하는 데 필요한 모든 값이 있는지 확인합니다. 모든 요청에는 다음이 필요합니다.

  • Microsoft Entra 테넌트 ID
  • App Insights 앱 ID - 현재 API 키를 사용하고 있다면 동일한 앱 ID입니다.
  • 앱에 대한 Microsoft Entra 클라이언트 ID
  • 앱에 대한 Microsoft Entra 클라이언트 비밀

Application Insights API는 세 가지 다른 Microsoft Entra ID OAuth2 흐름으로 Microsoft Entra 인증을 지원합니다.

  • 클라이언트 자격 증명
  • 인증 코드
  • 암시적

클라이언트 자격 증명 흐름

클라이언트 자격 증명 흐름에서 토큰은 Application Insights 엔드포인트와 함께 사용됩니다. Microsoft Entra ID에서 앱을 등록할 때 이전 단계에서 앱에 입력한 자격 증명을 사용하여 토큰을 수신하도록 단일 요청이 이루어집니다.

https://api.applicationinsights.io 엔드포인트를 사용합니다.

클라이언트 자격 증명 토큰 URL(POST 요청)
    POST /<your-tenant-id>/oauth2/token
    Host: https://login.microsoftonline.com
    Content-Type: application/x-www-form-urlencoded
    
    grant_type=client_credentials
    &client_id=<app-client-id>
    &resource=https://api.applicationinsights.io
    &client_secret=<app-client-secret>

성공적인 요청은 응답에서 다음과 같은 액세스 토큰을 받습니다.

    {
        token_type": "Bearer",
        "expires_in": "86399",
        "ext_expires_in": "86399",
        "access_token": ""eyJ0eXAiOiJKV1QiLCJ.....Ax"
    }

Application Insights 엔드포인트에 대한 요청에서 토큰을 사용합니다.

    POST /v1/apps/yous_app_id/query?timespan=P1D
    Host: https://api.applicationinsights.io
    Content-Type: application/json
    Authorization: Bearer <your access token>

    Body:
    {
    "query": "requests | take 10"
    }

예제 응답:

  "tables": [
    {
      "name": "PrimaryResult",
      "columns": [
        {
          "name": "timestamp",
          "type": "datetime"
        },
        {
          "name": "id",
          "type": "string"
        },
        {
          "name": "source",
          "type": "string"
        },
        {
          "name": "name",
          "type": "string"
        },
        {
          "name": "url",
          "type": "string"
        },
        {
          "name": "success",
          "type": "string"
        },
        {
          "name": "resultCode",
          "type": "string"
        },
        {
          "name": "duration",
          "type": "real"
        },
        {
          "name": "performanceBucket",
          "type": "string"
        },
        {
          "name": "customDimensions",
          "type": "dynamic"
        },
        {
          "name": "customMeasurements",
          "type": "dynamic"
        },
        {
          "name": "operation_Name",
          "type": "string"
        },
        {
          "name": "operation_Id",
          "type": "string"
        },
        {
          "name": "operation_ParentId",
          "type": "string"
        },
        {
          "name": "operation_SyntheticSource",
          "type": "string"
        },
        {
          "name": "session_Id",
          "type": "string"
        },
        {
          "name": "user_Id",
          "type": "string"
        },
        {
          "name": "user_AuthenticatedId",
          "type": "string"
        },
        {
          "name": "user_AccountId",
          "type": "string"
        },
        {
          "name": "application_Version",
          "type": "string"
        },
        {
          "name": "client_Type",
          "type": "string"
        },
        {
          "name": "client_Model",
          "type": "string"
        },
        {
          "name": "client_OS",
          "type": "string"
        },
        {
          "name": "client_IP",
          "type": "string"
        },
        {
          "name": "client_City",
          "type": "string"
        },
        {
          "name": "client_StateOrProvince",
          "type": "string"
        },
        {
          "name": "client_CountryOrRegion",
          "type": "string"
        },
        {
          "name": "client_Browser",
          "type": "string"
        },
        {
          "name": "cloud_RoleName",
          "type": "string"
        },
        {
          "name": "cloud_RoleInstance",
          "type": "string"
        },
        {
          "name": "appId",
          "type": "string"
        },
        {
          "name": "appName",
          "type": "string"
        },
        {
          "name": "iKey",
          "type": "string"
        },
        {
          "name": "sdkVersion",
          "type": "string"
        },
        {
          "name": "itemId",
          "type": "string"
        },
        {
          "name": "itemType",
          "type": "string"
        },
        {
          "name": "itemCount",
          "type": "int"
        }
      ],
      "rows": [
        [
          "2018-02-01T17:33:09.788Z",
          "|0qRud6jz3k0=.c32c2659_",
          null,
          "GET Reports/Index",
          "http://fabrikamfiberapp.azurewebsites.net/Reports",
          "True",
          "200",
          "3.3833",
          "<250ms",
          "{\"_MS.ProcessedByMetricExtractors\":\"(Name:'Requests', Ver:'1.0')\"}",
          null,
          "GET Reports/Index",
          "0qRud6jz3k0=",
          "0qRud6jz3k0=",
          "Application Insights Availability Monitoring",
          "9fc6738d-7e26-44f0-b88e-6fae8ccb6b26",
          "us-va-ash-azr_9fc6738d-7e26-44f0-b88e-6fae8ccb6b26",
          null,
          null,
          "AutoGen_49c3aea0-4641-4675-93b5-55f7a62d22d3",
          "PC",
          null,
          null,
          "52.168.8.0",
          "Boydton",
          "Virginia",
          "United States",
          null,
          "fabrikamfiberapp",
          "RD00155D5053D1",
          "cf58dcfd-0683-487c-bc84-048789bca8e5",
          "fabrikamprod",
          "5a2e4e0c-e136-4a15-9824-90ba859b0a89",
          "web:2.5.0-33031",
          "051ad4ef-0776-11e8-ac6e-e30599af6943",
          "request",
          "1"
        ],
        [
          "2018-02-01T17:33:15.786Z",
          "|x/Ysh+M1TfU=.c32c265a_",
          null,
          "GET Home/Index",
          "http://fabrikamfiberapp.azurewebsites.net/",
          "True",
          "200",
          "716.2912",
          "500ms-1sec",
          "{\"_MS.ProcessedByMetricExtractors\":\"(Name:'Requests', Ver:'1.0')\"}",
          null,
          "GET Home/Index",
          "x/Ysh+M1TfU=",
          "x/Ysh+M1TfU=",
          "Application Insights Availability Monitoring",
          "58b15be6-d1e6-4d89-9919-52f63b840913",
          "emea-se-sto-edge_58b15be6-d1e6-4d89-9919-52f63b840913",
          null,
          null,
          "AutoGen_49c3aea0-4641-4675-93b5-55f7a62d22d3",
          "PC",
          null,
          null,
          "51.141.32.0",
          "Cardiff",
          "Cardiff",
          "United Kingdom",
          null,
          "fabrikamfiberapp",
          "RD00155D5053D1",
          "cf58dcfd-0683-487c-bc84-048789bca8e5",
          "fabrikamprod",
          "5a2e4e0c-e136-4a15-9824-90ba859b0a89",
          "web:2.5.0-33031",
          "051ad4f0-0776-11e8-ac6e-e30599af6943",
          "request",
          "1"
        ]
      ]
    }
  ]
}

인증 코드 흐름

지원되는 기본 OAuth2 흐름은 인증 코드를 통해 이루어집니다. 이 메서드를 사용하려면 Azure Monitor Application Insights API 호출에 사용할 토큰을 가져오기 위해 두 개의 HTTP 요청이 필요합니다. 요청당 하나의 엔드포인트인 두 개의 URL이 있습니다. 이러한 방법은 다음 섹션에서 설명합니다.

인증 코드 URL(GET 요청)
    GET https://login.microsoftonline.com/YOUR_Azure AD_TENANT/oauth2/authorize?
    client_id=<app-client-id>
    &response_type=code
    &redirect_uri=<app-redirect-uri>
    &resource=https://api.applicationinsights.io

권한 부여 URL을 요청할 때 client_id는 앱의 속성 메뉴에서 복사한 Microsoft Entra 앱의 애플리케이션 ID입니다. redirect_uri는 동일한 Microsoft Entra 앱의 홈페이지/로그인 URL입니다. 요청이 성공하면 이 엔드포인트는 URL에 인증 코드가 추가된 등록 시 제공한 로그인 페이지로 리디렉션합니다. 다음 예제를 참조하십시오.

    http://<app-client-id>/?code=AUTHORIZATION_CODE&session_state=STATE_GUID

이 시점에서 액세스 토큰을 요청하는 데 사용할 인증 코드를 가져옵니다.

인증 코드 토큰 URL(POST 요청)
    POST /YOUR_Azure AD_TENANT/oauth2/token HTTP/1.1
    Host: https://login.microsoftonline.com
    Content-Type: application/x-www-form-urlencoded
    
    grant_type=authorization_code
    &client_id=<app client id>
    &code=<auth code fom GET request>
    &redirect_uri=<app-client-id>
    &resource=https://api.applicationinsights.io
    &client_secret=<app-client-secret>

모든 값은 이전과 동일하지만 몇 가지 추가 사항이 있습니다. 인증 코드는 성공적인 리디렉션 후 이전 요청에서 받은 것과 동일한 코드입니다. 코드는 Microsoft Entra 앱에서 얻은 키와 결합됩니다. 키를 저장하지 않은 경우 Microsoft Entra 앱 메뉴의 키 탭에서 키를 삭제하고 새 키를 만들 수 있습니다. 응답은 다음 스키마가 있는 토큰이 포함된 JSON 문자열입니다. 토큰 값에 대한 형식이 표시됩니다.

응답 예제:

    {
        "access_token": "eyJ0eXAiOiJKV1QiLCJ.....Ax",
        "expires_in": "3600",
        "ext_expires_in": "1503641912",
        "id_token": "not_needed_for_app_insights",
        "not_before": "1503638012",
        "refresh_token": "eyJ0esdfiJKV1ljhgYF.....Az",
        "resource": "https://api.applicationinsights.io",
        "scope": "Data.Read",
        "token_type": "bearer"
    }

이 응답의 액세스 토큰 부분은 Authorization: Bearer 헤더에서 Application Insights API에 제공하는 것입니다. 또한 나중에 새로 고침 토큰을 사용하여 새로운 access_token 및 새로 고침 토큰을 얻을 수도 있습니다. 이 요청의 형식과 엔드포인트는 다음과 같습니다.

    POST /YOUR_AAD_TENANT/oauth2/token HTTP/1.1
    Host: https://login.microsoftonline.com
    Content-Type: application/x-www-form-urlencoded
    
    client_id=<app-client-id>
    &refresh_token=<refresh-token>
    &grant_type=refresh_token
    &resource=https://api.applicationinsights.io
    &client_secret=<app-client-secret>

응답 예제:

    {
      "token_type": "Bearer",
      "expires_in": "3600",
      "expires_on": "1460404526",
      "resource": "https://api.applicationinsights.io",
      "access_token": "eyJ0eXAiOiJKV1QiLCJ.....Ax",
      "refresh_token": "eyJ0esdfiJKV1ljhgYF.....Az"
    }

암시적 코드 흐름

Application Insights API는 OAuth2 암시적 흐름도 지원합니다. 이 흐름의 경우 단일 요청만 필요하지만 새로 고침 토큰을 얻을 수 없습니다.

암시적 코드 권한 부여 URL
    GET https://login.microsoftonline.com/YOUR_AAD_TENANT/oauth2/authorize?
    client_id=<app-client-id>
    &response_type=token
    &redirect_uri=<app-redirect-uri>
    &resource=https://api.applicationinsights.io

요청이 성공하면 다음과 같이 URL에 토큰이 있는 리디렉션 URI로 리디렉션됩니다.

    http://YOUR_REDIRECT_URI/#access_token=YOUR_ACCESS_TOKEN&token_type=Bearer&expires_in=3600&session_state=STATE_GUID

이 access_token은 요청을 권한 부여하기 위해 Application Insights API에 전달될 때 Authorization: Bearer 헤더 값 역할을 합니다.

로컬 인증 사용 안 함

Microsoft Entra 인증을 사용하도록 설정한 경우 로컬 인증을 사용하지 않도록 선택할 수 있습니다. 이 구성을 사용하면 Microsoft Entra ID에서 제외적으로 인증된 원격 분석을 수집할 수 있으며 데이터 액세스(예: API 키를 통해)에 영향을 미칩니다.

Azure Portal, Azure Policy를 사용하거나 프로그래밍 방식으로 로컬 인증을 사용하지 않도록 설정할 수 있습니다.

Azure Portal

  1. Application Insights 리소스의 왼쪽 메뉴에 있는 구성에서 속성을 선택합니다. 로컬 인증을 사용하도록 설정된 경우 사용(변경하려면 클릭)을 선택합니다.

    구성 섹션 아래의 속성과 사용(변경하려면 클릭) 로컬 인증 단추를 보여 주는 스크린샷.

  2. 사용 안 함을 선택하여 변경 사항을 적용합니다.

    사용/사용 안 함 단추가 있는 로컬 인증을 보여 주는 스크린샷.

  3. 리소스에서 로컬 인증을 사용하지 않도록 설정하면 개요 창에 해당 정보가 표시됩니다.

    사용 안 함(변경하려면 선택) 로컬 인증 단추가 있는 개요 탭을 보여 주는 스크린샷.

Azure Policy

DisableLocalAuth에 대한 Azure Policy는 사용자가 이 속성 집합을 true로 설정하지 않고 새 Application Insights 리소스를 만드는 기능을 거부합니다. 정책 이름은 Application Insights components should block non-AAD auth ingestion입니다.

구독에 이 정책 정의를 적용하려면 새 정책 할당을 만들고 정책을 할당합니다.

다음 예에서는 정책 템플릿 정의를 보여 줍니다.

{
    "properties": {
        "displayName": "Application Insights components should block non-AAD auth ingestion",
        "policyType": "BuiltIn",
        "mode": "Indexed",
        "description": "Improve Application Insights security by disabling log ingestion that are not AAD-based.",
        "metadata": {
            "version": "1.0.0",
            "category": "Monitoring"
        },
        "parameters": {
            "effect": {
                "type": "String",
                "metadata": {
                    "displayName": "Effect",
                    "description": "The effect determines what happens when the policy rule is evaluated to match"
                },
                "allowedValues": [
                    "audit",
                    "deny",
                    "disabled"
                ],
                "defaultValue": "audit"
            }
        },
        "policyRule": {
            "if": {
                "allOf": [
                    {
                        "field": "type",
                        "equals": "Microsoft.Insights/components"
                    },
                    {
                        "field": "Microsoft.Insights/components/DisableLocalAuth",
                        "notEquals": "true"                        
                    }
                ]
            },
            "then": {
                "effect": "[parameters('effect')]"
            }
        }
    }
}

프로그래매틱 활성화

DisableLocalAuth 속성은 Application Insights 리소스에서 로컬 인증을 사용하지 않도록 설정하는 데 사용됩니다. 이 속성을 true로 설정하면 모든 액세스에 Microsoft Entra 인증을 사용해야 합니다.

다음 예에서는 LocalAuth가 사용하지 않도록 설정된 작업 영역 기반 Application Insights 리소스를 만드는 데 사용할 수 있는 Azure Resource Manager 템플릿을 보여 줍니다.

{
    "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "name": {
            "type": "string"
        },
        "type": {
            "type": "string"
        },
        "regionId": {
            "type": "string"
        },
        "tagsArray": {
            "type": "object"
        },
        "requestSource": {
            "type": "string"
        },
        "workspaceResourceId": {
            "type": "string"
        },
        "disableLocalAuth": {
            "type": "bool"
        }
     
    },
    "resources": [
        {
        "name": "[parameters('name')]",
        "type": "microsoft.insights/components",
        "location": "[parameters('regionId')]",
        "tags": "[parameters('tagsArray')]",
        "apiVersion": "2020-02-02-preview",
        "dependsOn": [],
        "properties": {
            "Application_Type": "[parameters('type')]",
            "Flow_Type": "Redfield",
            "Request_Source": "[parameters('requestSource')]",
            "WorkspaceResourceId": "[parameters('workspaceResourceId')]",
            "DisableLocalAuth": "[parameters('disableLocalAuth')]"
            }
    }
 ]
}

토큰 대상 그룹

Application Insights에 원격 분석을 제출하기 위해 Microsoft Entra ID에서 액세스 토큰을 가져오도록 사용자 지정 클라이언트를 개발하는 경우 다음 표를 참조하여 특정 호스트 환경에 적합한 대상 그룹 문자열을 결정합니다.

Azure 클라우드 버전 토큰 대상 그룹 가치
Azure 퍼블릭 클라우드 https://monitor.azure.com
21Vianet에서 운영하는 Microsoft Azure https://monitor.azure.cn
Azure 미국 정부 클라우드 https://monitor.azure.us

소버린 클라우드를 사용하는 경우 연결 문자열에서도 대상 그룹 정보를 찾을 수 있습니다. 연결 문자열은 다음 구조를 따릅니다.

InstrumentationKey={profile.InstrumentationKey};IngestionEndpoint={ingestionEndpoint};LiveEndpoint={liveDiagnosticsEndpoint};AADAudience={aadAudience}

대상 그룹 매개 변수 AADAudience는 특정 환경에 따라 달라질 수 있습니다.

문제 해결

이 섹션에서는 지원 티켓을 제출하기 전에 문제를 해결하기 위해 수행할 수 있는 고유한 문제 해결 시나리오 및 단계를 제공합니다.

HTTP 오류 수집

수집 서비스에서 SDK 언어에 관계없이 특정 오류가 반환됩니다. Fiddler와 같은 도구를 사용하여 네트워크 트래픽을 수집할 수 있습니다. 연결 문자열에 설정된 수집 엔드포인트에 대한 트래픽을 필터링해야 합니다.

HTTP/1.1 400 인증이 지원되지 않음

이 오류는 리소스가 Microsoft Entra 전용으로 설정되었음을 나타냅니다. 잘못된 API로 전송되기 때문에 SDK를 올바르게 구성해야 합니다.

참고 항목

"v2/track"은 Microsoft Entra ID를 지원하지 않습니다. SDK가 올바르게 구성되면 원격 분석이 "v2.1/track"으로 전송됩니다.

다음으로 SDK 구성을 검토해야 합니다.

HTTP/1.1 401 권한 필요

이 오류는 SDK가 올바르게 구성되었지만 유효한 토큰을 얻을 수 없음을 나타냅니다. 이 오류는 Microsoft Entra ID에 문제가 있음을 나타낼 수 있습니다.

다음으로 SDK 로그의 예외 또는 Azure ID의 네트워크 오류를 식별해야 합니다.

HTTP/1.1 403 권한 없음

이 오류는 SDK가 Application Insights 리소스 또는 구독에 대한 권한 없이 자격 증명을 사용함을 의미합니다.

먼저 Application Insights 리소스의 액세스 제어를 확인합니다. 모니터링 메트릭 게시자 역할이 있는 자격 증명으로 SDK를 구성해야 합니다.

언어별 문제 해결

이벤트 원본

Application Insights .NET SDK는 이벤트 원본을 사용하여 오류 로그를 내보냅니다. 이벤트 원본 로그 수집에 대한 자세한 내용은 PerfView를 사용하여 데이터 수집 로그 없음 문제 해결을 참조하세요.

SDK가 토큰을 얻지 못하면 예외 메시지가 Failed to get AAD Token. Error message:로깅됩니다.

다음 단계