Opomba
Dostop do te strani zahteva pooblastilo. Poskusite se vpisati alispremeniti imenike.
Dostop do te strani zahteva pooblastilo. Poskusite lahko spremeniti imenike.
opomba,
Novo in izboljšano Power Platform skrbniško središče je zdaj v javnem predogledu! Novo skrbniško središče smo zasnovali tako, da je enostavnejše za uporabo, z navigacijo, usmerjeno v opravila, ki vam pomaga hitreje doseči določene rezultate. Objavili bomo novo in posodobljeno dokumentacijo, ko bo novo Power Platform skrbniško središče prešlo v splošno dostopnost.
Uporaba tabele SharePoint Dokumenti v okolju Dynamics 365 zunaj mreže dokumentov v aplikaciji, ki temelji na modelu, zahteva aplikacijo Azure za odobritev dostopa. Primeri tega dostopa vključujejo uporabo znotraj Power Automate ali z Dataverse klici API. Nastavitev za odobritev dostopa uporablja Power Platform Upravljane identitete z Azure.
Od marca 2025 je trenutni dostop odstranjen zaradi izboljšanja zaščite sistema. Če želite zagotoviti stalen dostop, sledite tem korakom, da ustvarite aplikacijo Azure s potrebnimi SharePoint dovoljenji, nastavite upravljane identitete v Dataverse in konfigurirate zvezne poverilnice.
Ustvarite aplikacijo Azure z SharePoint dovoljenji
Ustvarite registracijo aplikacije z dovoljenjem API za SharePoint. Izvedite več o registraciji aplikacije in SharePoint dostopu v Azure Quickstart Register App in SharePoint dostopu prek Azure AD App-Only.
Odprite portal Azure.
V razdelku Storitve Azure izberite Registracije aplikacij.
Izberite Nova registracija.
Vnesite Ime za aplikacijo.
Pod Podprte vrste računov izberite Samo računi v tem organizacijskem imeniku.
opomba,
Druge vrste trenutno niso podprte.
Izberite Registracija , da ustvarite Registracijo aplikacije.
Upoštevajte ID aplikacije (odjemalec) in ID imenika (najemnik):
Na navigacijskem seznamu izberite Pregled.
Pod Essentials kopirajte vrednosti Application (client) ID in Directory (tenant) ID za uporabo v naslednjem razdelku.
Na navigacijskem seznamu izberite Upravljanje>dovoljenj API.
V razdelku Konfigurirana dovoljenja izberite Dodaj dovoljenje da odprete ploščo Zahtevaj dovoljenja API .
Izberite SharePoint.
Pod Kakšno vrsto dovoljenj zahteva vaša aplikacija? izberite Dovoljenja za aplikacijo.
V razdelku Izberite dovoljenja izberite Sites.FullControl.All.
Izberite Dodaj dovoljenja da ustvarite SharePoint dovoljenje.
Izberite Podeli skrbniško soglasje za
<tenant name>
.
Ustvari upravljane identitete v Dataverse
Ustvari upravljane zapise identitete v Dataverse. Več o upravljanih identitetah v Nastavitvi Dataverse Upravljanih identitetah.
Dodajte zapis v tabelo z upravljanimi identitetami
V tabelo managedidentities
vstavite vrstico z vrednostmi iz naslednje tabele.
Polje tabele | Vrednost |
---|---|
applicationid |
Uporabite vrednost ID aplikacije (odjemalca) iz prvega razdelka |
tenantid |
Uporabite vrednost ID imenika (najemnika) iz prvega razdelka |
managedidentityid |
Ustvari nov GUID |
credentialsource |
2 |
subjectscope |
1 |
Primer uporabe POST:
Zahteva:
https://contoso.crm.dynamics.com/api/data/v9.0/managedidentities
Telo:
{ "applicationid": "<appId>", "managedidentityid": "<newGuid>", "credentialsource": 2, "subjectscope": 1, "tenantid": "<tenantId>" }
Dodajte zapis v SharePoint tabelo upravljanih identitet
V tabelo sharepointmanagedidentity
vstavite vrstico z vrednostmi iz naslednje tabele.
Polje tabele | Vrednost |
---|---|
sharepointmanagedidentityid |
Ustvari nov GUID |
uniquename |
"msft_ppmiforsharepointauth" |
name |
"Upravljana identiteta za SharePoint Auth" |
ManagedIdentity@odata.bind |
/managedidentities(<managedidentityid>) zamenjava <managedidentityid> z vrednostjo iz prejšnjega razdelka |
Primer uporabe POST:
Zahteva:
https://contoso.crm.dynamics.com/api/data/v9.0/sharepointmanagedidentities
Telo:
{ "sharepointmanagedidentityid": "<newGuid>", "uniquename": "msft_ppmiforsharepointauth", "name": "Managed Identity For SharePoint Auth", "ManagedIdentityId@odata.bind": "/managedidentities(<managedIdentityId>)" }
Ustvari zvezno poverilnico
Ustvarite zvezno poverilnico za registracijo aplikacije. Izvedite več o poverilnicah zvezne identitete v Konfigurirajte aplikacijo za poverilnice zvezne identitete.
opomba,
Poverilnice zvezne identitete prek Power Platform upravljane identitete so splošno na voljo in v celoti podprte za SharePoint integracijo dokumentov. Upravljana identiteta Power Platform se uporablja za številne scenarije, vendar niso vsi na splošno na voljo. Vendar je ta primer v celoti podprt.
Odprite portal Azure.
Izberite Microsoft Entra ID.
Na navigacijskem seznamu izberite Upravljanje>Registracije aplikacij.
Na seznamu aplikacij izberite registracijsko ime aplikacije, ustvarjeno v prejšnjem razdelku.
Na navigacijskem seznamu izberite Manage>Certificates & skrivnosti.
Izberite zavihek Zvezne poverilnice .
Izberite Dodaj poverilnico.
V polju Scenarij zveznih poverilnic izberite Drugi izdajatelj.
V polje Izdajatelj vnesite URL izdajatelja:
- Oblika vrednosti:
https://login.microsoftonline.com/<tenantId>/v2.0
- Zamenjajte
<tenantId>
z vrednostjo ID imenika (najemnika) GUID iz prejšnjega razdelka.
- Oblika vrednosti:
V polje Vrednost vnesite identifikator subjekta:
- Oblika vrednosti:
/eid1/c/pub/t/<base64-encoded-tenantId>/a/<base64-encoded-appid>/Env/<orgid>/sharepointmanagedidentity/<sharepointmanagedidentityid>
- Zamenjajte
<base64-encoded-tenantId>
z kodiranim ID-jem najemnika na podlagi 64. - Zamenjajte
<base64-encoded-appid>
z ID-jem odjemalca aplikacije s kodiranjem base64. - Zamenjajte
<orgid>
z ID-jem organizacije. - Zamenjajte
<sharepointmanagedidentityid>
z GUID-jem, ustvarjenim prej z zapisom sharepointmanagedidentities.
[OPOMBA!] Uporabite skript v Generiraj identifikator subjekta , da ustvarite vrednost identifikatorja subjekta z vrednostmi, kodiranimi base64.
- Oblika vrednosti:
Izberite Dodaj , da ustvarite poverilnico.
Če sledite tem korakom, konfigurirate aplikacijo Azure s potrebnimi SharePoint dovoljenji, nastavite upravljane identitete v Dataverse in konfigurirate zvezne poverilnice.
Ustvarite identifikator predmeta
Ta skript ustvari vrednost identifikatorja subjekta na podlagi vrednosti, navedenih v JavaScriptu.
Odprite aplikacijo Dynamics 365 v brskalniku.
Odprite orodja brskalnika na konzoli.
Kopirajte naslednji JavaScript in nastavite vrednost za spremenljivko sharePointManagedIdentityId.
// Replace with the id for SharePoint Managed Identity that was created attribute name: sharepointmanagedidentityid. // Refer to the following documentation for configuring an aad app for SharePoint access: // https://learn.microsoft.com/en-us/power-platform/admin/configure-azure-app-with-sharepoint-access // For the SharePoint Managed Identity creation, refer to the following documentation: // https://learn.microsoft.com/en-us/power-platform/admin/configure-azure-app-with-sharepoint-access#add-record-in-sharepoint-managed-identities-table const sharePointManagedIdentityId = ""; const prefixForFICIssuer = "https://login.microsoftonline.com/"; const suffixForFICIssuer = "/v2.0"; const prefixForFICSubject = "/eid1/c/pub"; const tenantIdentifierForFICSubject = "/t/"; const appIdentifierForFICSubject = "/a/"; const environmentIdentifierForFICSubject = "/Env/"; const sharePointManagedIdentityIdentifierForFICSubject = "/sharepointmanagedidentity/"; // This is the AAD App Id to be used for Power Platform Managed Identity: 58e835ab-2e39-46a9-b797-accce6633447 const powerPlatformManagedIdentityAppId = "58e835ab-2e39-46a9-b797-accce6633447"; /** * Represents a request for retrieving the current organization. * @param {number} accessType - The access type (0 for Default, 1 for Internet, 2 for Intranet). */ var RetrieveCurrentOrganizationRequest = function (accessType) { this.AccessType = accessType; }; /** * Gets metadata for the request. * @returns {Object} The metadata for the request. */ RetrieveCurrentOrganizationRequest.prototype.getMetadata = function() { return { boundParameter: null, parameterTypes: { "AccessType": { "typeName": "Microsoft.Dynamics.CRM.EndpointAccessType", "structuralProperty": 3, // Enum Type "enumProperties": [ { "name": "Default", "value": 0 }, { "name": "Internet", "value": 1 }, { "name": "Intranet", "value": 2 } ] } }, operationType: 1, // This is a function operationName: "RetrieveCurrentOrganization" }; }; /** * Encodes a GUID to a Base64 URL-safe string. * * @param {string} guid - The GUID to encode. * @returns {string} The Base64 URL-safe encoded string. * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/btoa} */ function encodeToBase64Url(guid) { const buffer = []; const regex = /.{1,2}/g; guid.split('-').forEach((number, index) => { const bytesInChar = number.match(regex); if (index < 3) bytesInChar.reverse(); bytesInChar.forEach(byte => buffer.push(parseInt(byte, 16))); }); const base64String = btoa(String.fromCharCode.apply(null, new Uint8Array(buffer))); // Make the Base64 string URL-safe by replacing '+' with '-' and '/' with '_' // Remove any trailing '=' characters return base64String.slice(0, 22).replace(/=+$/, '').replace(/\+/g, '-').replace(/\//g, '_'); } /** * Construct the issuer URL using the tenant ID. * This is needed for the issuer url in FIC configuration. * @param {string} tenantId - The tenant ID. * @returns {string} The constructed issuer URL. * @example * // Example for output * // https://login.microsoftonline.com/your-tenant-id/v2.0 */ function constructIssuerUrlForFIC(tenantId) { return `${prefixForFICIssuer}${tenantId}${suffixForFICIssuer}`; } /** * Constructs the subject url using the encoded tenant ID, encoded app ID, environment ID, and SharePoint managed identity ID. * This is needed for the subject url in FIC configuration. * @param {string} encodedTenantId - The encoded tenant ID. * @param {string} encodedAppId - The encoded app ID. * @param {string} environmentId - The environment ID. * @param {string} sharePointManagedIdentityId - The SharePoint managed identity ID. * @returns {string} The constructed subject string. * @example * // Example output: /eid1/c/pub/t/<EncodedTenantId>/a/<EncodedDV1PAppId>/Env/<EnvironmentId>/sharepointmanagedidentity/<sharePointManagedIdentityId> */ function constructSubjectUrlForFIC(encodedTenantId, encodedAppId, environmentId, sharePointManagedIdentityId) { return `${prefixForFICSubject}${tenantIdentifierForFICSubject}${encodedTenantId}${appIdentifierForFICSubject}${encodedAppId}${environmentIdentifierForFICSubject}${environmentId}${sharePointManagedIdentityIdentifierForFICSubject}${sharePointManagedIdentityId}`; } (async () => { try { // Check if sharePointManagedIdentityId is null or undefined if (!sharePointManagedIdentityId) { console.error("SharePoint Managed Identity ID is null or undefined. Please ensure that the SharePoint Managed Identity ID is set."); return; } const accessType = 0; const retrieveCurrentOrganizationRequest = new RetrieveCurrentOrganizationRequest(accessType); // Execute the request to retrieve the current organization details // https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/xrm-webapi/online/execute // https://learn.microsoft.com/en-us/power-apps/developer/data-platform/webapi/web-api-functions-actions-sample#section-4-unbound-function-retrievecurrentorganization const response = await Xrm.WebApi.online.execute(retrieveCurrentOrganizationRequest); const result = await response.json(); if (result.Detail) { const { EnvironmentId: environmentId, TenantId: tenantId } = result.Detail; const encodedTenantId = encodeToBase64Url(tenantId); const encodedPowerPlatformManagedIdentityAppId = encodeToBase64Url(powerPlatformManagedIdentityAppId); const issuerUrlForFederatedCredentialConfig = constructIssuerUrlForFIC(tenantId); const subjectUrlForFederatedCredentialConfig = constructSubjectUrlForFIC(encodedTenantId, encodedPowerPlatformManagedIdentityAppId, environmentId, sharePointManagedIdentityId); console.log(`SharePoint Managed Identity ID: ${sharePointManagedIdentityId}, Tenant ID: ${tenantId}, Encoded Tenant ID: ${encodedTenantId}, Power Platform Managed Identity App ID: ${powerPlatformManagedIdentityAppId}, Encoded App ID: ${encodedPowerPlatformManagedIdentityAppId}, Issuer URL for Federated Credential Configuration: ${issuerUrlForFederatedCredentialConfig}, Subject URL for Federated Credential Configuration: ${subjectUrlForFederatedCredentialConfig}`); } else { console.error("RetrieveCurrentOrganization response is missing detail."); } } catch (error) { console.error(`Error executing request: ${error.message}`); } })();
Prilepite v konzolo za izvedbo.
Kopirajte identifikator predmeta in ga prilepite v polje VrednostDodaj poverilnico.