Appservice deployment issue - azure-devops

Hi iam deploying my war file using azure appservice from azuredevops. deployment is getting completed successfully but when i hit the url Microsoft azure welcome page is displayed instead of application. can you please suggest a work around

In Azure Web Apps, the default document is the web page that is displayed at the root URL for a website. The first matching file in the list is used. Refer File structure on azure to know more about the files and directories on Azure Web App.
You may check whether the deployed files are available or not using Kudu Console.
Also, make sure that your startup file (For ex: index.htm) is added to the default documents section as mentioned above. You can delete the remaining files if not required and see if that works.
For details , you can refer to this case.

Related

How to use MS Web Deploy to deploy to remote server in a datetime stamped folder

All the deployments in my work place are manual. I have been looking at ways to automate all of this using MSBUILD and MS Web Deploy. What I have managed to get working is as follows:
build/compile solutions
run database migrations
deploy directly to website using ms web deploy
All from one MSBUILD script.
This differs slightly from the manual process, as when a new version of a website is deployed manually, it is put into a new folder that is datetime stamped. And then IIS is pointed to the new folder.
My question is, how would I do these last 2 actions? i.e. write to a specific folder that sits a level higher up than the folder the current website points to, and then repoint to the new folder IIS.
Web Deploy does not support this functionality directly. Thankfully it does provide the runCommand provider, which is what you'll end up using.
%windir%\system32\inetsrv\appcmd.exe is the utility you'll use to swap site directories. An example of usage can be found here: How do I change the physical path of web site in IIS7 with APPCMD?
Create a script that calls appcmd. This script will always sit on your destination server. You can either decide to include it as a part of your site deployment, or move it along into the new directory from the old one. The "web deploy user" on the destination machine needs to have the appropriate credentials and access to create directories.
In your MSBUILD script, prior to deployment, call the script on the destination server. E.g.
msdeploy.exe -verb:sync -source:runcommand="C:\path\to\wwwroot\bin\script.bat"
-dest:auto,wmsvc=https://contoso.com:8172/msdeploy.axd,username=%username%,password=%password%
Then deploy as usual
NOTE:
Try to avoid this way of deploying entirely. If you're looking to snapshot your site, consider deploying to a package (zip), and then deploying that package to your destination server. Rollbacks should be handled by deploying an older package, not by repointing to an older directory.

Error on deploying a SharePoint 2010 site template

I have a web application in which I have few document libraries, lists, picture libraries, workflows and few webparts. The webparts are created using visual studio with the feature site scoped. WorkFlows are created using SPD. Everyting working fine in my local SharePoint server. I want to copy my web application to a different server. For this I saved the site template Site Actions-> Save Site as template, saved the wsp to my desktop. Then I took the wsp to the other server machine where i created a webapplication.
Then using PowerShell command added the solution using Add-SPSolution command. When trying to install using Install-SPSolution command I got an error:
This solution contains no resources scoped for a web application and cannot be deployed to a particular web application
I tried to change the scope of webpart feature to Web/WebApplication but encountered error when tried to deployed using visual studio.
How can I deploy the wsp in a different SharePoint Server machine?
When you save the site as a template, you'll only save the site, not your web application. Create the web application first (maybe without a site template), and roll out your site from your WSP afterwards.
If you are using powershell to deploy the solutions, please remember to include the flag -GACDeployment.

error activating .wsp file in sharepoint server 2010

