DEV Community

Cover image for Configure Prometheus with Basic Authentication in Microsoft Azure WebApp
Suryabhan Singh Vaghela
Suryabhan Singh Vaghela

Posted on

1

Configure Prometheus with Basic Authentication in Microsoft Azure WebApp

Goal :

  • Configuration of Prometheus Basic Authentication in Microsoft Azure WebApp.

Pre-Requisite :

Steps

  1. Create a web.yml file (documentation)

  2. You can also use bcrypt generators on the web

Configuration of Prometheus Basic Authentication in Microsoft Azure WebApp
Configuration of Prometheus Basic Authentication in Microsoft Azure WebApp
Configuration of Prometheus Basic Authentication in Microsoft Azure WebApp

  • web.yml (Upload this file in **suryasprometheus** Storage Account Share)
basic_auth_users:
  suryauser: $2a$12$6g5f3MZriVtoOZ7GrCEwzuTBxnPQwHurpktXTXUu1neg/XZeHzipy
Enter fullscreen mode Exit fullscreen mode

Configuration of Prometheus Basic Authentication in Microsoft Azure WebApp

  • Set an Startup Commmand for Prometheus WebApp which includes web.yml
az webapp config set --name $WebAppName --resource-group $ResourceGroupName --startup-file `
"--config.file=/etc/prometheus/prometheus.yml --web.config.file=/etc/prometheus/web.yml --web.enable-lifecycle --storage.tsdb.retention.time=7d"
Enter fullscreen mode Exit fullscreen mode

Configuration of Prometheus Basic Authentication in Microsoft Azure WebApp

  • prometheus.yml (Upload this file in **suryasprometheus** Storage Account Share)
# my global config
global:
  scrape_interval: 30s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
  evaluation_interval: 30s # Evaluate rules every 15 seconds. The default is every 1 minute.
  scrape_timeout: 30s #is set to the global default (10s).


# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
  # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
  - job_name: "Prometheus"
    static_configs:
      - targets: ["suryawaprometheus.azurewebsites.net"]
    basic_auth:
        username: suryauser
        password: suryapassword
Enter fullscreen mode Exit fullscreen mode

Configuration of Prometheus Basic Authentication in Microsoft Azure WebApp
Configuration of Prometheus Basic Authentication in Microsoft Azure WebApp

Image of AssemblyAI tool

Challenge Submission: SpeechCraft - AI-Powered Speech Analysis for Better Communication

SpeechCraft is an advanced real-time speech analytics platform that transforms spoken words into actionable insights. Using cutting-edge AI technology from AssemblyAI, it provides instant transcription while analyzing multiple dimensions of speech performance.

Read full post

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay