# InfluxDB Error creation failed: 401 Unauthorized

**URL:** <https://community.influxdata.com/t/influxdb-error-creation-failed-401-unauthorized/19302>\
**Category:** Telegraf\
**Tags:** influxdb, grafana, outputs, docker\
**Created:** [April 8, 2021, 2:48pm UTC](https://community.influxdata.com/t/influxdb-error-creation-failed-401-unauthorized/19302 "2021-04-08T14:48:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Natmang](https://avatars.discourse-cdn.com/v4/letter/n/cab0a1/32.png) [@Natmang](https://community.influxdata.com/u/Natmang)\
**Post date:** [April 8, 2021, 2:48pm UTC](https://community.influxdata.com/t/influxdb-error-creation-failed-401-unauthorized/19302/1 "2021-04-08T14:48:44Z")

</div>

Hello,

I’m trying to collect data from a Azure SQL Managed Instance I’ve stumbled across this [article](https://techcommunity.microsoft.com/t5/datacat/real-time-performance-monitoring-for-azure-sql-database-managed/ba-p/305537#comment-on-this) using Grafana, InfluxDB & telegraf for achieving some useful looking dashboards.

I’m running a VM in Azure in the same VNET and after following the instructions from the article and running systemctl status -l telegraf I see the below error.

> [outputs.influxdb] When writing to [[http://127.0.0.1:8086](http://127.0.0.1:8086)]: database “telegraf” creation failed: 401 Unauthorized

Upon logging into Grafana web gui and trying to add the influxdb as a data source I just receive

> influxDB Error: Bad Request

I’m running this on Ubuntu 18.04 LTS I tried spinning up a fresh 20.04 and ran into the same issue. This is my first experience with InfluxDB, telegraf or Grafana and I’m really struggling to get to the bottom of my issue.

Any assistance in identifying what’s going wrong would be much appreciated.

---

<div class="post-metadata">

**Author:** ![Natmang](https://avatars.discourse-cdn.com/v4/letter/n/cab0a1/32.png) [@Natmang](https://community.influxdata.com/u/Natmang)\
**Post date:** [April 8, 2021, 2:53pm UTC](https://community.influxdata.com/t/influxdb-error-creation-failed-401-unauthorized/19302/2 "2021-04-08T14:53:56Z")

</div>

I’m unable to edit my post being a new user but below is my config.

> [[inputs.sqlserver]]  
> servers = [“Server=[SQL MI];User Id=[SQL MI User];Password=[SQL MI User Password];app name=telegraf;”]
> 
> query\_version = 2
> 
> [[outputs.influxdb]]  
> urls = [“[http://127.0.0.1:8086](http://127.0.0.1:8086)”]  
> database = “telegraf”

---

<div class="post-metadata">

**Author:** ![Pooh](https://avatars.discourse-cdn.com/v4/letter/p/f05b48/32.png) [@Pooh](https://community.influxdata.com/u/Pooh)\
**Post date:** [April 8, 2021, 3:09pm UTC](https://community.influxdata.com/t/influxdb-error-creation-failed-401-unauthorized/19302/3 "2021-04-08T15:09:12Z")

</div>

Does “netstat -lptn” confirm that you do in fact have Influx listening on  
localhost port 8086?

Antony.

---

<div class="post-metadata">

**Author:** ![Natmang](https://avatars.discourse-cdn.com/v4/letter/n/cab0a1/32.png) [@Natmang](https://community.influxdata.com/u/Natmang)\
**Post date:** [April 8, 2021, 3:36pm UTC](https://community.influxdata.com/t/influxdb-error-creation-failed-401-unauthorized/19302/4 "2021-04-08T15:36:10Z")

</div>

I’m not much of a Linux user but it looks to have bound over ipv6 could this be the issue

 ![netstat](https://us1.discourse-cdn.com/flex023/uploads/influxdata/original/2X/c/c93afc6000cbb05856266b09cec74a2c6747b3a7.png)

---

<div class="post-metadata">

**Author:** ![Franky1](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/franky1/32/6666_2.png) [@Franky1](https://community.influxdata.com/u/Franky1)\
**Post date:** [April 8, 2021, 5:01pm UTC](https://community.influxdata.com/t/influxdb-error-creation-failed-401-unauthorized/19302/5 "2021-04-08T17:01:13Z")

</div>

And your ipv4 seems to listen on port `4222` ?
