I developed a website using Asp.Net MVC and Edmx database and I published this website on azure and my database is also on azure and I've a functionality on website that uploads excel record into database and that excel sheet contain almost 18000 records every time I upload that sheet it throw Timeout error after some time so what should I do.

[![enter image description here](https://i.stack.imgur.com/n32VE.png)](https://i.stack.imgur.com/n32VE.png)

Initially I was not using any command Timeout but after doing some research I'm using this in constructor 

```
 public ProfessionalServicesEntities()
        : base("name=ProfessionalServicesEntities")
    {
        this.Database.CommandTimeout = 10000;
        //this.Database.CommandTimeout = 0; //I tried this too.

        //((IObjectContextAdapter)this).ObjectContext.CommandTimeout = 3600;
    }

```

Here is the code of
function :-

```
 public void SaveEquipments(IEnumerable<EquipSampleEntity> collection)
    {
        using (ProfessionalServicesEntities db = new ProfessionalServicesEntities())
        {
            string modelXml = XmlSerialization.ListToXml(collection.Where(x=>x.Type == Model).ToList());
            string accessoryXml = XmlSerialization.ListToXml(collection.Where(x => x.Type == Accessory).ToList());
            db.ImportEquipmentFile(modelXml, accessoryXml);
        }
    }

```

here is context file code for SP:-

```
 public virtual int ImportEquipmentFile(string modelXml, string accessoryXml)
    {
        var modelXmlParameter = modelXml != null ?
            new ObjectParameter("ModelXml", modelXml) :
            new ObjectParameter("ModelXml", typeof(string));

        var accessoryXmlParameter = accessoryXml != null ?
            new ObjectParameter("AccessoryXml", accessoryXml) :
            new ObjectParameter("AccessoryXml", typeof(string));

        return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("ImportEquipmentFile", modelXmlParameter, accessoryXmlParameter);
    }

```
['https://Stackoverflow.com/questions/45320053', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4207036/']
I actually Solved my problem. I did everything correct. But only thing I did not do is to map the hostname with the same ip in Route53. And instead of accessing the website with hostname, I was accessing it from IP. Now after accessing the website from hostname, I was able to access it :)
Had the same issue, found a way to resolve it:

you just need to add the "**--watch-namespace**" argument to the ingress controller that sits under the ingress service that you've linked to your ingress resource. Then it will be bound only to the services within the same namespace as the ingress service and its pods belong to.

```
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
namespace:  my-namespace
name: nginx-ingress-controller
spec: 
  replicas: 1
selector:
  matchLabels:
    name: nginx-ingress-lb
template: 
  metadata: 
    labels: 
      name: nginx-ingress-lb
  spec:
    serviceAccountName: ingress-account
    containers: 
      - args: 
          - /nginx-ingress-controller
          - "--default-backend-service=$(POD_NAMESPACE)/default-http-backend"
          - "--default-ssl-certificate=$(POD_NAMESPACE)/secret-tls"
          - "--watch-namespace=$(POD_NAMESPACE)"
        env: 
          - name: POD_NAME
            valueFrom: 
              fieldRef: 
                fieldPath: metadata.name
          - name: POD_NAMESPACE
            valueFrom: 
              fieldRef: 
                fieldPath: metadata.namespace
        name: nginx-ingress-controller
        image: "quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.24.1"
        livenessProbe: 
          httpGet: 
            path: /healthz
            port: 10254
            scheme: HTTP
        ports: 
          - containerPort: 80
            name: http
            protocol: TCP
          - containerPort: 443
            name: https
            protocol: TCP
---
apiVersion: v1
kind: Service
metadata:
namespace:  my-namespace
name: nginx-ingress
spec:
  type: LoadBalancer
  ports:
  - name: https
    port: 443
    targetPort: https
  selector:
    name: nginx-ingress-lb

```