# Need help with Azure AD with AWX

**URL:** <https://forum.ansible.com/t/need-help-with-azure-ad-with-awx/4144>\
**Category:** Get Help\
**Tags:** azure, awx, collections\
**Created:** [February 29, 2024, 2:17pm UTC](https://forum.ansible.com/t/need-help-with-azure-ad-with-awx/4144 "2024-02-29T14:17:53Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wizz](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/wizz/32/2446_2.png) [@Wizz](https://forum.ansible.com/u/Wizz)\
**Post date:** [February 29, 2024, 2:17pm UTC](https://forum.ansible.com/t/need-help-with-azure-ad-with-awx/4144/1 "2024-02-29T14:17:53Z")

</div>

Hi,

- K3s v1.28.6+k3s2
- awx-operator 2.12.1
- AWX 23.9.0
- PostgreSQL 13  
AWX is exposed via nginx ingress (with domain )  
I’ve created a public certificate

I’ve configured azure and AWX according to the documentation.  
When I click on the azure button on the connection page, I arrive on the Microsoft part and then I enter my identifiers. Then the page loads for a while and I get a “504 Gateway Time-out error. nginx”.  
Is anyone having problems with Azure AD?  
Thank you  
Best regards,  
Wizz

---

<div class="post-metadata">

**Author:** ![Rtwolfe94022](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/rtwolfe94022/32/2463_2.png) [@Rtwolfe94022](https://forum.ansible.com/u/Rtwolfe94022)\
**Post date:** [March 1, 2024, 3:01am UTC](https://forum.ansible.com/t/need-help-with-azure-ad-with-awx/4144/2 "2024-03-01T03:01:12Z")

</div>

To address the “504 Gateway Time-out error” with Azure AD in AWX, check and adjust the Nginx timeout settings, ensure your Azure AD and AWX configurations match the documentation, inspect network connectivity, and review both AWX and Azure AD logs for errors. This comprehensive approach should help identify and solve the issue.

---

<div class="post-metadata">

**Author:** ![Wizz](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/wizz/32/2446_2.png) [@Wizz](https://forum.ansible.com/u/Wizz)\
**Post date:** [March 1, 2024, 8:27am UTC](https://forum.ansible.com/t/need-help-with-azure-ad-with-awx/4144/3 "2024-03-01T08:27:38Z")

</div>

Yes, I tried to access the nginx settings in the Kubernetes container. But it asks me for a password, I don’t know it. Is there any other way to change the nginx config??

And the file (nginx.conf) is in readonly , i cannot modify

---

<div class="post-metadata">

**Author:** ![kurokobo](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kurokobo/32/182_2.png) [@kurokobo](https://forum.ansible.com/u/kurokobo)\
**Post date:** [March 1, 2024, 12:33pm UTC](https://forum.ansible.com/t/need-help-with-azure-ad-with-awx/4144/4 "2024-03-01T12:33:00Z")

</div>

Hi, thanks for moving the topic from my repo to here, with additional information 😃

I make quick test and can confirm that Azure AD auth works without any problem. Almost the same setup, but I use Traefik as an ingress controller.

When you are on `504 Gateway Time-out error. nginx` page, what is its URL? I mean, we want to ensure `Redirect URI` is correct.

If the `Redirect URI` is correctly configured, is there any logs on the nginx side, e.g. nginx for ingress controller, or nginx in awx-web pod.

---

<div class="post-metadata">

**Author:** ![Wizz](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/wizz/32/2446_2.png) [@Wizz](https://forum.ansible.com/u/Wizz)\
**Post date:** [March 1, 2024, 5:10pm UTC](https://forum.ansible.com/t/need-help-with-azure-ad-with-awx/4144/5 "2024-03-01T17:10:45Z")

</div>

Ok, let me start from the beginning:  
1 I created the app on azure AD  
2- created a “web” web application (adding the rollback link I found on AWX [https://fdqn/sso/complete/azuread-oauth2/](https://fdqn/sso/complete/azuread-oauth2/))  
3-I changed the default name to towerhost on the awx web interface

I work behind a proxy.  
I’ve just realised that my traffic does not go through the proxy never use the proxy, even though I’ve added the http\_proxy :  
1 on awx.yml  
2 /etc/systemd/system/k3s.service.env

I have no idea … why

---

<div class="post-metadata">

**Author:** ![kurokobo](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kurokobo/32/182_2.png) [@kurokobo](https://forum.ansible.com/u/kurokobo)\
**Post date:** [March 2, 2024, 4:37am UTC](https://forum.ansible.com/t/need-help-with-azure-ad-with-awx/4144/6 "2024-03-02T04:37:49Z")

</div>

> [@Wizz](#):
>
> 1 on awx.yml  
> 2 /etc/systemd/system/k3s.service.env

How did you add proxies on `awx.yml`? If you have done it by adding `AWX_TASK_ENV['HTTP_PROXY']` in `extra_settings`, I haven’t read the code in detail, but I’m a little unsure if that works for social auth as well.

Can you try adding proxies by `task_extra_env` and `web_extra_env` in `awx.yaml`?

```yaml
spec:
  ...
  task_extra_env: |
    - name: HTTP_PROXY
      value: http://proxy.example.com:3128
    - name: HTTPS_PROXY
      value: http://proxy.example.com:3128
    - name: NO_PROXY
      value: 127.0.0.1,localhost,.example.com
  web_extra_env: |
    - name: HTTP_PROXY
      value: http://proxy.example.com:3128
    - name: HTTPS_PROXY
      value: http://proxy.example.com:3128
    - name: NO_PROXY
      value: 127.0.0.1,localhost,.example.com

```

---

<div class="post-metadata">

**Author:** ![Wizz](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/wizz/32/2446_2.png) [@Wizz](https://forum.ansible.com/u/Wizz)\
**Post date:** [March 4, 2024, 3:50pm UTC](https://forum.ansible.com/t/need-help-with-azure-ad-with-awx/4144/7 "2024-03-04T15:50:53Z")

</div>

I put this (awx.yml) :

```auto
extra_settings:
    - setting: AWX_TASK_ENV['HTTP_PROXY']
      value: "''"
    - setting: AWX_TASK_ENV['HTTPS_PROXY']
      value: "''"
    - setting: AWX_TASK_ENV['NO_PROXY']
      value: "''"

```

---

<div class="post-metadata">

**Author:** ![Wizz](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/wizz/32/2446_2.png) [@Wizz](https://forum.ansible.com/u/Wizz)\
**Post date:** [March 4, 2024, 4:19pm UTC](https://forum.ansible.com/t/need-help-with-azure-ad-with-awx/4144/8 "2024-03-04T16:19:05Z")

</div>

Your solution works 🙂  
Thank you very much

---

<div class="post-metadata">

**Author:** ![kurokobo](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kurokobo/32/182_2.png) [@kurokobo](https://forum.ansible.com/u/kurokobo)\
**Post date:** [March 6, 2024, 4:27am UTC](https://forum.ansible.com/t/need-help-with-azure-ad-with-awx/4144/9 "2024-03-06T04:27:06Z")

</div>

Thank you too, I’ve added a note about this in [my guide](https://github.com/kurokobo/awx-on-k3s/blob/main/tips/use-http-proxy.md) 😃

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [April 5, 2024, 4:27am UTC](https://forum.ansible.com/t/need-help-with-azure-ad-with-awx/4144/10 "2024-04-05T04:27:30Z")

</div>

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