Replace Azure CLI container with Python SDK

Abierto
#345 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
15/100
Tipo de issue
Refactorización
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
azure, docker, python
Área
cloud

Línea de trabajo

Start by reading sebs/azure/cli.py to inventory every az/func call and match it against the mapping table; then inspect tools/create_azure_credentials.py and the Flex work in #289. The change is complete when the manage.azure container is gone, an AzureClients holder replaces AzureCLI, and the listed Azure scenarios (create/update function app, deploy, logs, storage/Cosmos) pass.

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

Descripción

azure enhancement

The Azure backend runs every management operation through az/func inside the manage.azure Docker container (sebs/azure/cli.py). The Python SDKs now cover everything we need, so we can drop the container.

manage.azure ships Core Tools v3, which is end-of-life, on Debian bullseye. We keep having to maintain the image just for management calls. There's also an issue of handling of secrets leak, every call pays for docker exec plus az's start-up time, and we detect errors by string-matching CLI output which is quite fragile.

Possible Mapping
Area Current Replacement
Login, subscription az login azure-identity
Resource groups, storage accounts, keys az group, az storage account azure-mgmt-resource, azure-mgmt-storage
Cosmos DB accounts and keys az cosmosdb azure-mgmt-cosmosdb
Function apps, app settings, function URL, Flex scale config az functionapp azure-mgmt-web (web_apps, app_service_plans, FunctionAppConfig)
App Insights lookup and KQL query az monitor app-insights (+ extension, + az feature register) azure-mgmt-applicationinsights and azure-monitor-query
Metrics (Flex billing) az monitor metrics list azure-mgmt-monitor
Code publish func azure functionapp publish No SDK method. Consumption: upload the zip to blob storage, set WEBSITE_RUN_FROM_PACKAGE to a SAS URL, then sync_function_triggers. Flex: POST the zip to https://<scm>/api/publish?RemoteBuild=false with an Azure AD token. More complex
  • Replace AzureCLI with an AzureClients holder (one credential, management clients created on first use).
  • We now have to build the az functionapp create request ourselves: kind, linux_fx_version, FUNCTIONS_EXTENSION_VERSION, WEBSITE_CONTENT*, the App Insights component.
  • We need to ensure that this also works with the Flex consumption plan.
  • Stays: tools/create_azure_credentials.py. We need interactive login to create the service principal (I couldn't find a decent alternative to generate non-interactive credentials), but we should be able to do it from a Python package. Then, we no longer need the manage CLI Docker container.
  • Depends on the Flex variant work (#289); this one should be done first.
Testing
  • Creating a new function app.
  • Retrieving existing function apps and updating them.
  • Deploying new code.
  • Cold start enforcement.
  • Retrieving logging information.
  • Storage container management + resource groups.
  • Cosmos DB database management.
  • Working on Azure Durable workflows.
Lenguaje dominante
Python
Estrellas
200
Forks
112
Merge medio
25 min
PR fusionados (30 d)
3

Preparar el entorno

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 spcl/serverless-benchmarks

Todos los issues de spcl/serverless-benchmarks

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.