class Azure::Core::Configuration

Singleton that keeps the configuration of the system.

Attributes

ca_file[RW]

Public: Get/Set path of a CA certification directory containing certifications in PEM format.

For example:

config.ca_file = 'ca_cert.pem'
http_certificate_key[RW]

Public: Set the certificate key for SSL/HTTPS request with PEM certificate

http_private_key[RW]

Public: Set the private key for SSL/HTTPS request with PEM certificate

management_certificate[RW]

Public: Get the Subscription Id and certificate key for the management API.

management_endpoint[W]

Public: Set the host for the management API.

sb_access_key[RW]

Public: Get/Set the Service Bus Access Key (Issuer Secret) for this service.

sb_issuer[W]

Public: Set the Service Bus Issuer for this service.

sb_namespace[RW]

Public: Get/Set the Service Bus Namespace for this service.

sql_database_authentication_mode[RW]

Public: Set this to enable Management certificate authentication or SQL Server authentication

sql_database_management_endpoint[RW]

Public: Set the host for SQL Management API (SQL Server authentication Endpoint)

storage_access_key[RW]

Public: Get/Set the Access Key for this service.

storage_account_name[RW]

Public: Get/Set the Account Name for this service.

storage_blob_host[W]

Public: Set the host for the Blob service. Only set this if you want something custom (like, for example, to point this to a LocalStorage emulator). This should be the complete host, including http:// at the start. When using the emulator, make sure to include your account name at the end.

Example:

config.storage_blob_host = "http://127.0.0.1:10000/devstoreaccount1"
storage_queue_host[W]

Public: Set the host for the Queue service. Only set this if you want something custom (like, for example, to point this to a LocalStorage emulator). This should be the complete host, including http:// at the start. When using the emulator, make sure to include your account name at the end.

Example:

config.storage_queue_host = "http://127.0.0.1:10001/devstoreaccount1"
storage_table_host[W]

Public: Set the host for the Table service. Only set this if you want something custom (like, for example, to point this to a LocalStorage emulator). This should be the complete host, including http:// at the start. When using the emulator, make sure to include your account name at the end.

Example:

config.storage_table_host = "http://127.0.0.1:10002/devstoreaccount1"
subscription_id[RW]

Public: Get/Set the Subscription Id for the management API.

Public Instance Methods

acs_host() click to toggle source

Public: Get the host for the ACS service.

# File lib/azure/core/configuration.rb, line 140
def acs_host
  "https://#{sb_namespace}-sb.accesscontrol.windows.net"
end
default_host(service) click to toggle source

Calculate the default host for a given service in the cloud.

service - One of :table, :blob, :queue, etc.

Returns a String with the hostname, including your account name.

# File lib/azure/core/configuration.rb, line 154
def default_host(service)
  "http://#{storage_account_name}.#{service}.core.windows.net"
end
management_endpoint() click to toggle source
# File lib/azure/core/configuration.rb, line 180
def management_endpoint
  if @management_endpoint.nil? or @management_endpoint.empty?
    "https://management.core.windows.net/"
  elsif !@management_endpoint.end_with?('/')
    @management_endpoint += '/'
  elsif URI(@management_endpoint).scheme.nil?
    "https://#{@management_endpoint}"
  else
    @management_endpoint
  end
end
sb_issuer() click to toggle source

Public: Get the issuer for the service bus. If you set something using sb_issuer=, then we use that. Otherwise, we default to the default issuer: “owner”

# File lib/azure/core/configuration.rb, line 78
def sb_issuer
  @sb_issuer || "owner"
end
service_bus_host() click to toggle source

Public: Get the host for the Service Bus service.

# File lib/azure/core/configuration.rb, line 145
def service_bus_host
  "https://#{sb_namespace}.servicebus.windows.net"
end
storage_blob_host() click to toggle source

Public: Get the host for this service. If you set something using storage_blob_host=, then we use that. Else we default to Azure's default hosts, based on your account name.

# File lib/azure/core/configuration.rb, line 117
def storage_blob_host
  @storage_blob_host || default_host(:blob)
end
storage_queue_host() click to toggle source

Public: Get the host for this service. If you set something using storage_queue_host=, then we use that. Else we default to Azure's default hosts, based on your account name.

# File lib/azure/core/configuration.rb, line 135
def storage_queue_host
  @storage_queue_host || default_host(:queue)
end
storage_table_host() click to toggle source

Public: Get the host for this service. If you set something using storage_table_host=, then we use that. Else we default to Azure's default hosts, based on your account name.

# File lib/azure/core/configuration.rb, line 99
def storage_table_host
  @storage_table_host || default_host(:table)
end