Replace Azure CLI container with Python SDK

Aperta
#345 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
15/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
azure, docker, python
Ambito
cloud

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.
Lingua principale
Python
Stelle
200
Fork
112
Merge medio
25m
PR unite (30g)
3

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di spcl/serverless-benchmarks

Tutte le issue di spcl/serverless-benchmarks

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.