Many failures in first exercise (Unit 3) from module "Using single sign-on (SSO) with Office Add-ins"

Doug Appleyard 1 Reputation point
2024-05-16T17:14:26.9833333+00:00

Link to module: https://learn.microsoft.com/en-us/training/modules/office-add-ins-sso/

Unit 3 is "Exercise - Create an Office Add-in for Word that implements single sign-on"

I still do not have it working. Here are some observations from debugging:

  • You need to ensure you are using node.js 18.x, not the current LTS (20.x), or the configure-sso command will fail.
  • The current version of yeoman is 5.0, but I installed 4.x as specified by this exercise.
  • You need to run "npm install" in the project directory before running "npm run configure-sso" or the configure-sso command will fail.
  • You need to install Azure CLI or configure-sso will fail.
  • You need to remove the .azure directory from your home directory (if you are using a new or different Microsoft username for testing purposes).
  • After the above fixes and workarounds, the app was successfully registered in Azure. But now "npm start" fails.
  • You need to create an empty index.js file in the src directory, or "npm start" fails with many errors.
  • From "Explore the project", file src/taskpane/taskpane.html does not exist, and neither does taskpane.js.
  • There are only two files in src/taskpane, one for Excel and one for Outlook, but this is a Word exercise.
  • "npm start" is unable to start the dev server.
  • "npm start" is unable to start debugging.
  • "npm start" is unable to sideload the Office Add-in.
  • "npm start" says Excel is not supported, but this is a Word exercise.

Here are the errors from "npm start". I have nothing running on port 3000. I have tried as administrator and as non-administrator. I am using Windows 11. I installed Python and all other packages that were part of the node.js 18 installation (e.g. Visual Studio code).

C:\Users\Username\MyWordSsoAddin>npm start

office-addin-taskpane-sso-js@0.0.0 prestart

npm run build:dev

office-addin-taskpane-sso-js@0.0.0 build:dev

webpack --mode development

asset main.js 1.21 KiB [compared for emit] (name: main)

./src/index.js 1 bytes [built] [code generated]

webpack 5.91.0 compiled successfully in 61 ms

office-addin-taskpane-sso-js@0.0.0 start

office-addin-debugging start manifest.xml

Debugging is being started...

App type: desktop

Enabled debugging for add-in d3e9dc9b-b3e1-493d-ad28-320ffa48634e.

Starting the dev server... (node --inspect=localhost:8080 dist/middletier.js)

Unable to start the dev server. Error: The dev server is not running on port 3000.

Sideloading the Office Add-in...

Error: Unable to start debugging.

Error: Unable to sideload the Office Add-in.

Error: The Office Add-in manifest does not support Excel.

Microsoft 365 Training
Microsoft 365 Training
Microsoft 365: Formerly Office 365, is a line of subscription services offered by Microsoft which adds to and includes the Microsoft Office product line.Training: Instruction to develop new skills.
36 questions
{count} votes

1 answer

Sort by: Most helpful
  1. kguntaka 1,250 Reputation points Microsoft Vendor
    2024-05-17T14:58:47.2266667+00:00

    Hello  Doug Appleyard,

    Thanks to the inputs you provided, we've been able to successfully reproduce the observations and find below along with screenshots:

    1. You need to ensure you are using node.js 18.x, not the current LTS (20.x), or the configure-sso command will fail.

    The current LTS (20.x) supports and can configure SSO without encountering any failures.

    1. The current version of yeoman is 5.0, but I installed 4.x as specified by this exercise.

    The current version of Yeoman 5.0 is functioning well, and versions higher than 4.x will work without any errors. Versions are specified at the time of document/unit preparation.

    1. You need to run "npm install" in the project directory before running "npm run configure-sso" or the configure-sso command will fail.

    NPM is installed automatically along with Node.js, eliminating the need for separate installation.

    1. You need to install Azure CLI or configure-sso will fail.

    You can execute the commands in the command terminal/powershell/CLI without requiring any additional tools.

    version

    1. You need to remove the azure directory from your home directory (if you are using a new or different Microsoft username for testing purposes).

    You can skip the step mentioned above as it is unnecessary if you are in correct azure directory. You can switch directory or sign-out from all other azure accounts to avoid confusion.

    1. After the above fixes and workarounds, the app was successfully registered in Azure. But now "npm start" fails.

    If you completed the steps above as shown in the documentation or video, you should register the app from the Azure portal. Make sure to do this with administrator privileges and enable the necessary app permissions.

     app1

    grant

    1. You need to create an empty index.js file in the src directory, or "npm start" fails with many errors.

    You don't have to create any extra files apart from those mentioned in the documentation. "npm start" is not required at this stage.

     8. From "Explore the project", file src/taskpane/taskpane.html does not exist, and neither does taskpane.js.

    Files will only be present in the specified folder if the commands are executed without any errors.

    taskpane

    1. There are only two files in src/taskpane, one for Excel and one for Outlook, but this is a Word exercise.

    When you run the command "yo office," make sure to select "Word" if you're working with Word tasks. Selecting other options like Outlook or Excel will result in an error.

    word

    1. npm start" is unable to start the dev server.
    2. "npm start" is unable to start debugging.
    3. "npm start" is unable to sideload the Office Add-in.

    Running 'npm start' allows you to initiate the development server, debug, and load the Word sideload add-in as shown in below screenshot.

    debug

    • "npm start" says Excel is not supported, but this is a Word exercise.

    These commands are tailored for Word only. If you wish to perform tasks for Excel, you can easily replace 'Word' with 'Excel' in the commands.

    npmstart

    Ref video: https://www.youtube.com/watch?v=kf_VMt_Eh0M Ref documentation links:

    Note: Please ensure that no networks or devices are in restricted mode to obtain results without encountering any errors. If you're using Node.js version 20.0.0 or later, you may see a warning when the generator runs the installation that you have an unsupported engine. We're working on a fix for this. In the meantime, the warning doesn't affect the generator or the project you generate, so it can be ignored.

    Hope the above information can help.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".