/** * Get an Azure application by its display name. * * @param { Object } client * @param { string } displayName * @returns */ export async function getApp(client, displayName) { const result = await client .api("/applications") .filter(`displayName eq '${displayName}'`) .get(); // Return the first application found or null if none exists return result.value.length > 0 ? result.value[0] : null; } export async function createApp(client, displayName) { const app = await client.api("/applications").post({ displayName, }); if (!app || !app.appId) { throw new Error("Failed to create application"); } return app; } export async function deleteApp(client, appObjectId) { await client.api(`/applications/${appObjectId}`).delete(); }