Pergunta

Stackexchange says this is a subjective question but I don't think it is. I am just trying to discover feasibility here.

After a lot of reading online, I was able to successfully convert an app that was originally built using auto-hosted model to provider-hosted. I currently have it working in one sharepoint online site collection with the content being provided from an azure website.

The steps to accomplish this involved registering the app/client id & secret on the sharepoint site where the app was to be deployed (using appregnew.aspx), and then putting these values into the web.config of the provider hosted part of the app.

Now, say I want to publish this same app to another sharepoint online site. Would I need to create a completely different azure website (or other provider) for the new tenant? Since the azure web site contains the app/client ID and secret, I don't understand how this can be accomplished, since I assume that each sharepoint online site will need to generate and register a new id & secret for the provider.

Is the only way to accomplish this by packaging the app for the office store?

Update:

I suppose I could keep a database of app/client ID's and secrets on the provider / azurewebsites side, keyed by SPHostUrl, and get at multiple tenants' auth info that way. Am testing this out now. However, the AppManifest would still have to change for each publish, since it will be different for different tenants. I suppose that's not too bad, and we might be able to automate that on a build server using some powershell...

Foi útil?

Solução

Well as for me you can always register the app for the first time on one of the tenants, use the registration data in Azure and in .app file and then, when installing the app on other tenants instead of clicking on generate button in appregnew.aspx, simply paste the client id and client secret you have generated when installing the app for the first time. Have tested it in Office365<->Azure environment and it is working.

This way you use the same Azure site and the same .app file for every subsequent installation.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a sharepoint.stackexchange
scroll top