Skip to content

sikksakk/iam-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

111 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IAM API

A simple .NET 10 Web API for managing jobs and logs for the IAM orchestration system.

Features

  • In-memory data storage - No database required for this PoC
  • No authentication - Simple and fast for development
  • Jobs API - Create and manage jobs for the orchestrator
  • Logs API - Containers can report execution logs
  • Web UI - Simple frontend to create jobs and view logs
  • Containerized - Ready for Azure App Service deployment

API Endpoints

Jobs

  • GET /api/jobs - Get all jobs
  • GET /api/jobs/pending - Get pending jobs (for orchestrator)
  • GET /api/jobs/{id} - Get a specific job
  • POST /api/jobs - Create a new job
  • PATCH /api/jobs/{id}/status - Update job status

Logs

  • GET /api/logs - Get all logs (optional ?jobId= filter)
  • GET /api/logs/job/{jobId} - Get logs for a specific job
  • POST /api/logs - Create a log entry

Running Locally

dotnet run

Navigate to http://localhost:5000 for the web UI or http://localhost:5000/swagger for API documentation.

Building Docker Image

docker build -t iam-api .
docker run -p 8080:8080 iam-api

Deploying to Azure App Service

  1. Build and push to Azure Container Registry:
az acr build --registry <your-acr> --image iam-api:latest .
  1. Create App Service and deploy:
az webapp create --resource-group <rg> --plan <plan> --name <app-name> --deployment-container-image-name <your-acr>.azurecr.io/iam-api:latest

App settings to add in Azure App Service (Configuration):

WEBSITES_PORT = 8080
WEBSITES_ENABLE_APP_SERVICE_STORAGE = false
ASPNETCORE_ENVIRONMENT = Production
# Optional: enable Swagger UI in Production
Swagger__Enabled = true

Example Usage

Create a Job

curl -X POST http://localhost:5000/api/jobs \
  -H "Content-Type: application/json" \
  -d '{
    "name": "User Sync",
    "customer": "alpha",
    "containerImage": "myacr.azurecr.io/customer-alpha:latest",
    "registryServer": "myacr.azurecr.io",
    "registryUsername": "myacr",
    "registryPassword": "your-acr-password",
    "scriptPath": "/scripts/sync.ps1",
    "jobType": 1,
    "schedule": "0 0 * * *",
    "parameters": {
      "tenantId": "00000000-0000-0000-0000-000000000000",
      "environment": "production"
    }
  }'

Note: Registry authentication fields (registryServer, registryUsername, registryPassword) are optional and only needed for private container registries like Azure Container Registry.

Report a Log

curl -X POST http://localhost:5000/api/logs \
  -H "Content-Type: application/json" \
  -d '{
    "jobId": "00000000-0000-0000-0000-000000000000",
    "message": "Job started successfully",
    "level": 0,
    "source": "orchestrator"
  }'

iam-api

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors