Add scripts for managing Azure AD applications: setup, get, and delete

This commit is contained in:
2026-01-26 21:26:08 +01:00
parent ec6d8108bc
commit bf9a85199e
3 changed files with 176 additions and 0 deletions

15
bin/delete-app.js Executable file
View File

@@ -0,0 +1,15 @@
#!/usr/bin/env node
const execSync = require('child_process').execSync;
const { config } = require('../config.js');
// Get the Azure AD application ID by name
const appId = execSync(`az ad app list --query "[?displayName=='${config.appName}'].appId" -o tsv`).toString().trim();
if (appId) {
// Delete the Azure AD application
execSync(`az ad app delete --id ${appId}`);
console.log(`Deleted App with ID: ${appId}`);
} else {
console.log(`No App found with name: ${APP_NAME}`);
}