I am using Azure Document Db version 2.6 and I am unable to connect to Cosmos Db emulator. I am trying to connect to https://localhost:8081. I am getting below error after it executes this line:
// Open the connection
documentClient.OpenAsync().GetAwaiter().GetResult();
WebException: The remote name could not be resolved:
'localhost-eastus2euap'
I am not sure how it's connecting to this url "localhost-eastus2euap" when I am trying to connect to localhost:8081
It looks like you are adding regions to the ConnectionPolicy PreferredLocations, is that correct?
When working with the emulator, adding regions is not supported, there are no regions as it is running in an isolated environment.
If this is code that hits the emulator or a live account, some configuration might be added to know when to add the regions and when not to.
Related
I created an azure Snowflake trial account and an odbc dsn, it works.
Then I had to create a Snowflake trial in AWS to use the Snowflake training.
When creating a DSN it fails with this error; Incorrect username or password was specified.
For Azure, I use ..snowflakecomputing.com, this works.
For AWS I use .snowflakecomputing.com, I get the user error.
I tried other combinations but hten I always get a host unresolved error.
..snowflakecomputing.com
.sg..aws.snowflakecomputing.com
Thanks for hints
As per https://docs.snowflake.com/en/user-guide/organizations-connect.html your Snowflake URL / servername is in this format
https://<account_locator>.<region>.<cloud>.snowflakecomputing.com
The cloud is not needed if using AWS, but is if using Azure or GCP. The region is not needed if us-east1 but otherwise must be specified.
Now, it doesn't matter where you are trying to connect to Snowflake from - it only matters where your Snowflake instance is.
So, if you made your Snowflake instances in AWS it is the exact same URL / server name whether you connect to it via the web console, a command-line tool, ODBC from an AWS application, JDBC from an Azure application, or anything else.
Thus, if you made the Snowflake account in AWS you will use something like
https://FV23210.ap-southeast2.snowflakecomputing.com
no matter where you call it from; if you made the Snowflake account in Azure you will use something like
https://FV23210.ap-southeast2.azure.snowflakecomputing.com
no matter where you call it from.
Trying to follow doc at secure your experiments but after configuring default workspace storage for VNET access, attempts to create integrated notebook VM fails with what looks like a storage access error.
Create Failed:
Failed to clone samples. Error details: Microsoft.WindowsAzure.Storage This request is not authorized to perform this operation.
thanks,
jim
We are working on adding virtual network support to NotebookVM.
Thanks
I've run into problems trying to run the Azure Storage Emulator on a newly installed computer.
At first it was returning
Cannot create database 'AzureStorageEmulatorDb56' : The database 'AzureStorageEmulatorDb56' does not exist. Supply a valid database name. To see available databases, use sys.databases..
However, when I ran sqllocaldb i I could see that there was a DB named 'AzureStorageEmulatorDb56'.
I eventually ran the command
AzureStorageEmulator init -server localhost -forcecreate
which returned
Granting database access to user AzureAD\[username elided].
Database access for user AzureAD\[username elided] was granted.
Initialization successful. The storage emulator is now ready for use.
The storage emulator was successfully initialized and is ready to use.
which looks promising.
However, when I right-click the emulator's icon in the system try and select "Start Storage Emulator" nothing happens. And if I then look in the log files I can see an error log (Error20-Jul-18-11-07.log) which contains...
7/20/2018 11:06:36 AM [Error] [ActivityId=00000000-0000-0000-0000-000000000000] Input string was not in a correct format.
There's also an Info20-Jul-18-11-07.log file which contains
7/20/2018 11:06:36 AM [Info] [ActivityId=00000000-0000-0000-0000-000000000000] Starting Service: Blob
7/20/2018 11:06:36 AM [Info] [ActivityId=00000000-0000-0000-0000-000000000000] Stopping Service: Blob
Can anyone explain what's going wrong and how I can get the local storage emulator up and running?
Try to disable logging, there seems to be a bug in the 5.5 release:
https://github.com/Azure/azure-storage-net/issues/728
I am trying to connect my Meteor application to Atlas MongoDB,
I am setting MONGO_URL and MONGO_OPLOG_URL as follows:
MONGO_URL="mongodb://username:password#host:27017,host:27017,host:27017/databasename?ssl=true&replicaSet=melee-shard-0&authSource=admin"
MONGO_OPLOG_URL="mongodb://username:password#host:27017,host:27017,host:27017/local?ssl=true&replicaSet=melee-shard-0&authSource=admin"
But, I am getting error while starting the Meteor app:
Error: Could not locate any valid servers in initial seed list
What am I doing wrong?
I have a asp.net application deployed to Azure websites connecting to Azure SQL Database. This has been working fine for the last year, but last weekend I have started getting errors connecting to the database giving the following stacktrace.
[Win32Exception (0x80004005): Access is denied]
[SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)]
This error comes and goes staying a few hours and then goes away for a few hours. The database is always accessible from my machine.
A few things that I have tried are:
Adding a "allow all" firewall rule (0.0.0.0-255.255.255.255) has no effect
Changing the connection string to use the database owner as credential has no effect.
what does have effect is to change the azure hosting level to something else. This resolves the issue temporarily and the website can access the database for a few hours more.
What could have have happened for this error to start showing up? The application hasn't been changed since August.
EDIT:
Azure support found that there was socket and port exhaustion on the instance. What the root cause for that is, is still unkown.
Craig is correct in that you need to implement SQLAzure Transient Fault Handling. You can find instructions here: https://msdn.microsoft.com/en-us/library/hh680899(v=pandp.50).aspx
From the article
You can instantiate a PolicyRetry object and wrap the calls that you
make to SQL Azure using the ExecuteAction method using the methods
show in the previous topics. However, the block also includes direct
support for working with SQL Azure through the ReliableSqlConnection
class.
The following code snippet shows an example of how to open a reliable
connection to SQL Azure.
using Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling;
using Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling.AzureStorage;
using Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling.SqlAzure;
...
// Get an instance of the RetryManager class.
var retryManager = EnterpriseLibraryContainer.Current.GetInstance<RetryManager>();
// Create a retry policy that uses a default retry strategy from the
// configuration.
var retryPolicy = retryManager.GetDefaultSqlConnectionRetryPolicy();
using (ReliableSqlConnection conn =
new ReliableSqlConnection(connString, retryPolicy))
{
// Attempt to open a connection using the retry policy specified
// when the constructor is invoked.
conn.Open();
// ... execute SQL queries against this connection ...
}
The following code snippet shows an example of how to execute a SQL command with retries.
using Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling;
using Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling.AzureStorage;
using Microsoft.Practices.EnterpriseLibrary.WindowsAzure.TransientFaultHandling.SqlAzure;
using System.Data;
...
using (ReliableSqlConnection conn = new ReliableSqlConnection(connString, retryPolicy))
{
conn.Open();
IDbCommand selectCommand = conn.CreateCommand();
selectCommand.CommandText =
"UPDATE Application SET [DateUpdated] = getdate()";
// Execute the above query using a retry-aware ExecuteCommand method which
// will automatically retry if the query has failed (or connection was
// dropped).
int recordsAffected = conn.ExecuteCommand(selectCommand, retryPolicy);
}
The answer from Azure support indicated that the connection issues I was experiencing was due to port/socket exhaustion. This was probably caused by another website on the same hosting plan.
Some answers to why the symptoms were removed by changing hosting service level:
Changing the hosting plan helped for a while since this moved the virtual machine and closed all sockets.
Changing the hosting plan from level B to level S helped since azure limits the number of sockets on level B.