I have Create an Application in MVC which is currently using AWS Data Server.For it I am using Amazon Simple DB API . My Database Created by the client is allocated at US-EAST-1 but by the code it's accessing the Database US-WEST-2.
If I am Creating the Database or Table Pro grammatically by the code like-
simpleDBClient.CreateDomain(new CreateDomainRequest() { DomainName = "DemoTable"});
it also stores in US-WEST-2 Region.Please let me know how come i retrive the AWS US-EAST-1 Tables.
and in the starting I have also choosed the US-EAST-1 at the time of Creation of Project in Visual Studio. Any Help will be Appreciated.
Check out this blog post from the .NET team on using regions and the .NET SDK. In essence,if you are using V2 of the SDK you can modify you app.config or web.config to look like this:
<configuration>
<appSettings>
<add key="AWSRegion" value="us-east-1"/>
</appSettings>
</configuration>
Related
I am currently trying to activate Azure blob storage for my Web app (I am running NopCommerce 3.70).
I created the storage account on Azure and updated the values of AzureBlobStorage in the Web.config, however nothing seems to happen. The container of the blob is still empty and all thumbs are still being saved under ~/Content/Images/Thumbs.
My config is the following:
<NopConfig>
<AzureBlobStorage ConnectionString="DefaultEndpointsProtocol=https;AccountName=myaccountname;AccountKey=myaccountkey;EndpointSuffix=core.windows.net" ContainerName="images" EndPoint="https://myaccountname.blob.core.windows.net/images" />
</NopConfig>
which is equivalent for Nopcommerce than writing this I reckon:
<appSettings>
<add key="StorageConnectionString" value="DefaultEndpointsProtocol=https;AccountName=myaccountname;AccountKey=myccountkey;EndpointSuffix=core.windows.net" ContainerName="images" EndPoint="https://myaccountname.blob.core.windows.net/images" />
</appSettings>
Is there anything else to do that I missed?
I'm running a demo site with nopCommerce 3.9 just fine. My config looks similar except the end point part.
Try using this (remove images at the end of endpoint)
<NopConfig>
<AzureBlobStorage ConnectionString="DefaultEndpointsProtocol=https;AccountName=myaccountname;AccountKey=myaccountkey;EndpointSuffix=core.windows.net" ContainerName="images" EndPoint="https://myaccountname.blob.core.windows.net/" />
</NopConfig>
I've just found an obscure, yet deeply frustrating, bug with CloudConfigurationManager. I'm looking for workarounds, and also (as a side note) tips about the best forum in which to report the bug. I'm guessing it will be a relatively quick fix.
I've got an Azure app service that connects to DocumentDb with config settings called DocumentDB.Endpoint and DocumentDB.Key. These are picked up in F# with
let endpoint = config.ReadConfigSetting<string>("DocumentDB.Endpoint")
let key = config.ReadConfigSetting<string>("DocumentDB.Key")
The ReadConfigSetting method is a convenience method that performs the relevant type conversions and default assignments. Under the covers it uses CloudConfigurationManager.GetSetting. For our purposes, think of the call as
let endpoint = CloudConfigurationManager.GetSetting("DocumentDB.Endpoint")
let key = CloudConfigurationManager.GetSetting("DocumentDB.Key")
I have a webjob that performs cron jobs on my document DB collections. CloudConfigurationManager picks up the setting from the app service settings first, and if the key is not found in the app service settings, it will look at my webjob's app.config.
In my QA environment, my webjob is picking the correct endpoint, but the wrong key. This is because DocumentDb.Endpoint is listed directly in my app.config file, but DocumentDb.Key is in a separate file that is .gitignored. I don't want sensitive keys in the Git repo, even though it is private, and the credentials are only listed in app.config and my external file as a convenience that lets me run the job locally with a debugger.
So here is my setup:
App.config
<appSettings file="keys.config">
<add key="agentUserName" value="<Everyone can read this>" />
<add key="apiHost" value="<and this>" />
<add key="DocumentDB.Endpoint" value="<points to my remote develpment copy of DocumentDB -- looking forward to when I can get a local repo>" />
</appSettings>
keys.config
<appSettings>
<add key="DocumentDB.Key" value="<This is private, so it's in this gitignored file>" />
<add key="agentPassword" value="<I'm not telling you>" />
<add key="TestUserPassword" value="<I'd be an idiot to post this value in a SO question>" />
</appSettings>
You can see what's happening.
Expected behaviour of CloudConfigurationManager when looking up the value of DocumentDB.Key
Look at the underlying app serice settings for a value of DocumentDB.Key
If it exists, use that.
Otherwise, look in App.config.
If it's not there, look in keys.config.
Actual behaviour of CloudConfigurationManager
Is there a value in keys.config?
If so, use that value.
Then look at the app service settings
Then App.config.
The best workaround I have right now is to comment out the value in keys.config when I publish the web job, but that's clunky. Are there any better ways of doing this?
And where is the best place to log this issue?
Have you looked into Azure Key Vault? Here is an intro to Azure Key Vault: https://azure.microsoft.com/en-us/documentation/articles/key-vault-get-started/
If you store DocumentDB secrets in the Azure Key Vault, you can grant the access to the secrets to the application level. Here is another article that shows how to do it inside a web application: https://azure.microsoft.com/en-us/documentation/articles/key-vault-use-from-web-application/
Hope that helps.
Thanks.
Lengning
I have tried a lot, but not able to find a perfect solution for same.
I am wokring on a WPF Desktop application,
Username, Database name ,server name and password.. those information user entered for successful access/login into the system. I want to store those information in some memory and reuse it after session/application end.
like in gmail.com, we don't need to enter our email id to access it. (It by default available, if we used earlier).
Most relevant solution - http://www.dotnetfunda.com/articles/show/955/using-isolatedstoragefile-to-store-data-in-wpf-application-class-event
I have tried to use list to store data and access, but not able to do it.
Many thanks in advance. (this is my first time to ask any question online)
Application Settings - cannot be changed during the running of a program
I assume that you are not allowing user to change values like Database name and server name which is normally stored in application setting which has a great documentation at here .
Storing of Connection String
Connection String are always stored at the config file of your project which looks like:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
</configSections>
<connectionStrings>
<add name="ApplicationDbConnectionString"
connectionString="Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\DATABASE\Trackboard.mdf;Integrated Security=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
</configuration>
and can be access by the following code:
private static string ConnStr = ConfigurationManager.ConnectionStrings["ApplicationDbConnectionString"].ConnectionString;
User Settings - settings can be changed during running of a program
For settings like user name and password I would recommend you to store it at User settings which also has a great documentation at msdn(simpler but not very complete) and code Project(Very complete but takes time to go through).
Hope this helps!
I am using ManagedWifi API to write an application
the example in http://managedwifi.codeplex.com/SourceControl/changeset/view/41381#213980 gives us a view of how to connect to a SSID with WEP security .
I would like to have to some pointers as to what would need to change if we need to connect to a known SSID "without" WEP security ..
The fact that that example uses WEP is because the used profile uses WEP.
A WLANProfile should follow the schema explained here. A number of sample WLANProfiles can be found here.
A WLANProfile for an open network should look more or less like this (can't test it right now)
<?xml version="1.0"?>
<WLANProfile xmlns="http://www.microsoft.com/networking/WLAN/profile/v1">
<name>{0}</name>
<SSIDConfig>
<SSID>
<name>{0}</name>
</SSID>
<nonBroadcast>false</nonBroadcast>
</SSIDConfig>
<connectionType>ESS</connectionType>
<connectionMode>manual</connectionMode>
<MSM>
<security>
<authEncryption>
<authentication>open</authentication>
<encryption>none</encryption>
<useOneX>false</useOneX>
</authEncryption>
</security>
</MSM>
</WLANProfile>
With {0} being the SSID you want to connect with
I have a ASP .NET load balanced application (webservice and website). It runs on SQL server. I need to be able to provide large files for download. However, because of the load balancing situation, the files are stored in the SQL database as opposed to the file system. BITS seems to be the best approach. I have full control of the client. However, i don't know how to configure BITS to read the file from the database. I know how to write the C# code for that, but i don't know how to get BITS to hook into it as opposed to reading the file from the file system.
Any ideas?
You can create a custom http handler by implementing System.Web.IHttpHandler. The ProcessRequest(HttpContext context) method is where you will write your file retrieval code from the database. Since BITS operates with range requests you will need to parse the value of context.Request.Headers["Range"] to get the start and end bytes requested. In the ProcessRequest you can read the binary from the database using the SqlCommand.ExecuteReader(CommandBehavior.SequentialAccess) method and set the resulting binary in context.Response.OutputStream. Remember to call context.Response.Flush() at the end.
The custom HttpHandler will serve a particular file extension (e.g. '.file'). This is what needs to be done in IIS:
Both IIS Versions
Add to section in in web.config:
IIS 6.0
Add .file (application/x-zip-compressed) extension as MIME type for the website.
Add Application Extension (Website Properties Virtual Directory Configuration Mappings)
Extension: .file
Executable Path(s): %windir%\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll
%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll
IIS 7.0
Add to section in in web.config:
Add to section in in web.config:
<mimeMap fileExtension=".file" mimeType="application/x-zip-compressed" />
Hope that's enough to get you started.
Have a look at 2008 Books Online OpenSqlFilestream. That API has examples that may help you.