lib/kitchen/driver/credentials.rb
def azure_options_for_subscription(subscription_id, azure_environment = "Azure")
        tenant_id = ENV["AZURE_TENANT_ID"] || @credentials[subscription_id]["tenant_id"]
        client_id = ENV["AZURE_CLIENT_ID"] || @credentials[subscription_id]["client_id"]
        client_secret = ENV["AZURE_CLIENT_SECRET"] || @credentials[subscription_id]["client_secret"]
        token_provider = ::MsRestAzure::ApplicationTokenProvider.new(tenant_id, client_id, client_secret, ad_settings_for_azure_environment(azure_environment))
        options = { tenant_id: tenant_id,
                    client_id: client_id,
                    client_secret: client_secret,
                    subscription_id: subscription_id,
                    credentials: ::MsRest::TokenCredentials.new(token_provider),
                    active_directory_settings: ad_settings_for_azure_environment(azure_environment),
                    base_url: endpoint_settings_for_azure_environment(azure_environment).resource_manager_endpoint_url }
        options
      end
#
# Retrieves an object containing options and credentials for the given
# subscription_id and azure_environment.
#
# @param subscription_id [String] The subscription_id to retrieve a token for
# @param azure_environment [String] The azure_environment to use
#
# @return [Object] Object that can be supplied along with all Azure client requests.
#
Retrieves an object containing options and credentials for the given
subscription_id and azure_environment.
Retrieves an object containing options and credentials for the given subscription_id and azure_environment .
def azure_options_for_subscription(subscription_id, azure_environment = "Azure")
        tenant_id = ENV["AZURE_TENANT_ID"] || @credentials[subscription_id]["tenant_id"]
        client_id = ENV["AZURE_CLIENT_ID"] || @credentials[subscription_id]["client_id"]
        client_secret = ENV["AZURE_CLIENT_SECRET"] || @credentials[subscription_id]["client_secret"]
        token_provider = ::MsRestAzure::ApplicationTokenProvider.new(tenant_id, client_id, client_secret, ad_settings_for_azure_environment(azure_environment))
        options = { tenant_id: tenant_id,
                    client_id: client_id,
                    client_secret: client_secret,
                    subscription_id: subscription_id,
                    credentials: ::MsRest::TokenCredentials.new(token_provider),
                    active_directory_settings: ad_settings_for_azure_environment(azure_environment),
                    base_url: endpoint_settings_for_azure_environment(azure_environment).resource_manager_endpoint_url }
        options
      end
def azure_options_for_subscription ( subscription_id , azure_environment = "Azure" ) tenant_id = ENV [ "AZURE_TENANT_ID" ] || @credentials [ subscription_id ] [ "tenant_id" ] client_id = ENV [ "AZURE_CLIENT_ID" ] || @credentials [ subscription_id ] [ "client_id" ] client_secret = ENV [ "AZURE_CLIENT_SECRET" ] || @credentials [ subscription_id ] [ "client_secret" ] token_provider = :: MsRestAzure :: ApplicationTokenProvider . new ( tenant_id , client_id , client_secret , ad_settings_for_azure_environment ( azure_environment ) ) options = { tenant_id : tenant_id , client_id : client_id , client_secret : client_secret , subscription_id : subscription_id , credentials : :: MsRest :: TokenCredentials . new ( token_provider ) , active_directory_settings : ad_settings_for_azure_environment ( azure_environment ) , base_url : endpoint_settings_for_azure_environment ( azure_environment ) . resource_manager_endpoint_url } options end
Retrieves an object containing options and credentials for the given
subscription_id and azure_environment.
Retrieves an object containing options and credentials for the given subscription_id and azure_environment .
Object that can be supplied along with all Azure client requests.
Object that can be supplied along with all Azure client requests .
Object
subscription_id
The subscription_id to retrieve a token for
The subscription_id to retrieve a token for
azure_environment
The azure_environment to use
The azure_environment to use