diff --git a/docs/integrations/azure/discovery.md b/docs/integrations/azure/discovery.md index 7fbba5228d..4529a31cfe 100644 --- a/docs/integrations/azure/discovery.md +++ b/docs/integrations/azure/discovery.md @@ -127,6 +127,26 @@ builder.addEntityProvider( /* highlight-add-end */ ``` +### New Backend System + +This entity provider will work with the new backend system. Here is how to install it: + +Run the following command to add the module's package: + +```bash +# From your Backstage root directory +yarn --cwd packages/backend add @backstage/plugin-catalog-backend-module-azure +``` + +Then updated your backend by adding the following line: + +```ts title="packages/backend/src/index.ts" +backend.add(import('@backstage/plugin-catalog-backend/alpha')); +/* highlight-add-start */ +backend.add(import('@backstage/plugin-catalog-backend-module-azure/alpha')); +/* highlight-add-end */ +``` + ## Alternative Processor As an alternative to the entity provider `AzureDevOpsEntityProvider`, you can still use the `AzureDevopsDiscoveryProcessor`. diff --git a/docs/integrations/azure/org.md b/docs/integrations/azure/org.md index 5e39aaeb7d..69151cd82c 100644 --- a/docs/integrations/azure/org.md +++ b/docs/integrations/azure/org.md @@ -64,6 +64,26 @@ export default async function createPlugin( } ``` +### New Backend System + +This entity provider will work with the new backend system. Here is how to install it: + +Run the following command to add the module's package: + +```bash +# From your Backstage root directory +yarn --cwd packages/backend add @backstage/plugin-catalog-backend-module-msgraph/alpha +``` + +Then updated your backend by adding the following line: + +```ts title="packages/backend/src/index.ts" +backend.add(import('@backstage/plugin-catalog-backend/alpha')); +/* highlight-add-start */ +backend.add(import('@backstage/plugin-catalog-backend-module-msgraph/alpha')); +/* highlight-add-end */ +``` + ## Authenticating with Microsoft Graph ### Local Development @@ -244,6 +264,41 @@ export async function myOrganizationTransformer( } ``` +### Using Transformers in the New Backend System + +Transformers can be configured by extending `microsoftGraphOrgEntityProviderTransformExtensionPoint`. Here is an example: + +```ts title="packages/backend/src/index.ts" +import { createBackendModule } from '@backstage/backend-plugin-api'; +import { microsoftGraphOrgEntityProviderTransformExtensionPoint } from '@backstage/plugin-catalog-backend-module-msgraph/alpha'; + +backend.add( + createBackendModule({ + pluginId: 'catalog', + moduleId: 'microsoft-graph-extensions', + register(env) { + env.registerInit({ + deps: { + /* highlight-add-start */ + microsoftGraphTransformers: + microsoftGraphOrgEntityProviderTransformExtensionPoint, + /* highlight-add-end */ + }, + async init({ microsoftGraphTransformers }) { + /* highlight-add-start */ + microsoftGraphTransformers.setUserTransformer(myUserTransformer); + microsoftGraphTransformers.setGroupTransformer(myGroupTransformer); + microsoftGraphTransformers.setOrganizationTransformer( + myOrganizationTransformer, + ); + /* highlight-add-end */ + }, + }); + }, + }), +); +``` + ## Troubleshooting ### No data