Deploying SharePoint Hosted App in SharePoint 2016 - sharepoint-apps

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
Am I correct on my understanding of production addin url?
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.

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

Related

TF15013: The requested Team Foundation Server is not registered with the proxy server

I have configured TFS Proxy server and have set the source control setting of my local VS client. Also TFS Application server & TFS Proxy server both are in same network Domain.
But when i am taking get latest of any team project and second time taking the get latest of same team project at different machine but files are downloading Main server and giving below warning.
TF15013: The requested Team Foundation Server is not registered with the proxy server.
Can Anyone help me out how to resolve this issue & make fast get latest.
Thanks,
You can try to use the proxy command to configure your client to use a proxy server: see Proxy Command
eg :
c:\projects>tf proxy /add http://server:8081 /default:global /collection:http://tfsserver:8080/
If that still not work, recommend you to reconfigure the Proxy, you must use service accounts to install Team Foundation Server, and Team Foundation Server Proxy. These service accounts become the identity for the installed component.
By default, every component uses a built-in account (such as Network Service) as its service account.Built-in accounts do not use passwords and already have the Log on as a service permission, making them easier to manage, especially in a domain environment. See requirements.
After that you can reference below link to configure the TFS proxy to work with Your TFS:
https://blogs.msdn.microsoft.com/buckh/2016/10/12/how-to-configure-a-tfs-proxy-to-work-with-team-services/
Update:
TFS 2013 is Xaml build system, double chick the definition will pop up the definition to edit. TFS 2017 is vNext build system, it will redirect to web client build progress page. That's by design, not related to the source settings.
And as far as I know, there isn't the utility or third part tools can open the vNext build definition in VS directly, vNext build definition is task independent, you can edit it conveniently via web portal.

Visual Studio 2017 Web publishing fails if user is non-admin while the same user can be used for VS2015 web publishing on the same web server

I am trying to publish a ASP.NET Core Web project to IIS (remote server) using a non-admin account using Visual Studio 2017 and I have the following error on deploy:
Starting Web deployment task from source:
manifest(D:\Projects\Own\AspNetCore\CoreWithAngularTrial\CoreWithAngularTrialApi\obj\Debug\netcoreapp1.1\PubTmp\CoreWithAngularTrialApi.SourceManifest.xml)
to Destination: auto(). C:\Program Files (x86)\Microsoft Visual
Studio\2017\Community\MSBuild\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeploy.targets(134,5):
Error : Web deployment task failed. (Connected to the remote computer
("...") using the Web Management Service, but could
not authorize. Make sure that you are using the correct user name and
password, that the site you are connecting to exists, and that the
credentials represent a user who has permissions to access the site.
Learn more at:
http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_UNAUTHORIZED.)
Make sure the site name, user name, and password are correct. If the
issue is not resolved, please contact your local or server
administrator. Error details: Connected to the remote computer
("...") using the Web Management Service, but could
not authorize. Make sure that you are using the correct user name and
password, that the site you are connecting to exists, and that the
credentials represent a user who has permissions to access the site.
Learn more at:
http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_UNAUTHORIZED.
The remote server returned an error: (401) Unauthorized. Publish
failed to deploy.
I have the following configuration for deployment:
Publish method = Web deploy
Server = servername:8172/msdeploy.axd
Site name = Default Web Site/CoreWithAngularTestApi
User name = username
Password = ******
The exact same configuration works when publishing a different application (ASP.NET MVC 5) under the same Web site (Default Web Site), so publishing configuration appears to be correct on the remote server.
Making username a local administrator unblocks the publishing process in Visual Studio 2017.
Also, publishing configuration files (*.pubxml) are virtually identical.
Event viewer on remote server catches the following error:
IISWMSVC_AUTHORIZATION_SERVER_NOT_ALLOWED
Only Windows Administrators are allowed to connect using a server
connection. Other users should use the 'Connect To Site or
Application' task to be able to connect.
Process:WMSvc User=username
Question: How can I enabled non-administration web publishing from Visual Studio 2017?
This issue has been fixed: https://github.com/aspnet/websdk/issues/146.
ASP.NET core project uses a different set of Publish targets (hence the change in behavior from MVC5). This project is available on GitHub - https://github.com/aspnet/websdk.
I managed to figure out why the publish fails with non-admin user. Server setup is correct, but Visual Studio publishing seems to treat ASP.NET Core Web app deployment differently from ASP.NET MVC 5 one.
I had to explicitly specify web site name within the publishing profile xml file. So, instead of:
<MSDeployServiceURL>servername:8172/msdeploy.axd</MSDeployServiceURL>
I put
<MSDeployServiceURL>servername:8172/msdeploy.axd?Site=Default Web Site</MSDeployServiceURL>
NOTE: This problem does not occur when publishing an MVC 5 project within VS2017.

Building and starting a web role in Visual Studio with a specific URL

I have an Azure service containing a web role. Both configured to run on IIS Server locally. I would like to build/deploy and start the web role in a specific URL in Visual Studio. It always ends up in addresses using 127.0.0.1 even I specify what project URL is in the project configuration. Is there any way to change this something like dev.xxx.com?
You're running through the local emulator I assume. As such, the URL project settings won't apply. Just like if you deploy it to the cloud, you'll need some type of DNS forwarder or alias.

How do I assign a Amazon EC2 security group to allow publishing using webmatrix

"Assign this instance to a security group which allows publishing using Webmatrix: http://go.microsoft.com/fwlink/?LinkId=209901"
it shows on desktop readme after "Microsoft Optimized Hosting WebMatrix AMI" booted. But the article is missing.
Thanks your help.
following is the full text readme:
Welcome to your WebMatrix Server Instance on Amazon EC2. You can publish to this server using Microsoft WebMatrix after following these steps:
1) Install WebMatrix on your development PC:
2) * IMPORTANT * Assign this instance to a security group which allows publishing using Webmatrix: http://go.microsoft.com/fwlink/?LinkId=209901
3) Download the WebMatrix.PublishSettings file that is on your desktop to your development PC. You can import these publishing settings into WebMatrix for one-click publishing.
According to this article:
http://blogs.msdn.com/b/gduthie/archive/2011/04/27/webdeploy-tip-for-webmatrix-watch-out-for-port-blocking.aspx
Port 8172 must be available to the computer doing the deployment.
Add permission to the security group your web server is running in to allow access to port 8172 for the computer that needs to do the deployment.
Then, set the EC2 host to be in that security group.

ClickOnce Not Obeying Installation Folder for Localhost

I'm testing a ClickOnce application deployment. I have setup a virtual directory on my machine (running IIS). I have specified http://localhost/SampleApplication as the Installation Folder URL in the Publish tab of Visual Studio. However, when I publish the application I get the following error:
Warning: Files could not be downloaded
from http://chrish/SampleApplication/.
The remote server returned an error:
(407) Proxy Authentication Required.
Publish success.
Warning: Unable to
view published application at
http://chrish/SampleApplication/publish.htm.
http://chrish/SampleApplication/publish.htm
Notice how it has changed my url from Localhost to my login name. Why? This wasn't happening a week ago.
ClickOnce installation involves verifying that the server name matches the expected name. Thus localhost always gets translated under the covers to the computer name [not the username as you suggest in your question] (one of many confusing things ClickOnce does - one side effect of this is that if you want to set up 3 download servers, you need to do 3 separate publishes and/or script the publish like this) or like this. So this is not a surprise - it's always doing that under the covers.
The 407 error relates to proxy auth. This implies downloading is being diverted via a proxy such as Microsoft ISA Server. Have a look in your IE Internet Options Connections Proxy Settings and make sure its bypassing for local addresses [such as chrish].
The reason it's reporting success is that the upload likely uses an alternate mechanism than the verification does and isn't being routed via / blocked by the proxy. (The underlying problem is that the .NET framework does not by default pass proxy credentials and you'd need to either apply a config entry for devenv or whatever does the publish or have the build process call a test step with extra code that does send the proxy credentials](http://blogs.msdn.com/jpsanders/archive/2009/03/24/httpwebrequest-webexcepton-the-remote-server-returned-an-error-407-proxy-authentication-required.aspx). See also How should I set the default proxy to use default credentials?)
ClickOnce doesn't like "localhost", but you can work around that.
If you set the Publishing Folder Location to:
C:\inetpub\wwwroot\SampleApplication\
and the Installation Folder URL to:
http://chrish/SampleApplication/
(where "chrish" is the network name of your computer) then you can publish locally.

Resources