No release in over a year
This rubygem does not have a description or summary.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 6.0.0, < 8.0.0
~> 0.21.0
 Project Readme

activerecord-aad

This gem enables using an Azure ActiveDirectory Managed Identity to connect to an Azure Database Service

Installation

  • Add gem :activerecord_aad to your Gemfile.
  • Run bin/bundle install

Setup

Follow one of the following guides:

Add the client_id from the Azure AD Managed Identity and add it to your config/database.yml file with the key azure_managed_identity

Example:

production:
  adapter: mysql2
  reconnect: true
  host: my-app.mysql.database.azure.com
  azure_managed_identity: 91cb2200-004b-4577-a8ca-a5fa9c082485
  database: app
  username: MyAppsManagedIdentity@my-app
  sslca: /opt/ssl/BaltimoreCyberTrustRoot.crt.pem
  sslverify: true
  sslcipher: 'AES256-SHA'

How it works

Whenever a new database connection is needed, a call is made to "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https%3A%2F%2Fossrdbms-aad.database.windows.net&client_id=#{database_yml_azure_managed_identity}" to get a new access key. That access key is added as the password to the database configuration that is passed to the adapter to establish the connection.