Built-in role for self-service API keys on Microsoft.ApiManagement/aigateways

Cerrado
#68 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
25/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
azure, python

Línea de trabajo

Start by reading the AI Gateway role definitions and documentation for standalone Microsoft.ApiManagement/aigateways resources; the issue does not name repository files or tests. Define the minimum actions for key creation, rotation, and telemetry, then assess whether key operations can be limited to keys created by the caller. Done means a built-in role or documented portal permissions meet the request; the issue identifies no existing test to run.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Summary

There is no built-in role that lets a user manage API keys on a standalone AI Gateway (Microsoft.ApiManagement/aigateways) and view its telemetry without also being able to change gateway configuration.

Some API consumers may need to call the API using keys rather than Microsoft Entra user authentication. The people who manage those keys should be able to create and rotate them without full gateway management rights.
This is a follow-up to #6. The custom role suggested there targets the APIM service resource type and does not work for the standalone aigateways resource.

Current behavior

A user who only has AI Gateway Developer or AI Gateway Contributor cannot create a key. Neither role includes any Microsoft.ApiManagement/aigateways/apiKeys/* action:

Built-in role Relevant actions Can create keys
AI Gateway Developer workspaces/aliases/read, workspaces/toolServers/read No
AI Gateway Contributor workspaces/modelProviders/*, workspaces/aliases/*, workspaces/toolServers/* No
AI Gateway User / Models User / Tools User data actions only No
Contributor / Owner Broad management permissions (including Microsoft.ApiManagement/aigateways/*) Yes, but grants much broader access than key management
No built-in role provides narrowly scoped API-key management for aigateways. Broad built-in roles such as Contributor or Owner can manage gateway keys, but also grant broad permissions beyond keys.

Workaround we are using

We currently assign this custom role to an entra group with our developers as members. The RG contains the gateway and its Application Insights resource. It has not been validated end to end with the portal and telemetry queries:

{
  "roleName": "AI Gateway Self-Service Key Operator",
  "description": "Allows API key creation, retrieval, and rotation on standalone AI Gateway, plus read-only access to models and telemetry.",
  "assignableScopes": ["/subscriptions/<subscription-id>"],
  "permissions": [
    {
      "actions": [
        "Microsoft.ApiManagement/aigateways/read",
        "Microsoft.ApiManagement/aigateways/workspaces/read",
        "Microsoft.ApiManagement/aigateways/workspaces/models/read",
        "Microsoft.ApiManagement/aigateways/workspaces/modelProviders/read",
        "Microsoft.ApiManagement/aigateways/workspaces/modelProviders/models/read",
        "Microsoft.ApiManagement/aigateways/workspaces/telemetryExporters/read",
        "Microsoft.ApiManagement/aigateways/apiKeys/read",
        "Microsoft.ApiManagement/aigateways/apiKeys/write",
        "Microsoft.ApiManagement/aigateways/apiKeys/listSecrets/action",
        "Microsoft.ApiManagement/aigateways/apiKeys/regeneratePrimaryKey/action",
        "Microsoft.ApiManagement/aigateways/apiKeys/regenerateSecondaryKey/action",
        "Microsoft.Insights/Components/Read",
        "Microsoft.Insights/Components/Query/Read",
        "Microsoft.Insights/Components/MetricDefinitions/Read",
        "Microsoft.Insights/Components/Metrics/Read",
        "Microsoft.Insights/Logs/Read",
        "Microsoft.Insights/Logs/ApiManagementGatewayLogs/Read"
      ],
      "notActions": [],
      "dataActions": [],
      "notDataActions": []
    }
  ]
}

Limitations:

  • The role is assigned at gateway resource-group scope. Members can manage keys on the gateway; key operations are not restricted to keys created by the individual member.
  • Telemetry queries have not been verified end to end with this exact role assignment.

Requests

  1. A built-in role (or an extension of AI Gateway Developer) for key self-service on aigateways, similar to the workaround above.
  2. If possible, a way to limit key operations to keys the caller created.
  3. Documentation of the minimum actions the AI Gateway portal needs to create a key and show telemetry.
Lenguaje dominante
Python
Estrellas
18
Forks
9
Merge medio
1 d 16 h
PR fusionados (30 d)
23

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Azure/aigateway

Todos los issues de Azure/aigateway

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.