Azure ASP.NET deploy error - asp.net-mvc

I have a strange issue, when I deploy asp.net mvc app to azure service this error appears:
I have tried to clean my project, create new resource group, new app service plan and nothing helps. In fact, I don't know why this problem appears , I am doing the same actions as I was doing before, when successfully published my apps.
I am deploying my application from visual studio, I was trying to create web app from azure portal but I don't know how to connect my db to this app (I am using entity framework + code first and simple link to my db (in "link resources" tab of my web application settings) doesn't work.
Does some1 faced this problem before? I will be glad for any help.
P.S. Start page of web app works, but I can't connect to db.

Did you use the portal from manage.windowsazure.com or the new one which is portal.azure.com? I would suggest you to create everything (including app service plan, resource group, web app, etc) using the new azure portal because I found some reference that stated those two portal use different API so that's maybe why there are some problem if you use both portal at the same time (I don't know why they use different API). Maybe you can try to recreate everything but using the new portal consistently and let me know the result :)

Based on the error message, the root cause of your deployment issue is due to invalid Api version parameter for the resource group: "Default-SQL-NorthEurope".
The api-version you have specified for the above resource group deployment template is 2.0, which is invalid.
The valid api-version format must be: yyyy-MM-dd
The supported suffixes: "-preview,-alpha,-beta,-rc,-privatepreview"
From the name of your resource group, it should contain Azure Sql database server and database resources.
You should use api-version: 2014-04-01-preview for the resource group above.
Below is the reference for the resource group deployment template for Azure web app and SQL database:
Azure Quickstart template: 201-web-app-sql-database
Hope this helps!

Related

publish does not show resource groups

I am trying to publish a project to azure. I want to re-use a web app. But I don't see the parent Resource group eve. Any ideas? Here is a picture:
missing rg
That can be for different reason. but that happen to me was that the Azure web app resources that I created in AZURE was configured with a different NET framework that the application that I was trying to publish. In this case don't see the Web App and also not resource group.
Go to Azure portal and take a look to your WEB APP framework configuration at:
Change it to your use net framework if it is different.

How to publish to azure

I have an mvc application thats built using the repository pattern. My Database resides in the SmokersTavern.Data folder. I have published the site to azure. On startup the user must logon thereof will be redirected to the Products table. However I get the following error.
It is not allowed to connect to local database when your web app has been published to Azure.
You should create an Azure sql database and connect to it instead. Here's the tutorial for you to refer.
You need to create an Azure resource group deployment project with your Visual Studio web application so that Visual Studio knows where to publish your code. Please take a look at this:
Creating and deploying Azure resource groups through Visual Studio
Although, you are using the 'Publish to Azure' feature, I don't see the resource group configuration in the Solution Explorer pane on the right (based upon the screen capture you provided).
Following this document will walk you through the set-up, configuration, and publishing of your web application to Azure.
I created the app service + sql and in my visual studio I connected to app service created on Azure. My connection string in my config file was not that of the Azure sql db

404 error on azure for Asp.Net Web Api Project

I have deployed exact same solution on two servers, one is my own server in my basement and the other one is Microsoft Azure. The project is developed using Asp.Net Web Api 2.
On my own windows server running IIS 8.5 it totally works. For test, you can simply browse this link in your browser and see the error message {"Message":"The requested resource does not support http method 'GET'."} which shows the API has been hit.1
But exact same project on my Azure domain here, you just get a message saying
The resource you are looking for has been removed, had its name
changed, or is temporarily unavailable.
Everything about these two deployments is the same (to the best of my knowledge) and I was wondering if there is any further steps necessary on Web Api app deployment in MS Azure which I am missing.
I finally found the answer to this issue. If there are multiple apps deployed as one single website so each app is located in its own subfolder, you have to go to the configuration section of your web app on Azure and create virtual directories for each of those sub folders.
Ah, my problem was probably a common one. I was using
rootconfig = System.Web.Configuration.WebconfigurationManager.OpenWebConfiguration(null);
and that was returning the root web because the parameter was null.
When I ran it local that worked fine, but after I deployed the root Config was NOT what I wanted and my code was failing.
Switched to direct access via
stringVal = WebconfigurationManager.AppSettings["Foobar"].ToString();
Nice. Plus less overhead.

ASP.NET MVC Windows Azure organization authentication

