Files
azure-node-playground/bin/delete-app.mjs

16 lines
483 B
JavaScript
Executable File

#!/usr/bin/env node
import { execSync } from 'child_process';
import { config } from '../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}`);
}