I'm using new ASP.NET 5 and I've faced a problem.
I have ASP.NET MVC 6 application. Source code I keep on BitBucket and Azure is my hosting. I linked BitBucket with Azure such that on every push, deploy is launched.
Everything was working great until I updated KRE version to 1.0.0-beta2 (was 1.0.0-beta1).
Now after auto deploy I'm getting 500 Internal Server Error. But when I publish my application from Visual Studio - it is working without errors.
After investigating files on Azure via FTP I've noticed that when I deploy from Visual Studio my web.config in wwwroot looks like this:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="kpm-package-path" value="..\approot\packages" />
<add key="bootstrapper-version" value="1.0.0-beta2" />
<add key="kre-package-path" value="..\approot\packages" />
<add key="kre-version" value="1.0.0-beta2" />
<add key="kre-clr" value="CLR" />
<add key="kre-app-base" value="..\approot\src\Web" />
</appSettings>
</configuration>
But after auto deploy from BitBucket it looks like:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="kpm-package-path" value="..\approot\packages" />
<add key="bootstrapper-version" value="1.0.0-beta2" />
<add key="kre-package-path" value="..\approot\packages" />
<add key="kre-version" value="1.0.0-beta1" />
<add key="kre-clr" value="CLR" />
<add key="kre-app-base" value="..\approot\src\Web" />
</appSettings>
</configuration>
kre-version key is different.
Why is it putting beta1 there? Is there any way to specify kre-version explicitly?
Looks the same as Deploying ASP.NET vNext beta 2 on Azure with Kudu. Can you try the workaround mentioned there, which is to set a couple app settings (in the Azure portal for the site):
SCM_KRE_Version=1.0.0-beta2
SCM_KRE_CLR=CoreCLR
Related
I am publishing a website app to an Azure App Service. I've created a QA configuration profile and added a matching Web.QA.config file. Here's the entire contents (with some redacted) of that file:
<?xml version="1.0"?>
<!-- For more information on using app.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
<!-- In case configuration is not the root element, replace it with root element in source configuration file -->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<appSettings>
<add key="ida:ClientId" value="9a...54e" xdt:Transform="SetAttributes" xdt:Locator="Match(value)" />
<add key="ida:ClientSecret" value="vuW...z3kY=" xdt:Transform="SetAttributes" xdt:Locator="Match(value)" />
<add key="ida:PostLogoutRedirectUri" value="https://....azurewebsites.net/" xdt:Transform="SetAttributes" xdt:Locator="Match(value)" />
</appSettings>
</configuration>
When I publish the site to the Azure App Service using the QA profile, these values are not being transformed.
What am I doing wrong?
You're matching on value instead of key.
Use xdt:Locator="Match(key)"
I'm setting up a new app on a server on my work and when I access to the ip address on the explorer shows the default app
Default app
but when I try to access to the app that i created shows this error
My app
This is my web.config file
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<system.webServer>
<defaultDocument>
<files>
<clear />
<add value="Default.aspx" />
</files>
</defaultDocument>
</system.webServer>
<system.web>
<compilation targetFramework="4.5.2" />
<httpRuntime targetFramework="4.5.2" />
<pages>
<controls>
<add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" />
</controls>
</pages>
</system.web>
<appSettings>
<add key="ValidationSettings:UnobtrusiveValidationMode" value="None" />
</appSettings>
</configuration>
This are my files
Files of application
I tried a lot of solutions, like permitions on folders on the IIS manager, enabling anonymous access, modifying web.config file, modifying the AutoEventWireup="true|false " etc but all of them leads me to the same error, can it be a compilation error? I am publishing via file system and pasted it on the wwwroot directory
Also I am using master pages except for the first page (the login)
With the configuration you are showing you most likely need to configure a virtual directory in IIS for your application to run in.
I solved my problem (not sure what I did diferent than before but its working now)
Instead of adding another website I added an application on the default website
and that solved the problem
Thanks a lot
I am using Amazon Web Services S3 SDK for .NET to be able to upload images to my S3 bucket. The project works great on localhost, but when I publish to my production environment I receive this error:
Unable to find credentials<br><br>Exception 1 of 4:<br>
System.InvalidOperationException: The app.config/web.config files for
the application did not contain credential information
2 of 4 Amazon.Runtime.AmazonClientException: Unable to find the 'default' profile in CredentialProfileStoreChain.
3 of 4 The environment variables AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY/AWS_SESSION_TOKEN were not set with AWS credentials.
4 of 4 Unable to reach credentials server
Which of course leads me to believe that this is a problem in my web.config <appsettings> section which I have set up like this:
<appSettings file="..\..\AppSettingsSecrets.config">
<add key="webpages:Version" value="3.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings>
I have my secret keys set up in the AppSettingsSecrets.config file like this:
<appSettings>
<add key="AWSProfileName" value="MYPROFILENAME"/>
<add key="AWSAccessKey" value="MYACCESSKEY"/>
<add key="AWSSecretKey" value="MYSECRETKEY"/>
</appSettings>
But since it works in my test environment, I'm confused as to why my production environment cannot use these keys. What other code do you need to see to solve this? Am I on the right track?
Saw this guy had the same problem but his was a bug in an older version of the SDK (his solution was to wait for update), so not helpful I dont think: AmazonServiceException: Unable to find credentials
Issue: Bot started showing me an error, when using the emulator. While i am not sure, i think the emulator might have been updated
Debugging I checked that the AppID and secret are correct.
Error:
-> POST 401 [conversationUpdate]
Error: The bot's MSA appId or password is incorrect.
Edit your bot's MSA info
web.config Info:
<!-- update these with your appid and one of your appsecret keys-->
<add key="MicrosoftAppID" value="XXXXXXXXXXXXXX" />
<add key="MicrosoftAppPassword" value="YYYYYYYYYY" />
<!--Azure Credentials (V1 Authentication Mode) -->
<add key="ActiveDirectory.Mode" value="v1" />
<add key="ActiveDirectory.ResourceId" value="https://graph.windows.net/" />
<add key="ActiveDirectory.EndpointUrl" value="https://login.microsoftonline.com" />
<add key="ActiveDirectory.Tenant" value="ZZZZZZZ" />
<add key="ActiveDirectory.ClientId" value="aaa" />
<add key="ActiveDirectory.ClientSecret" value="bbb" />
<add key="ActiveDirectory.RedirectUrl" value="http://localhost:25601/api/OAuthCallback" />
Keep the Microsoft APP ID and Microsoft App Password values empty both in web.config file and the emulator when debugging locally.
and in the web.config:
<configuration>
<appSettings>
<!-- update these with your BotId, Microsoft App Id and your Microsoft App Password-->
<add key="BotId" value="YourBotId" />
<add key="MicrosoftAppId" value="" />
<add key="MicrosoftAppPassword" value="" />
</appSettings>
Create an empty project with Bot template(or use existing bot project) and update the bot builder version from Visual studio NuGet package to latest version. Try to test it with latest bot emulator
(https://docs.botframework.com/en-us/tools/bot-framework-emulator/) it should work
Trying to get simple <appSettings> for dev vs. prod.
My Web.config:
<appSettings>
<add key="hello" value="debug" />
</appSettings>
My Web.Release.config:
<appSettings>
<add key="hello" value="prod" />
</appSettings>
(both under <configuration>)
When I have it in Debug mode, and run my MVC site, I can do a simple return Content(WebConfigurationManager.AppSettings["hello"]); in my HomeController.Index and it returns dev. If I switch the mode to Release it still returns dev. I'd like to simulate prod mode without actually publishing to prod.
In the build-specific Web.config file, you have to tell it how to transform the base .config file. So to do what you ask, your Web.Release.config file should look like this:
<appSettings>
<add key="hello" value="prod" xdt:Transform="SetAttributes" xdt:Locator="Match(key)" />
</appSettings>
In the above code the SetAttributes transform will change the attributes of any element that matches the key attribute containing the value hello.
Starting from .NET 4.7.1 feature called Configuration builder is supported which gives developer ability to load configuration not only from Web.Release.Cong but basically from any source. Read more about .NET Framework 4.7.1 ASP.NET and Configuration features