Forum Discussion

waqad's avatar
waqad
Copper Contributor
May 17, 2023

SharePoint Online WebJobs Authentication

We have created a webjob on Azure for SharePoint Online. The jo creates some site collections and lists within them based on business ligic. Currently we have hard coded user email and password into the c# code. We would like to know if its possible to pass username and password when the job starts to execute.

4 Replies

  • The better approch will be create a Azure App Registration, and use that app's ClientID and Secret key to authenticate in your application
    • waqad's avatar
      waqad
      Copper Contributor

      Deleted Can you please share some samples or article for the same.

      • Deleted's avatar
        Deleted
        Hi,
        Please refer this article https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/security-apponly-azureacs

        Which has step by step method

Resources