remove arm token dependency

This commit is contained in:
Bikram Choudhury
2025-10-27 16:12:54 +05:30
parent 6483bd146d
commit e002a4505c
17 changed files with 129 additions and 118 deletions

View File

@@ -79,3 +79,12 @@ export function extractErrorMessage(error: CopyJobErrorType): CopyJobErrorType {
}
}
export function getAccountDetailsFromResourceId(accountId: string | undefined) {
if (!accountId) {
return null;
}
const pattern = new RegExp('/subscriptions/([^/]+)/resourceGroups/([^/]+)/providers/Microsoft\\.DocumentDB/databaseAccounts/([^/]+)', 'i');
const matches = accountId.match(pattern);
const [_, subscriptionId, resourceGroup, accountName] = matches || [];
return { subscriptionId, resourceGroup, accountName };
}