若是沒有Enable app,打開app store的時候出出現錯誤:web
要開啓他,首先要有一個App的DNS,以下新建,若是管理工具裏面沒有DNS,那麼到feature中增長。app
Control Panel\System and Security\Administrative Tools工具
右擊Forward Lookup Zonesui
點New Zone, 一直點Next,而後輸入一個域名字。this
而後右擊新建的域,而後點New Aliascode
以下圖設置server
DNS新建好以後,新建APP Management Service和Subscription Setting Service Applicationblog
而後確保兩個Service是運行的,以下ip
總之運行下面的腳本就能夠開啓了ci
$appManagementService = Get-SPServiceInstance | where {$_.TypeName -like ‘App Management Service‘} if($appManagementService.Status -ne ‘Online‘) { Write-Host ‘Starting App Management Service‘ Start-SPServiceInstance $appManagementService | Out-Null } else{ Write-Host ‘App Management Service was already started‘ } # wait for App Management Service to start」 while ($service.Status -ne ‘Online‘) { # delay 5 seconds then check to see if service has started sleep 5 $service = Get-SPServiceInstance | where {$_.TypeName -like ‘App Management Service‘} } $subscriptionSettingsService = Get-SPServiceInstance | where {$_.TypeName -like ‘Microsoft SharePoint Foundation Subscription Settings Service‘} if($subscriptionSettingsService.Status -ne ‘Online‘) { Write-Host ‘Starting Subscription Settings Service‘ Start-SPServiceInstance $subscriptionSettingsService | Out-Null } else{ Write-Host ‘Subscription Settings Service was already started‘ } while ($service.Status -ne ‘Online‘) { # delay 5 seconds then check to see if service has started sleep 5 $service = Get-SPServiceInstance | where {$_.TypeName -like ‘Microsoft SharePoint Foundation Subscription Settings Service‘} } $appManagemetnServiceApplicationName = ‘App Management Service‘ $appManagementServiceApplication = Get-SPServiceApplication | where {$_.Name -eq $appManagemetnServiceApplicationName} # create an instance App Management Service Application and proxy if they do not exist if($appManagementServiceApplication -eq $null) { Write-Host ‘Creating App Management Service Application‘ $pool = Get-SPServiceApplicationPool ‘SharePoint Web Services Default‘ $appManagementServiceDB= ‘Sharepoint_AppManagementServiceDB‘ $appManagementServiceApplication = New-SPAppManagementServiceApplication ` -ApplicationPool $pool ` -Name $appManagemetnServiceApplicationName ` -DatabaseName $appManagementServiceDB Write-Host ‘Creating App Management Service Application Proxy‘ $appManagementServicApplicationProxy = New-SPAppManagementServiceApplicationProxy ` -ServiceApplication $appManagementServiceApplication } else{ Write-Host ‘App Management Service Application already exist‘ } $subscriptionSettingsServiceApplicationName = ‘Subscription Settings Service Application‘ $subscriptionSettingsServiceApplication = Get-SPServiceApplication | where {$_.Name -eq $subscriptionSettingsServiceApplicationName} # create an instance Subscription Service Application and proxy if they do not exist if($subscriptionSettingsServiceApplication -eq $null) { Write-Host ‘Creating Subscription Settings Service Application‘ $pool = Get-SPServiceApplicationPool ‘SharePoint Web Services Default‘ $subscriptionSettingsServiceDB= ‘Sharepoint_SiteSubscriptionSettingsServiceDB‘ $subscriptionSettingsServiceApplication = New-SPSubscriptionSettingsServiceApplication ` -ApplicationPool $pool ` -Name $subscriptionSettingsServiceApplicationName ` -DatabaseName $subscriptionSettingsServiceDB Write-Host ‘Creating Subscription Settings Service Application Proxy‘ $subscriptionSettingsServicApplicationProxy = New-SPSubscriptionSettingsServiceApplicationProxy ` -ServiceApplication $subscriptionSettingsServiceApplication } else{ Write-Host ‘Subscription Settings Service Application already exist‘ } Set-SPAppDomain ‘apps.xxx.com‘ -Confirm:$false Set-SPAppSiteSubscriptionName -Name ‘app‘ -Confirm:$false
最後到CA點Apps,點Configure App Urls,就能夠看到
當你點app store的時候,其實並無離開你的站點。
最後當添加的時候出現錯誤
須要去CA激活一個Feature
1. Browse to Central admin
2. Click on ‘Application Management‘
3. Click ‘Manage web applications‘
4. Select the web application which hosts the site you are trying to install the app to
5. Click ‘Manage Features‘
6. ‘Apps that require accessible internet facing endpoints‘ should be deactivate. Click ‘Activate‘