diff --git a/jobs/director/spec b/jobs/director/spec index e4bb9a99b2..2003699e6b 100644 --- a/jobs/director/spec +++ b/jobs/director/spec @@ -423,6 +423,9 @@ properties: description: container_name of azure storage account blobstore.account_key: description: account_key of azure storage account + blobstore.azure_cloud_name: + description: Name of the Azure Cloud + default: AzureCloud blobstore.swift_auth_account: description: swift_auth_account of swift storage account blobstore.swift_temp_url_key: diff --git a/jobs/director/templates/director.yml.erb b/jobs/director/templates/director.yml.erb index 9720293d0b..51fbc30265 100644 --- a/jobs/director/templates/director.yml.erb +++ b/jobs/director/templates/director.yml.erb @@ -256,6 +256,7 @@ elsif p('blobstore.provider') == 'gcs' end elsif p('blobstore.provider') == 'azure-storage' blobstore_options = { + 'azure_cloud_name' => p('blobstore.azure_cloud_name'), 'account_name' => p('blobstore.account_name'), 'container_name' => p('blobstore.container_name'), 'account_key' => p('blobstore.account_key'), diff --git a/src/bosh-director/lib/bosh/blobstore_client/azurestoragecli_blobstore_client.rb b/src/bosh-director/lib/bosh/blobstore_client/azurestoragecli_blobstore_client.rb index 182cfe5a82..55e0f77580 100644 --- a/src/bosh-director/lib/bosh/blobstore_client/azurestoragecli_blobstore_client.rb +++ b/src/bosh-director/lib/bosh/blobstore_client/azurestoragecli_blobstore_client.rb @@ -13,6 +13,8 @@ class AzurestoragecliBlobstoreClient < BaseClient # key that is applied before the object is sent to azure storage account # @option options [Symbol, optional] account_key # @option options [Symbol, optional] container_name + # @option options [Symbol, optional] azure_cloud_name + # Azure Cloud Name to use for azure storage account # @option options [Symbol] azure_storage_cli_path # path to azure-storage-cli binary # @option options [Symbol, optional] azure_storage_cli_config_path @@ -29,7 +31,8 @@ def initialize(options) @azure_storage_cli_options = { "account_name": @options[:account_name], "container_name": @options[:container_name], - "account_key": @options[:account_key] + "account_key": @options[:account_key], + "environment": @options[:azure_cloud_name] } @azure_storage_cli_options.reject! { |_k, v| v.nil? } diff --git a/src/bosh-director/spec/unit/blobstore_client/azurestoragecli_blobstore_client_spec.rb b/src/bosh-director/spec/unit/blobstore_client/azurestoragecli_blobstore_client_spec.rb index 26c0b18cf2..5636baf22b 100644 --- a/src/bosh-director/spec/unit/blobstore_client/azurestoragecli_blobstore_client_spec.rb +++ b/src/bosh-director/spec/unit/blobstore_client/azurestoragecli_blobstore_client_spec.rb @@ -16,6 +16,7 @@ module Bosh::Blobstore container_name: 'test', account_name: 'NAME', account_key: 'SECRET', + azure_cloud_name: 'foo-cloud', azure_storage_cli_path: '/var/vcap/packages/azure-storage-cli/bin/azure-storage-cli', } end @@ -37,7 +38,8 @@ module Bosh::Blobstore { 'container_name' => 'test', 'account_name' => 'NAME', - 'account_key' => 'SECRET' + 'account_key' => 'SECRET', + 'environment' => 'foo-cloud', } end let(:stored_config_file) { File.new(expected_config_file).readlines }