Clean Windows Azure Website - asp.net-mvc

My ASP.NET MVC project pushed to a Azure website with an extra DLL which is invalid. This is keeping the project from running correctly. If a new website is created it works perfectly. Cleaning the project locally and redeploying does not fix the problem. Is there a way to perform a "remote clean?"
This project is being deployed directly from Visual Studio with the publish menu item.

When you right click and click Publish Web on the left hand side there should be a settings tab. Click this. Then expand the option under File Publish Options and check the Box for Remove addtional files at destination. (This will wipe out whats already there)
Also can be detailed here: MSDN

Another trick to delete an entire Azure website deployment which can be done entirely in the Azure portal is:
1) Create a new empty deployment slot under the Azure website.
2) Swap it with the parent Azure website.
That will give you an empty Azure website. If you want you can delete the deployment slot afterwards.

You can also use console to delete any file. Kudu is a web tool that allow you to see inside of Azure web application.
Two ways to access Kudu
go here: https://yoursite.scm.azurewebsites.net/DebugConsole/?shell=powershell (replace with your real website name)
login to portal > app services > your site > Development tools > Advanced tools.

You can also delete files via Webmatrix (link in footer menu in Azure configuration portal)

Download the profile from Azure portal
Import publish profile in VS
Stop the web app in Azure portal
Stopping the web app ensures existing files including dlls and other resources will be deleted after publish succeeds.
This step might not be necessary, however, the existing web app could have some dlls that cannot be removed during publish directly, returning error messages like:
Web deployment task failed. (Unable to perform the operation ("Delete
File") for the specified directory ...
4. Publish with “Remove additional files at destination” checked
Start the web app again after publish succeeds.

for linux servers you dont get, CMD, then all you have to do its, Delete the deployment, then create deployment credentials for FTP and there you go with FTP client clean the wwwroot folder by your self.

Related

How can i get back asp.net code from azure web app?

I had published my application on azure web app and by mistake deleted the repository. Now how can I get back my code from the Azure web app? I had to try kudu but it's given an understandable format. the app in asp.net core.
For now if you want to download the web source code, you could go to the kudu site, Select Debug console -> CMD from there you can go inside site -> wwwroot and select download.
However note that this is the deployed code, and it won't be the source if you are using a compiled language such as C#. When you publish from visual studio or any CI tool the files gets published in compiled form.
The option is you can use github deployment to maintain repository which contains all source file.

How to debug Web API through a separate Web project on same machine?

I'm taking over a project from someone who is no longer avaiable to ask how/why their prjoect works.
I have two solutions, one a MVC project and the other a Web API. The MVC project calls the separate API solution to do some validation of data. If I start up the Web API project it runs on localhost:64633. Then I need to start up the MVC project so that I can step through the code and all the way through the Web API.
Thing is that the MVC project runs on localhost:64633 as well so once I have the API running and then try to debug the MVC project I get an error "Unable to start program localhost:64633. An operation is not legal in the current state.".
How can I debug both the MVC project and Web API project at the same time?
Run Your project using local IIS server, follow below steps for that
Right click on project file choose property
Go to Web tab, under the Servers header choose Local IIS
Then click "Create virtual Directory" button
Do above steps to both project. please try now
Note : Run both project with in single solution, automatically debug both project at a time.(Just suggestion only)

Webstorm remote file path is not mapped

I have set up a project from a TFS server account. After mapping the required folders for my development, i have created a project on Webstrom and then configured the TFS (with TFS plugin) to work accordingly.
I can sync and get files easily, however, once I try to write on the files (since it's all read-only till used), an error saying: "Cannot edit file(s): Mapping not found for files:"
Test pass in my lab environment(Webstorm11.0.1 TFS2015).
Just right click the file in project, select TFS -select Edit. After doing this ,it will check out the file from TFS server automatically and be editable.
Could you still see your mapping workspace under 'Manage TFS Servers and Workspaces'and your project under Working folders?
Below is my personal settings for your reference:
Make sure three things:
You are working on the Server workspace.
The status of the working folders should be Active.
Your TFS server account have the edit and check out Permissions of this project in TFS server.
If it still doesn't work, please check the log (Help-show log in..) whether contains any clues.

How to have multiple custom publishing profiles for Azure webrole

Using the Azure publish wizard gives you some options for changing your config settings, but not enough. You can tell it which build configuration to use (which will apply a transform to your web config) but you only have 2 choices. Release and debug. Also you can specify which cloud service configuration to use which will transform your service.config but again only 2 choices Cloud and Local.
My problem is that I have 3 different versions of my application running in Azure. They are Dev, Demo, and Production. Each has their own database, storage accounts, and other settings related to authentication. Just having a release and debug transformation doesn't cut it.
Really what I would like is to have a script or something so that I could publish my app to each of my Azure instances. It would change my web.config and service.config and target the right azure instances.
Any suggestions are appreciated.
There used to be CodePlex project http://wappowershell.codeplex.com/, which now became an official tool here: https://www.windowsazure.com/en-us/manage/downloads/.
It's a set of Windows PowerShell cmdlets for managing Azure deployment.
Also the following question is pretty similar: Publish Azure Project from Command Line
In researching this I updated my Azure Tools to the October release. Not sure if these options were available in old release or not but here's what I ended up with.
As it turns out can add your own services configurations and build configurations in addition to the default ones (cloud/local/debug/release).
Services configurations can be added by:
Right click your Web role from your cloud service project and select properties.
At the top of the properties window open the Service Configuration menu. Then select manage.
Select a configuration and click the create copy button.
Select the copy and rename it to whatever you want.
Click close and now you should be able to have settings specific to your new service configuration.
Build configurations can be added by (I followed this blog post):
Select Build -> Configuration Manager from the menu. The
Configuration Manager dialog
Select from the Active solution configuration dropdown list to bring up the New Solution Configuration dialog.
Enter the name and select the configuration you want to copy. Click Ok.
Make sure you select the correct Configuration (release or debug) for each of your projects for your new solution configuration.
Notice there is still no web.config transform. To add a new Web.config transformation right-click on the Web.config file and from the menu select Add Config Transforms. Notice that a new configuration file matching your new configuration is automatically added
After following these steps I was able to create a new target profile in the Azure publishing wizard and select these configurations. This lets you automate your web.config settings using transforms and have your own custom cloud service configuration per publishing profile.
Here is another excellent reference that goes into much more detail then I was able to for this question.

TFS Team Build 2010 - queue build as a named user

After much messing around I've got CI implemented onto our test server. A custom workflow template builds and deploys 2 web apps (different servers), a database and a windows service. This is brill and takes all the worry out of deploying a test app.
I want to move this over to staging and live (queued manually), but doing it like this the TFS service account would need permissions on IIS for the web apps, DBOwner on the database and local admin on the service box. This is a big no-no for our tech guys!
What we could do is just give these permissions before we run the build and remove afterwards, but this means maintaining a list of what permissions to change where - ruining the convenience of one-click deployment a bit.
Ideally we'd just get the build to run using the account of the tech services guy whos got admin network-wide, is there a way to do that?
Yes you can do that via the TFS Administrator Console.
If you haven't configured your build machine, then you can choose the user during the configuration phase. You should see a Configuration Wizard page that allows you to choose a user account like this:
If your build machine is already configured, go to your build machine, then run %PROGRAMFILES%\Microsoft Team Foundation Server 2010\Tools\TfsMgmt.exe, then go to "Build Configuration", click at "Properties" link of the Build Service to open the Properties dialog, then click "stop to make changes" on the dialog, and you can change the account from the built-in account to a user one:

Resources