Programmatically get client I'd and secret of provider hosted alp

Home Page Forums Office 365 SharePoint Programmatically get client I'd and secret of provider hosted alp

This topic contains 3 replies, has 3 voices, and was last updated by  AbbyTomkinson 7 months, 3 weeks ago.

  • Author
  • #540

    Mark Stokes

    If I deploy a provider-hosted app with Manage Site Collection rights, can I programmatically get the associated client of and secret to pass to an Azure Function to perform some off-server coding capability? Or would the user need to generate a new app and supply the credentials?

    • This topic was modified 2 years, 1 month ago by  Bill Ayers.
  • #543

    Bill Ayers

    If you don’t know the client secret you need to generate a new one. You can do this using PowerShell – not sure if that’s quite what you meant by ‘programmatically’ 🙂

  • #547

    Mark Stokes

    Thanks Bill.

    What I meant is that I am building a Provider Hosted App (yep, they still have a place!) to be deployed to multiple customers. The app won’t go into the store because of the permissions is requests on the site (Site Collection Full Control). When that app gets deployed it creates an App Registration in the target site(s).

    I want to get that Client ID and Secret for each customer so we can run some “background tasks” in the tenant using services outside the PHA such as Azure Functions.

    I have been pointed to the Microsoft Seller Dashboard where I can create a new ClientID and Secret for my PHA, but not associate it to a store item. (

    Now, I can use this ClientID and Secret in my PHA and when that in installed on the site it gets the permissions it needs, but my PowerShell / Azure Functions can also use the same ID and Secret to connect in and do what they need.


  • #921


    Asking ID from new client is very important for online services providers for safety and security purposes of both sides. Students get perfect progress with use boomessays that are written by qualified writers of world.

You must be logged in to reply to this topic.