# Deloy on AKS Elastic stack

**URL:** <https://discuss.elastic.co/t/deloy-on-aks-elastic-stack/306731>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [June 8, 2022, 5:40pm UTC](https://discuss.elastic.co/t/deloy-on-aks-elastic-stack/306731 "2022-06-08T17:40:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vladimir\_petukhov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vladimir_petukhov/32/106796_2.png) [@vladimir\_petukhov](https://discuss.elastic.co/u/vladimir_petukhov)\
**Post date:** [June 8, 2022, 5:40pm UTC](https://discuss.elastic.co/t/deloy-on-aks-elastic-stack/306731/1 "2022-06-08T17:40:13Z")

</div>

I tried to deploy on Azure Kubernetes Elastic stack following this example [ELASTIC.IO](https://www.elastic.co/blog/how-to-run-elastic-cloud-on-kubernetes-from-azure-kubernetes-service).I want to get logs from mine.Net6 WebApi.For logger I use Serilog. I was made docker-compose to run the elastic stack on the local docker container to test on the development environment and everything works fine. The problem comes with AKS deployment, I see that on Kubernetes all servers are working. I have access to elastic port 9200 with curl but in production returns me empty reply from server  
, and to the Kibana dashboard, but for some reason when I start the app from my PC with production settings to point elastic deployed on AKS I can't create any index or see any changed data.

```auto
{
      "ApplicationName": "identity-service",
      "Serilog": {
        "MinimiumLevel": {
          "Default": "Information",
          "Ovveride": {
            "Microsoft": "Information",
            "System": "Warning"
          }
        }
      },
      "ElasticConfiguration": {
        "URI": "https://elasic-cloud-ip:9200"
      }
    }

```

And this is the configuration that works in the development environment.

```auto
var env = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");
            builder.Host.UseSerilog((context, configuration) =>
            {
               Console.Out.WriteLine($"{Assembly.GetExecutingAssembly().GetName().Name.ToLower()}-{env.ToLower().Replace(".", "-")}-{DateTime.UtcNow:yyyy-MM}");
                configuration.Enrich.FromLogContext()
                .Enrich.WithMachineName()
                .WriteTo.Console()
                .WriteTo.Elasticsearch(
                    new ElasticsearchSinkOptions(new Uri(context.Configuration["ElasticConfiguration:URI"]))
                    {
                        IndexFormat = $"{context.Configuration["ApplicationName"].ToLower()}-{env.ToLower().Replace(".", "-")}-{DateTime.UtcNow:yyyy-MM}",
                        AutoRegisterTemplate = true,
                        NumberOfShards = 1,
                        NumberOfReplicas = 2
                    })
                .Enrich.WithProperty("Environment", context?.HostingEnvironment?.EnvironmentName?.ToLowerInvariant())
                .ReadFrom.Configuration(context.Configuration);
            });

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2022, 5:40pm UTC](https://discuss.elastic.co/t/deloy-on-aks-elastic-stack/306731/2 "2022-07-06T17:40:55Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
