Skip to main content

Notifications

Small and medium business | Business Central, N...
Answered

Excel AddIn - Business Central on-prem - AAD Authentication - Error loading metadata

Posted on by 2

Hey everybody,

we get the error: Error loading metadata, when me use the "Edit in Excel"-Button in the webclient.

We have the BC AAD App Registration, one for the Excel AddIn and one for Exchange Online.

But only the Excel AddIn makes the problem. The BC Server is a local on-prem server. And I try to edit in Excel from the same local network.

I enable SSL in OData, API Services, Base URL etc. Everything looks fine to me.

In the Debugger of the Excel AddIn, I get the following errors:

pastedimage1675186882215v2.png

We`ve made everything with self-signed certificates.

Is there anyone with an idea?

Thank you!

best regards,

Robin

Categories:
  • HoangNam Profile Picture
    HoangNam 315 on at
    RE: Excel AddIn - Business Central on-prem - AAD Authentication - Error loading metadata

    Sorry!

    I found my issue. I missed configuration PublicODataBaseUrl.

  • HoangNam Profile Picture
    HoangNam 315 on at
    RE: Excel AddIn - Business Central on-prem - AAD Authentication - Error loading metadata

    Hi All,

    I do the same. but I get the errors:

    pastedimage1675755204013v1.png

    Please help me fix it. What is wrong now.

  • Verified answer
    Marco Mels Profile Picture
    Marco Mels on at
    RE: Excel AddIn - Business Central on-prem - AAD Authentication - Error loading metadata

    Hello,

    We indeed receive support calls around this topic so many people agree with you this is a difficult topic. Automatic deployment is rather difficult to configure because there are multiple scenario's to think about and not all customers give their partners sufficient permissions to create an Azure AD app registration. There are also hosters on the market that hosts the VM's while others hosts the Azure AD app registrations for their customers.

    There is a PowerShell commandlet that you can use as well if that makes the task easier:

    learn.microsoft.com/.../new-azureadapplication

    My response usually is that if you spend some time on it and deploy the scenario a few times in a test environment, you will get the design ideas behind it and it is not that difficult as it seems.

    Great that you had success!

  • Suggested answer
    Dobby94 Profile Picture
    Dobby94 2 on at
    RE: Excel AddIn - Business Central on-prem - AAD Authentication - Error loading metadata

    Hey Marco, thank you for your help. I've found the issue..

    In our WS-Federation Login Endpoint setting on our service tear:

    Yot must build the full URL, like here:

    learn.microsoft.com/.../authenticating-users-with-azure-ad-openid-connect

    Task 4 Step3c:

    <Application ID URI> The ID that was assigned to the Business Central application when it was registered in Azure AD, for example api://44444444-cccc-5555-dddd-666666666666 or cronusinternationltd.onmicrosoft.com/businesscentral.

    login.microsoftonline.com/<AAD TENANT ID>/wsfed?wa=wsignin1.0%26wtrealm=<Application ID URI>%26wreply=<Redirect URL>

    But we forget the "api://" before Application ID URI. The Connection work then without problems in Excel, when all SSL certificates are installed and secure.. But you get the error with the metadata.

    And you can look over it, when you look only on the example Microsoft has delivered. Because any other ID string is entered without a "api://" or something.

    Yeah, sure.. When you make everything that Microsoft described, it works. I think a automatic setup in Business Central where you put your Azure AD administrator credentials in work better, than make it all by hand..

    Freddy maked something for his docker PowerShell CMDlets..

    github.com/.../Create-AadAppsForNav.ps1

    I don't see a thing, why it don't work for a standard on-prem deployment..

    But I hope.. I can help someone with this information.

    best regards,

    Robin

    For german users: Fehler beim Laden der Metadaten

  • Suggested answer
    Marco Mels Profile Picture
    Marco Mels on at
    RE: Excel AddIn - Business Central on-prem - AAD Authentication - Error loading metadata

    Hello,

    You can verify the configuration of the Excel Add-In via this url (at least you can see what it is expecting to be):

    <<PublicWebBaseUrl>>/OfficeApps/Public/ServerConfiguration

    E.g.

    http s : // nav.domain.com/Instance/OfficeApps/Public/ServerConfiguration

    The PublicWebBaseUrl is a setting to be configured in the CustomSettings.config file. The PublicODataBaseUrl should also be configured in this format:

    http s : // nav.domain.com:portnumber/Instance/ODataV4/ 

    NOTE: added a few spaces to ensure the whole string is not reformatted so that it is not clear what the contents should be

    When using Azure AD authentication in an OnPrem environment, two Azure AD App registration must be created. The Excel Add-In app registration redirect uri must be of type spa (that used to be web).

    Hope it helps. Alternatively, raise a request to Microsoft support and we will help you further. 

    Thank you.

  • Dobby94 Profile Picture
    Dobby94 2 on at
    RE: Excel AddIn - Business Central on-prem - AAD Authentication - Error loading metadata

    Yes, this article, right.

  • Suggested answer
    Inge M. Bruvik Profile Picture
    Inge M. Bruvik 32,748 Super User 2024 Season 1 on at
    RE: Excel AddIn - Business Central on-prem - AAD Authentication - Error loading metadata

    Have you been through this setup?

    learn.microsoft.com/.../configuring-excel-addin

  • Dobby94 Profile Picture
    Dobby94 2 on at
    RE: Excel AddIn - Business Central on-pem - AAD Authentication - Error loading metatdata

    Seems like there are many people that have problems with the Excel AddIn?

    github.com/.../2595

  • Dobby94 Profile Picture
    Dobby94 2 on at
    RE: Excel AddIn - Business Central on-pem - AAD Authentication - Error loading metatdata

    I see on the third error.. There is a double test202301ad webserverinstance name.. Then I understand, why it is not working. But where does he get it from?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Complete!

🔔 Be sure to subscribe to the new forums you are interested in to stay up to date! 🔔

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,134 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,928 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans