Share via


Sharepoint 2013 App Setup Issues

Issues while doing this:

During step 3 we can't get option Add it invisible as it shows following error: 

Sorry apps are turned off. If you know who runs the server tell them to enable apps.

http://sagaragaskar.files.wordpress.com/2014/01/wordpress.png?w=650 

So we have to set up app hosting environment(Configure DNS) as follows:

Source: http://sharepointchick.com/archive/2012/07/29/setting-up-your-app-domain-for-sharepoint-2013.aspx

(Follow all next steps to page no 12)

 http://sagaragaskar.files.wordpress.com/2014/01/wordpress1.png?w=244

http://sagaragaskar.files.wordpress.com/2014/01/wordpress2.png?w=511

A) Create new domain to host your apps:

Go to Start->administrative tools->DNS->right-click forward lookup zones->select new zone->next->keep default->next->default on next tab and next->specify zone name->next-> Right click on new zone and select new alias (CNAME)->Fill in * for it->click browse->click on server name->double click forward lookup zones->double click domain of SharePoint environment->select *->Ok->Ok. 

B)Configure SharePoint:

Starting app management and subscription settings services (also start user profile service in SharePoint)

Source: http://msdn.microsoft.com/en-us/library/fp179923%28v=office.15%29 

http://sagaragaskar.files.wordpress.com/2014/01/wordpress3.png?w=636

1. Start app management service as shown above

2. Go to central admin->click apps in left-hand navigation->configure app urls->fill URL of app domain->fill in app prefix->

 http://sagaragaskar.files.wordpress.com/2014/01/wordpress4.png?w=650

3.But if you click on it you will get following error:

 http://sagaragaskar.files.wordpress.com/2014/01/wordpress5.png?w=650

4.Thus, we have to configure subscription setting first through PowerShell only(as no UI available)

Source: http://www.sharepointalex.co.uk/index.php/2012/11/enabling-sharepoint-2013-apps/

  • Ensure spadmin and sptimer service are started by running following command with PowerShell run as administrator.

net start spadminv4

net start sptimerv4

  • Specify app pool,account,database settings for SPSubscriptionService:

    1.$account=Get-SPManagedAccount “TESTSPENV\Administrator”
    2.$appPoolSubSvc=Get-SPServiceApplicationPool -Identity “Default SharePoint Service App Pool”
    3.$appSubSvc=New-SPSubscriptionSettingsServiceApplication -ApplicationPool $appPoolSubSvc -Name SettingsServiceApplication -DatabaseName AppServiceDB
    4.$proxySubSvc= New-SPSubscriptionSettingsServiceApplicationProxy -ServiceApplication $appSubSvc
    
  • Specify your tenant name by typing the following code in the SharePoint Management Shell.

    Set -SPAppSiteSubscriptionName -Name “app” -Confirm:$false
    

    Add your isolated app domain to your bypass list in Internet Explorer

  • In Internet Explorer, go to Tools.

  • Choose Internet options.

  • On the Connections tab, choose the LAN Settings button.

  • Clear the Automatically detect settings check box.

  • Select the Use a proxy server for your LAN check box.

  • Choose the Advanced button, and then add *.YourAppDomain.com to the Exceptions list.

  • Choose the OK button.

  • Choose the OK button to close the Local Area Network (LAN) Settings dialog box.

  • Choose the OK button to close the Internet Options dialog box. 

5) Create App management Service Application through UI:

http://sagaragaskar.files.wordpress.com/2014/01/wordpress6.png?w=650

Note:

Again, if you click on Configure App URLs you may encounter following error: 

Settings or services required to complete this request are not currently available. 

To resolve this do following:

Go To IIS Manager ->app pools->ensure SecurityTokenServiceApplicationPool is running(If it is stopped you may get above error) 

6) Go to apps->configure app URLs specify app domain name as well as app prefix as below:

 http://sagaragaskar.files.wordpress.com/2014/01/wordpress7.png?w=650

Continued from Page no. 6

Now you will encounter another error as below: 

Sorry, this app is not supported in your server

 http://sagaragaskar.files.wordpress.com/2014/01/wordpress8.png?w=650 

Napa tool is only available if office 365 is installed so it won't work in this case. 

The reason why MS released Napa is to avoid large setup cost for development environment of SharePoint Machine. With the help of Napa developer tools app installed as SP app, we don’t need to install SharePoint itself instead we can use this tool through the browser and enhance it using VS or Designer. But its shared environment with others so we cant do everything with Napa such as farm solutions development (not supported in Office 365.) 

But even if one company has invested in Office 365 but needs some customization via code we are back to square again ie. Need for SP development machine.

2) Using Visual Studio 2012

We can use client side as well as server-side object model for developing apps in SP2013.

CSOM uses either of following client applications :

  1. Silverlight
  2. JavaScript
  3. .NET Framework. 

An object used in CSOM are:

  1. Client Context: proxy interacting with SP.It batches requests and handles response messages.
  2. Client Object: base class for all client-side objects.
  3. Caml query: used to query content in SharePoint site.
  4. AppContextSite:access SP data in apps host web as in context web we can use Client Context object. 

Also, there are fundamental objects which are similar to Server object model except for prefix SP as below:

  1. Site
  2. Web
  3. List
  4. ListItem
  5. File/Folder
  6. Field
  7. ContentType 

Basic Example illustrating SharePoint App Creation:

 http://sagaragaskar.files.wordpress.com/2014/01/wordpress9.png?w=650

http://sagaragaskar.files.wordpress.com/2014/01/wordpress10.png?w=650

Open VS2012->create new project->office/sharepoint->apps->Apps for SP2013->give name->ok-> specify URL for debugging of app which we have created earlier in this document->specify hosting whether auto/provider/SharePoint hosted->finish. 

You will encounter following error if you tried to deploy the app:

Error occurred in deployment step ‘Install app for SharePoint’: The System Account cannot perform this action.

This is because we can't deploy apps using system account as per security guideline of SharePoint.

The solution for this is as follows:

Create another account and give permissions, so that it is NOT the system account.

Did the following:

•Created a new account in AD as “admin1”
•Added “admin1” account into Farm Administrator’s group in Central Admin
•Added “admin1” account as Site Collection administrator to the target developer site
•Added “admin1” account into local administrators group. 

Also then you will encounter following error if you tried to deploy the app: 

“Error occurred in deployment step “Installed app for SharePoint”: The local SharePoint server is not available. Check that the server is running and connected to the SharePoint Farm” 

To resolve the above error switch back to system account and open the SQL Server Management Studio and assign the db_owner permissions to an account which you are using to deploy the app for below databases.

  1. SharePoint_Config.

  2. SharePoint_Admin_ [GUID].

  3. Your current web application that needs to host the app. 

  4. Appmanagement_Service_DB (app management service application database).

  5. SubscriptionSettings_Service_DB (Subscription Settings service application database).

Note: Don’t forget to make that account dbOwner of ContentDB associated with your web application.

Source:

http://vivekthangaswamy.blogspot.in/2013/09/error-occurred-in-deployment-step.html

http://www.sharepoint-journey.com/app-development-in-sharepoint.html

Publishing App to Office Store or an App Catalog:

go to VS 2012->project->right click-> Publish ->finish

when output folder opens we can see our app package which we will upload to office store or app catalog.

 http://sagaragaskar.files.wordpress.com/2014/01/wordpress11.png?w=650

Distribution:

To enable users to acquire our app, it needs to be deployed to Central Admin. There are two options for the same:

Private app catalog: We can publish apps to an internal instance of SP app catalog to make it available to users of the organization.

Office Store: We can publish apps to SharePoint Store which is available publicly, once it is published users across the internet can use it. 

Publish to Private app catalog:

http://sagaragaskar.files.wordpress.com/2014/01/wordpress12.png?w=650

App catalog is special site collection within a web application or tenant in SP2013. Because a farm can contain more than one tenant it can have more than one app catalog. 

Go to central admin->apps->manage app catalog->create new app catalog-> when site collection is created click on app catalog site collection link.

This is new app catalog. There are three tiles that allow performing basic functions of app catalog: 

Distribute apps for SP: This link takes you to the library used to manage SharePoint app packages in a catalog.

 http://sagaragaskar.files.wordpress.com/2014/01/wordpress13.png?w=650

Distribute apps for Office: This link takes you to the library used to manage office apps packages in the catalog. 

Manage requests for apps: This link allows tenant administrator to approve or reject end user requests for new apps. 

After your app catalog is created, you can add your app for distribution. 

Click on distribute apps for SharePoint. 

In windows explorer open output folder from app project to locate app file. Then drag this file or click on new app link. 

The app is now ready to be installed by your users. 

Navigate back to your development site in the web browser. 

Select Site Contents from the left-hand side menu. Click on add app give a name to it and select the created app. 

In the dialog that appears, click Trust It. 

After the app has finished loading, click on the app’s tile and the default page will appear. 

After you have uploaded the app to the App Catalog, your users will be given the opportunity to install the app on their sites. However, since the App Catalog is private to your organization, users of other SharePoint environments will not see it.