Deploying SharePoint Hosted App in SharePoint 2016

358 Views Asked by At

I am developing SharePoint Hosted App and followed steps mentioned in below Microsoft link to create app domain.

https://learn.microsoft.com/en-us/sharepoint/dev/sp-add-ins/set-up-an-on-premises-development-environment-for-sharepoint-add-ins

Here is how my addin url look like on my dev box after installation of addin

http://add-in-4566480226b84e.MachineName:1300/AddInName

Add-in_Prefix: add-in

Add-in_ID: 4566480226b84e

Add-in_Base_Domain: MachineName:1300

Add-in_Name: AddInName

When I deploy the addin from Visual Studio 2017 it adds below entry in host file and I understand why this entry is required.

127.0.0.1 add-in-4566480226b84e.MachineName # 65ea9305-f44a-4aab-8fb3-b97f7f273177;http://MachineName:1300/

::1 add-in-4566480226b84e.MachineName # 65ea9305-f44a-4aab-8fb3-b97f7f273177;http://MachineName:1300/

When I install addin with below command it does not add host file entries and have to add the host entry manually.

$MyApp = Import-SPAppPackage `
    -Path "C:\Ravi\AddIn.app" `
    -Site "http://MachineName:1300/" `
    -Source DeveloperSite `
    -Confirm:$false
Install-SPApp -Web "http://MachineName:1300/" -Identity $MyApp 

Now I have to move this addin to the production environment and I am guessing below is how url will be formed.

SharePoint URL

http://product.companyname.com

Addin Url

http://add-in-4566480226b84e.product.companyname.com/AddInName

My question is

  1. Am I correct on my understanding of production addin url?

  2. how url will be resolved? When I was in my dev environment I host file was updated by VS2017/manually and url was resolved. Now I am in production, will the url be resolved automatically or I have to do some special additional configuration.

1

There are 1 best solutions below

10
baywet On

You need to configure your farm to host applications/add-ins. Three parts are required:

  • the subscription service application

  • the application registration service application

  • the DNS configuration

The last one is documented here on what's required and how to configure that one Windows. However it might defer depending on your DNS infrastructure. Microsoft documentation