There are a few PowerShell scripts out there that can make some of the necessary changes for you, but in my experience these scripts are often incomplete and add unnecessary complexity. Either way, I have always found it's better to understand what's happening in your environment even if you choose to automate the process afterwards. Be sure to follow these instructions closely and don't skip any steps. Please note - there may be some naming variations, depending on the configuration of your SharePoint development environment.
Download this article Create Isolated App Domain.pdf (1.0MB)
Download the SharePoint commands Isolated App Domain Commands.txt used in this article (1.7KB)
Step-by-Step Instructions (Graphical Instructions | Video Instructions | Downloads)
- Run the DNS Manager from the Windows Start Screen.
- In DNS Manager, right-click Forward Lookup Zones, then the New Zone context menu.
- Click Next on the New Zone Wizard dialog.
- On the Zone Type step, select Primary zone, then Next.
- On the Active Directory Zone Replicator Scope step, select the To all DNS servers running on domain controllers in this domain option, then Next.
- On the Zone Name step, enter your app domain name (i.e.,
informatix.com
), then Next. - On the Dynamic Update step, select the Allow only secure dynamic updates option, then Next.
- Click Finish to complete the New Zone Wizard.
- Right-click the newly created zone (
informatix.com
) and click New Alias (CNAME) from the context menu. - On the New Resource Record dialog, enter
*
as the Alias name and select the Browse button. - On the Browse dialog, drill down to your server -> Forward Lookup Zones -> domain controller -> (same as parent folder). Ensure Hosts and Aliases (A and CNAME Records) is selected as the Record types and click the OK button.
- Click OK to close the New Resource Record dialog.
- Verify the SOA, NS and CNAME were properly created by selecting the new Forward Lookup Zone (
informatix.com
). - In SharePoint Central Administration, click the Manage service applications link.
- Click the New button, then the App Management Service menu item.
- On the New App Management Service Application dialog, enter
AppManagementServiceApp
as the Service Application Name. Select the Use existing application pool option, then select SPAppPool from the drop-down. Ensure the Create App Management Service Application checkbox is checked. Click the OK button. - The service application process may take a couple of minutes, depending on the development farm configuration.
- Once returned to the list of Service Applications, ensure both App Management Service Application and User Profile Service Application are Started.
- Run the SharePoint 2013 Management Shell as an administrator.
- Start the SPAdminV4 and SPTimerV4 service applications:
net start SPAdminV4
net start SPTimerV4
- Set the domain used to host apps to the new zone created above:
Set-SPAppDomain "informatix.com"
- Start the AppManagementServiceInstance and SPSubscriptionSettingsServiceInstance service instances:
Get-SPServiceInstance | where{$_.GetType().Name -eq "AppManagementServiceInstance" -or $_.GetType().Name -eq "SPSubscriptionSettingsServiceInstance"} | Start-SPServiceInstance
- Ensure the AppManagementServiceInstance and SPSubscriptionSettingsServiceInstance service instances are Online:
Get-SPServiceInstance | where{$_.GetType().Name -eq "AppManagementServiceInstance" -or $_.GetType().Name -eq "SPSubscriptionSettingsServiceInstance"}
- Create the SharePoint Subscription Service:
$account = Get-SPManagedAccount "DC07\SPFarm"
$appPoolSubSvc = New-SPServiceApplicationPool -Name SettingsServiceAppPool -Account $account
$appPoolAppSvc = New-SPServiceApplicationPool -Name AppServiceAppPool -Account $account
$appSubSvc = New-SPSubscriptionSettingsServiceApplication –ApplicationPool $appPoolSubSvc –Name SettingsServiceApp –DatabaseName SettingsServiceDB
$proxySubSvc = New-SPSubscriptionSettingsServiceApplicationProxy –ServiceApplication $appSubSvc
$appAppSvc = New-SPAppManagementServiceApplication -ApplicationPool $appPoolAppSvc -Name AppServiceApp -DatabaseName AppServiceDB
$proxyAppSvc = New-SPAppManagementServiceApplicationProxy -ServiceApplication $appAppSvc"DC07\SPFarm"
to your farm account (or create a new farm-level managed account). - Set the name for the site subscription:
Set-SPAppSiteSubscriptionName -Name "app" -Confirm:$false
- Create a new Developer Site site collection for local App deployment. In Central Administration, click Create site collections.
- On the Create Site Collection page, enter the following and click the OK button:
Field Value Title App Dev Description Application Development URL dev Template Collaboration -> Development Site Primary Administrator Administrator - Once the developer site has been created, click the OK button to return to Central Administration.
- (Optional) In some cases, you might receive unauthorized errors or multiple login requests after you've deployed a SharePoint app. One solution is to Disable Loopback Check in Windows. I usually just disable the loopback check at this point to avoid headaches down the road.
- That's it - now you're ready to deploy your SharePoint apps to your local SharePoint development environment.
Graphical Instructions
- Run the DNS Manager from the Windows Start Screen.
- In DNS Manager, right-click Forward Lookup Zones, then the New Zone context menu.
- Click Next on the New Zone Wizard dialog.
- On the Zone Type step, select Primary zone, then Next.
- On the Active Directory Zone Replicator Scope step, select the To all DNS servers running on domain controllers in this domain option, then Next.
- On the Zone Name step, enter your app domain name (i.e.,
informatix.com
), then Next. - On the Dynamic Update step, select the Allow only secure dynamic updates option, then Next.
- Click Finish to complete the New Zone Wizard.
- Right-click the newly created zone (
informatix.com
) and click New Alias (CNAME) from the context menu. - On the New Resource Record dialog, enter
*
as the Alias name and select the Browse button. - On the Browse dialog, drill down to your server -> Forward Lookup Zones -> domain controller -> (same as parent folder). Ensure Hosts and Aliases (A and CNAME Records) is selected as the Record types and click the OK button.
- Click OK to close the New Resource Record dialog.
- Verify the SOA, NS and CNAME were properly created by selecting the new Forward Lookup Zone (
informatix.com
). - In SharePoint Central Administration, click the Manage service applications link.
There are a variety of SharePoint service applications that may appear on this page, but the User Profile Service Application and App Management Service Application must both exist and be Started. Additionally, there must be at least 1 User Profile setup within the User Profile Service Application. For more information, see Overview of the User Profile service application in SharePoint Server 2013. - Click the New button, then the App Management Service menu item.
- On the New App Management Service Application dialog, enter
AppManagementServiceApp
as the Service Application Name. Select the Use existing application pool option, then select SPAppPool from the drop-down. Ensure the Create App Management Service Application checkbox is checked. Click the OK button. - The service application process may take a couple of minutes, depending on the development farm configuration.
- Once returned to the list of Service Applications, ensure both App Management Service Application and User Profile Service Application are Started.
- Run the SharePoint 2013 Management Shell as an administrator.
- Start the SPAdminV4 and SPTimerV4 service applications:
net start SPAdminV4
net start SPTimerV4
- Set the domain used to host apps to the new zone created above:
Set-SPAppDomain "informatix.com"
- Start the AppManagementServiceInstance and SPSubscriptionSettingsServiceInstance service instances:
Get-SPServiceInstance | where{$_.GetType().Name -eq "AppManagementServiceInstance" -or $_.GetType().Name -eq "SPSubscriptionSettingsServiceInstance"} | Start-SPServiceInstance
- Ensure the AppManagementServiceInstance and SPSubscriptionSettingsServiceInstance service instances are Online:
Get-SPServiceInstance | where{$_.GetType().Name -eq "AppManagementServiceInstance" -or $_.GetType().Name -eq "SPSubscriptionSettingsServiceInstance"}
- Create the SharePoint Subscription Service:
$account = Get-SPManagedAccount "DC07\SPFarm"
$appPoolSubSvc = New-SPServiceApplicationPool -Name SettingsServiceAppPool -Account $account
$appPoolAppSvc = New-SPServiceApplicationPool -Name AppServiceAppPool -Account $account
$appSubSvc = New-SPSubscriptionSettingsServiceApplication –ApplicationPool $appPoolSubSvc –Name SettingsServiceApp –DatabaseName SettingsServiceDB
$proxySubSvc = New-SPSubscriptionSettingsServiceApplicationProxy –ServiceApplication $appSubSvc
$appAppSvc = New-SPAppManagementServiceApplication -ApplicationPool $appPoolAppSvc -Name AppServiceApp -DatabaseName AppServiceDB
$proxyAppSvc = New-SPAppManagementServiceApplicationProxy -ServiceApplication $appAppSvc
Make sure to change the"DC07\SPFarm"
to your farm managed account (or create a new farm-level managed account). - Set the name for the site subscription:
Set-SPAppSiteSubscriptionName -Name "app" -Confirm:$false
- Create a new Developer Site site collection for local App deployment. In Central Administration, click Create site collections.
- On the Create Site Collection page, enter the following and click the OK button:
Field Value Title App Dev Description Application Development URL dev Template Collaboration -> Development Site Primary Administrator Administrator - Once the developer site has been created, click the OK button to return to Central Administration.
- (Optional) In some cases, you might receive unauthorized errors or multiple login requests after you've deployed a SharePoint app. One solution is to Disable Loopback Check in Windows. I usually just disable the loopback check at this point to avoid headaches down the road.
- That's it - now you're ready to deploy your SharePoint apps to your local SharePoint development environment.
Video Instructions
Downloads
This article as a PDF Create an Isolated App Domain in SharePoint 2013.pdf (1.0M).
The commands used in this article IsolatedAppDomain-Commands.txt (1.7K).
Can this be done with a Powelshell?
ReplyDeleteThis is very well done. Can I use this as part of my dev instructions?
ReplyDeleteThanks for the compliment. Generally speaking, I don't have any issue with you using it as long as you link back to my article - where are you wanting to use it? Jason.
DeleteGood job on this. It was a bug help.
ReplyDeletevery good article. can you send it to me please?
ReplyDeleteThere's a PDF link at the top and bottom of the article for direct download. Jason.
DeleteThanks for putting this together. Quick question, should you really use an existing AppPool for the AppManagmentServiceApp? I've read that's not best practice. Thanks for your help with this.
ReplyDeleteCertainly not in a production environment or probably not even an integration environment, but I've always found it easier for a purely development environment and it doesn't really impact the type of SP App Dev I do, but you can certainly create a new managed service account and new app pool if you prefer. Have fun! Jason.
DeleteGreat article ! Just to clarify, I have a development farm and a production farm and all servers share the same DNS servers. Do I create two different app domains, one for production and one for development ? At the moment I have both farms using the same app domain but this means that I need to manually edit the host file for every application deployment in visual studio in order to find the application on my development farm.
ReplyDeleteThanks Benjamin - I've done this both ways. If the development team is small (a couple of developers), it can sometimes be simpler and easier to modify the host files in dev, but most of the time, it's probably more appropriate to create a separate app domain for each farm.
DeleteAwesome article! Quick question - I'm still getting login popups from IE after I've deployed a new app to my app domain? I thought it might have something to do with my app, so I created a simple "hello world" app and it does the same thing. Did I miss a step? Any ideas?
ReplyDeleteTry adding *.yourappdomain.com to the local intranet zone in IE. It's under Internet Options-->Security-->Sites-->Advanced. I've seen the same thing before and that fixed it for me. Good luck.
DeleteSweet - this worked for me!
DeleteGreat work on this! I worked on this for a long time and am glad I finally found this. Thanks. Ray.
ReplyDeleteVery good article, very many thanks.
ReplyDelete