I recieve error on test environment but it works fine from my local machine

Hi ,
I am implementing Web job hosted on Azure , this web job migrate data from Sql to Elastic

My Elatic URL is = "https://vpc-dev-platform-elasticsearch-bag4d33ftqb3srzritdymf4d5m.eu-west-1.es.amazonaws.com"

and by the way we did not use authentication in this URL

this is my code


var connectionSettings = new ConnectionSettings(new Uri(ConfigurationManager.AppSettings["elasticUrl"]));
 			connectionSettings.DefaultMappingFor<BoardChannelDoc>(s => s.RoutingProperty(p => p.BoardId));



var createIndexRequest = new CreateIndexDescriptor(_indexName)
		   .Aliases(s => s.Alias(createIndexSettings.Alias))
		   .Settings(s => s.Setting(UpdatableIndexSettings.MaxNGramDiff, 3)
		   .NumberOfReplicas(createIndexSettings.NumberOfReplicas)
			   .NumberOfShards(createIndexSettings.NumberOfShards)
			   .RoutingPartitionSize(createIndexSettings?.RoutingPartitionSize)
			   .Analysis(a => a
				   .TokenFilters(d => d.NGram("1_4_Gram", t => t.MaxGram(4).MinGram(1)))
				   .Analyzers(d => d
					   .Custom("lowercase_keyword", t => t.Tokenizer("keyword").Filters("lowercase"))
					   .Custom("1_4_Ngram_lowercase_analyzer",
						   t => t.Tokenizer("standard").Filters("lowercase", "1_4_Gram")))))
		   .Mappings(ma => ma.Map<BoardChannelDoc>(m => m.AutoMap()
			   .Properties(p => p.Text(x => x.Name(n => n.Name).Analyzer("1_4_Ngram_lowercase_analyzer")))
			   .RoutingField(p => p.Required())));

var response = _elasticClient.CreateIndex(createIndexRequest, _indexName);

and the error is

can not create an index because this debug info. Invalid NEST response built from a unsuccessful () low level call on PUT: /boardchannels0_test
# Audit trail of this API call:
 - [1] BadRequest: Node: https://vpc-dev-platform-elasticsearch-bag4d33ftqb3srzritdymf4d5m.eu-west-1.es.amazonaws.com/ Took: 00:00:00.0156247
# OriginalException: Elasticsearch.Net.ElasticsearchClientException: Unable to connect to the remote server. Call: Status code unknown from: PUT /boardchannels0_test ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: An attempt was made to access a socket in a way forbidden by its access permissions 10.111.113.195:443
   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
   at System.Net.HttpWebRequest.GetRequestStream()
   at Elasticsearch.Net.HttpWebRequestConnection.Request[TResponse](RequestData requestData)
   --- End of inner exception stack trace ---
# Request:
<Request stream not captured or already read to completion by serializer. Set DisableDirectStreaming() on ConnectionSettings to force it to be set on the response.>

i tried also DisableDirectStreaming() but the same error , any help ?

Welcome!

This service is not supported as it's not official.

Did you look at Cloud by Elastic, also available if needed from AWS Marketplace, Azure Marketplace and Google Cloud Marketplace?

Cloud by elastic is one way to have access to all features, all managed by us. Think about what is there yet like Security, Monitoring, Reporting, SQL, Canvas, Maps UI, Alerting and built-in solutions named Observability, Security, Enterprise Search and what is coming next :slight_smile: ...

What does that mean, which service is not supported ?? and what's not official ? can you explain more

Elasticsearch AWS Service which is now OpenSearch AWS Service is not built and ran by Elastic the company which built 99% of the Elastic Stack.

cloud.elastic.co is fully supported and can run on many cloud providers including AWS.