I'm trying to configure the organization authentication in an ASP.NET MVC project in Visual Studio 2013 RC.
After filling the data in the create project dialog, like Microsoft instructed in their tutorials, I'm getting an error which says that the configure failed.
I've tried to do so as well in Visual Studio 2012 using the identity addon.
Maybe it's related to Windows Azure AD?
Here is the error that I'm getting:
Hopes that someone knows how to fix that issue. Thanks for any help and suggestion!
This question is old, but today I found a workaround that I'd like to share.
It seems like we can't use Microsoft Account when we're using WAAD.
So:
Create a WAAD.
Add an administrator
Choose local directory account, not Microsoft Account.
Grant this account Global Administrator permissions.
Open Visual Studio and create a new web based project.
Choose in authentication the "Organization Accounts".
Specify your WAAD URL (e.g. "foo#onmicrosoft.com").
When you're required to insert your user and password, use the local account username and password. for example ("oz#foo.onmicrosoft.com").
This will allow you to pass the error.
Edit:
Microsoft published a post that referred to this problem and show the solution (the one I described above). http://www.cloudidentity.com/blog/2013/12/11/setting-up-an-asp-net-project-with-organizational-authentication-requires-an-organizational-account/
I would check for two things:
The account used to login to Windows Azure while has Global Admin role in AAD
App ID URI specified in the project creation dialog is valid. Valid App ID URI for domain mydomain.onmicrosoft.com has format https://mydomain.onmicrosoft.com/uniqueUri. Note that you can leave this field blank and the tool will automatically pick the correct App ID URI for you.
If these two things don't help, I would encourage you to run DebugView (http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx) in the background while trying to create a similar project and you can see the actual error message in the trace in DebugView.
In follow up to OzB:
Once you've setup the user in AAD as per OzB's account,
note that you must also then go to "Settings" in Azure and add that account as an administrator of the Azure subscription, otherwise you can't upload the website itself.

Umbraco 6 on Azure: UmbracoModule Service Unavailable

I'm deploying a new Umbraco 6 installation to Azure, and I've run into a problem I can't seem to diagnose.
Here are the steps I took to get the site deployed:
Created new MVC 4 project in VS2012
Installed UmbracoCms 6.0.0 via NuGet
Tested locally: SUCCESS
Set up correct connection string for Azure in Web.config (via transform)
Deployed to Azure using Web Deploy
Unfortunately, when I navigated to the Azure instance, I get a blank page with "The service is unavailable." I enabled detailed logging in Azure, and looked at the log files. There wasn't much that suggested a solution to me. This is what the detailed error says:
Module: UmbracoModule
Notification: ResolveRequestCache
Handler: PageHandlerFactory-Integrated-4.0
Error Code: 0x00000000
I'm out of ideas at this point...any ideas?
I've just gone through the steps of what you describe. I created a MVC4 project and downloaded Umbraco 6 via Nuget. What I did notice was that I had to 'include' a fair number of file into the project structure in the VS solution explorer.
I ran the website locally and ran an install just using SQL CE.
I created a website on Azure and I downloaded the .PublishSettings file and imported this into the Web Deploy options in VS. I then published the site 'as is' just to see what happened. I didn't expect the database to work but I just wanted to make sure that the application ran ok and I could at least access the Umbraco login screen.
When I accessed the site, it worked as expected and I could access the login screen at /umbraco/
Given the problems you are having, although this sounds simple, did you 'include' all the files in the solution explorer before deploying?
If you are still having issues, I would doing what I have done and just setting up another very simple site to test your deployment process. I have to be honest, I was surprised how easy it is.
I've just been through the same steps with the simple blog and it was quite hard. I didn't include anything into Visual Studio (except it's 2010 and I downloaded the publish profile) and the site ran fine locally.
On uploading Umbraco 6 to azure I got 'Could not load file or assembly MySql.Data, ' etc. .net error. Of course, it was there.
On repeating my deployment steps, swapping between Visual Studio, Web Matrix and Sql Azure Migration Wizard, checking it was release config on build etc. (not that it should need building) I got various 'The page cannot be displayed because an internal server error has occurred' on a blank white screen, and 'Could not load My.Sql' errors.
Coming back to it the next day, I deployed again, and my user had lost its role membership in the database. I ran the EXEC sp_addrolemembers again, and lo, the site now works. I wish I could be more specific on what went wrong and what got fixed, but it's all a bit voodoo.
I second what Digby said - make sure all your includes are, well, included and keep on deploying. I think azure is having a bit of a do lately, there was an outage last week on 23rd Feb.

Resources