I have an ASP.MVC 3.0 application. My solution is containing a Linq to SQL project (.dbml). I0ve made the choice to put it in a different project and not in the web application project. I also have another project which connect "mannually" to the database (DAL).
I deploy my application on a webserver, activate the impersonation and the Kerberos delegation. Impersonation for the DAL is working fine, but for an unknown reason the Linq to SQL impersonation is not working. Do I miss something?
Here is the web.config form the web application:
<identity impersonate="true"/>
Here is the app.config from the Linq to SQl project:
<connectionStrings>
<add name="testConnectionString"
connectionString="Data Source=SERVERNAME;Initial Catalog=DBNAME;Integrated Security=True;"
providerName="System.Data.SqlClient" />
</connectionStrings>
Do I miss something in the server configuration, or in the delegation?
Here is the app.config from the Linq to SQl my project:
<connectionStrings>
<add name="DefaultConnection" connectionString=
"server=server name or ip addrress;database=dbname;uid=id;pwd=pass"
providerName="System.Data.SqlClient" />
</connectionStrings>
Related
I am trying to get our existing asp.NET core mvc app to run in an azure app service. Deployment works fine and all files i would expect are on the server.
Sadly, after trying to visit the url I am greeted by the message "You do not have permission to view this directory or page." which is the Statuscode 403.
The Log gives some more insight:
<div id="content"><div class="content-container"><h3>HTTP Error 403.14 - Forbidden</h3><h4>The Web server is configured to not list the contents of this directory.</h4></div><div class="content-container"><fieldset><h4>Most likely causes:</h4><ul> <li>A default document is not configured for the requested URL, and directory browsing is not enabled on the server.</li> </ul></fieldset></div><div class="content-container"><fieldset><h4>Things you can try:</h4><ul> <li>If you do not want to enable directory browsing, ensure that a default document is configured and that the file exists.</li> <li> Enable directory browsing using IIS Manager. <ol> <li>Open IIS Manager.</li> <li>In the Features view, double-click Directory Browsing.</li> <li>On the Directory Browsing page, in the Actions pane, click Enable.</li> </ol> </li> <li>Verify that the configuration/system.webServer/directoryBrowse#enabled attribute is set to true in the site or application configuration file.</li>
It seems like I am supposed to use some sort of landing page like index.html but that is not present for the given mvc Project.
I couldn't find any documentation for this configuration either. Even the youtube videos showcasing how easy it is to host a mvc app don't have to do any further configuration. (for example this one: watch)
I would be happy if anyone could tell me where I went wrong.
Thanks in advance,
Joshua
I have deployed a .NET Core MVC application over Azure App Service via Visual Studio and it worked. So, I notice that on this process, VS creates a web.config file. Once I remove it from App Service via Kudu, the application stopped.
So, the solution is to create a web.config file in the wwwroot folder on App Service environment. The content is like below:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\My.Main.Project.dll"
stdoutLogEnabled="false" stdoutLogFile="\\?\%home%\LogFiles\stdout"
hostingModel="inprocess" />
</system.webServer>
</location>
</configuration>
For the record, the application was created on .NET Core 3.1.
Is there a way to set requestTimeout from C# instead of needing to set requestTimeout in the web.config?
asp.net core 2.0 hosted in IIS
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore requestTimeout="00:00:04" processPath="dotnet" arguments=".\Foo.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
</system.webServer>
</configuration>
Not like this
No, there is no way to do that as you described. But according to the documentation you can just add web.config to your project and specify this (and other) setting value:
If a web.config file isn't present in the project, the file is created
with the correct processPath and arguments to configure the ASP.NET
Core Module and moved to published output.
If a web.config file is present in the project, the file is
transformed with the correct processPath and arguments to configure
the ASP.NET Core Module and moved to published output. The
transformation doesn't modify IIS configuration settings in the file.
The web.config file may provide additional IIS configuration settings
that control active IIS modules. For information on IIS modules that
are capable of processing requests with ASP.NET Core apps, see the IIS
modules topic.
To prevent the Web SDK from transforming the web.config file, use the
IsTransformWebConfigDisabled property in the project file.
I have successfully installed Umbraco on an App Service in Azure by using the following approach:
Visual Studio 2015 -> New empty Web Application
Installed current Umbraco nuget package
Published in a new Web App on Azure -> Works fine.
By default Umbraco uses SQL Server Compact Edition
<add name="umbracoDbDSN" connectionString="Data Source=|DataDirectory|\Umbraco.sdf;Flush Interval=1;" providerName="System.Data.SqlServerCe.4.0" />
To use an Azure DB backend I followed the following approach:
Create new Azure DB in Azure
Used SQL Server Compact & SQLite Toolbox to extract a SQL script from the Umbraco.sdf file
Executed the SQL script in my Azure DB
Changed the connection string in the Web.config
<add name="umbracoDbDSN" connectionString="Data Source=tcp:mysqlserver.database.windows.net,1433;Initial Catalog=umbraco-homepage;User ID=myuser;Password=mypassword;Connect Timeout=30;Encrypt=True;TrustServerCertificate=False" providerName="System.Data.SqlClient" />
Re-deployed the application with Visual Studio to my Azure Web App
When I open my web site Umbraco starts an upgrade and I receive the following error message:
What do I need to do to get Umbraco running with Azure DB? This guide seems to be outdated. The object "umbracoUserLogins" does not seem to exist (it was not necessary for SQL Server CE). How can I fix it?
Edit:
When I customise the Azure SQL connection I always get the error message "Could not connect to database". I tried to follow this guide. I typed in my server data like this:
Anything I forgot? Within the Visual Studio SQL Server Object Explorer I can reach the database.
My database configuration looks like this:
Choose "customize" during the setup and use the details from the connection string to fill in the connection data for SQL Server.
In order to restart the installer, remove the configuration status, set it like:
<add key="umbracoConfigurationStatus" value="" />
And empty out the connection string too:
<add name="umbracoDbDSN" connectionString="" providerName="" />
I tried to implement the SqlMembershipProvider to connect to a database in Azure. I followed this tutorial (Forms-Based Authentication with SQL Azure). But there is a part, when it says replace the following line in your web.config file:
<add name="ApplicationServices"
connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true"
providerName="System.Data.SqlClient" />
The problem that I cannot find it in my web.config (I use Visual Studio 2012 and started a Windows Azure Cloud Service with ASP.NET Web Role)
I did not manage to find under what tag should I put the given code line. Can someone help me out?
I want to be able to use dedicated or co-located caching in my Azure web roles.
The problem is that the application I am migrating uses HttpSessionState extensively. I don't want to change all of this code because:
This is time consuming (especially with testing)
I can't enforce developers from using HttpSessionState
I want to avoid vendor locking as much as possible
Is there no session provider for dedicated and co-located caching so that I can keep existing code as is?
I fixed the problem. To use the ASP.NET Session State in the dedicated or co-located Azure caching, the following session provider needs to be setup in the web.config:
<sessionState mode="Custom" customProvider="AFCacheSessionStateProvider">
<providers>
<add name="AFCacheSessionStateProvider"
type="Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider, Microsoft.Web.DistributedCache"
cacheName="default" dataCacheClientName="default"
applicationName="AFCacheSessionState"
/>
</providers>
</sessionState>