I developed a sample application in visual studio 2010. I created an Empty SharePoint Project and gave the local site url for debugging. Checked "Deploy as Farm" as the trust level of the SharePoint solution. Added a visual webpart and also a class to the solution. I am able to build and successfully run the application using visual studio. In my local machine am using SharePoint foundation 2010 to debug the SharePoint application.
Now i want to deploy this application in the SharePoint server 2010 which is in a virtual machine.
1. I copied the .wsp file of the application i created to the virtual machine.
2. From the central administrator in the VM I created a web application and the site collection.
3. Then using Site Actions -> Site Settings -> Solution(Galleries), choose the .wsp file for uploading. it showed a "Warning: You should only activate this solution if you trust this solution. An activated solution can read, modify and delete your data. " and the activate button is disabled.
Then I tried to do same in my local machine on a different site collection. Here Activate button is enabled but when clicked it threw exception
Server Error in '/' Application.
This solution contains invalid markup or elements that cannot be deployed as part of a sandboxed solution. Solution manifest for solution 'aee60282-765d-4c9f-b67a-5981f18a6d3b' failed validation, file manifest.xml, line 10, character 4: The element 'Solution' in namespace 'http://schemas.microsoft.com/sharepoint/' has invalid child element 'TemplateFiles' in namespace 'http://schemas.microsoft.com/sharepoint/'. List of possible elements expected: 'FeatureManifests, ActivationDependencies' in namespace 'http://schemas.microsoft.com/sharepoint/'.
What could be this error?
The "TemplateFiles" element refers to items that will be copied onto the web server. This is allowed for farm solutions (which are deployed via CentralAdmin), but is not allowed for sandboxed solutions (which are deployed via the Solution Gallery).
When you deploy your wsp with visual studio, you deploy it as farm solution.
When you deploy your wsp from site settings into solution galery, you deploy it as user solution (sandbox solution) with some limitations :
first, avoid using out of the box visual webparts, it's prohibited !
Deploy your wsp by writing powershell script.
A good starting point here :
patrickboom.wordpress.com/2010/05/31/using-powershell-to-deploy-sharepoint-solutions-wsp-2/
Le_Fredo is correct here, when attempting to deploy a WSP file into the site collection directly under the site settings, you won't be able to. I found this article from microsoft to be extermely helpful
http://technet.microsoft.com/en-us/library/ff607688(v=office.14).aspx

Windows Azure with Multiple Sites in One Role not transforming 2nd web.debug.config to web.config

I am using Web.Config transformations to deploy my application to Azure. I also have 2 sites in my service, a public website, and private WCF site endpoint. I am deploying multiple sites to a single role.
When I deploy, the website project (for which the Azure Deploy project is set) transforms the web.config correctly. However, the WCF project (which is only addressed as a "site" in the .csdef file) does not transform the web.debug.config file to web.config.
This question is similar, but only addresses the projects building. I have set the dependencies in my project.
This workaround forces the transform of the web.config file, but it still does not appear in my deployment on Azure.
I suspect that this bug still exists, and I have also upgraded to the Azure 1.5 SDK in hopes that it will fix it.
I would like to try putting my configuration data in cscfg files but I am using Entity Framework Code First, and I do not know how to get my connection string to work with this format. EFCF seems to rely on web.config explicitly.
Any help would be appreciated.
When you add another web role, you provide a physicalPath to point to what you want deployed, and all the SDK does is copy the files it finds at that path into your package. It doesn't do a build.
You should probably be doing a build and a publish of the web app you want to deploy, and then point the physicalDirectory at the output of that publish step. (Make sure the directory you're setting in physicalDirectory contains exactly what you want to have deployed to the cloud.)

Deploy WEB Service Consumer module

We have recently added some functionality to our web site that requires adding a service reference to an api in an external domain. Adding the reference to a VS2008 project createed a sub-folder in the "Service References" folder and added 18 files to that folder that appear to represent the classes in the api. The api provider also had me add custom binding and client references to system.serviceModel in my web.config file.
Do I have to deploy that entire folder with its 18 files to my production site to use the web service? Does some of it get compiled into my project dll? I can find all kinds of references to deploying a service, but not what is necessary to deploy a service consumption module.
Sorry for short, but I don't have the answer for you. But you can get this answer yourself. This is the only way Iwould get the answer. Deploy it without them, see if it works. If it doesn't deploy with. If it works, then you know.
The good news is that I have to deploy absolutely no files from the project have to be deployed to the production site. Everything the web service consumer application needs gets compiled into the application assembly.