Skip to content
This repository has been archived by the owner on Jan 30, 2021. It is now read-only.

Azure::Action::ConnectAzure is not using azure.endpoint, if configured #210

Open
rmontag opened this issue Dec 8, 2017 · 0 comments
Open

Comments

@rmontag
Copy link

rmontag commented Dec 8, 2017

When explicitly setting the endpoint url in Vagrantfile

Vagrant.configure('2') do |config|
  config.vm.box = 'azure'
  config.vm.provider :azure do |azure, override|
    azure.endpoint = 'https://management.microsoftazure.de'
...
  end
end

the configured value is not propagated to the clients (ComputeManagementClient, ResourceManagementClient, ...), because it is not set in the ConnectAzure class:

action/connect_azure.rb

 module Azure
    module Action
      class ConnectAzure
...
        def call (env)
...
            env[:azure_arm_service] = VagrantPlugins::Azure::Services::AzureResourceManager.new(provider, config.subscription_id)
...

The endpoint needs to be provided as third parameter to the initializer of AzureResourceManager:

 env[:azure_arm_service] = VagrantPlugins::Azure::Services::AzureResourceManager.new(provider, config.subscription_id, config.endpoint)

, otherwise the base_url will always be nil and

@base_url = base_url || 'https://management.azure.com'

will set the fallback url and not the configured endpoint url.

Current impact is, that you cannot use the azure provider for AzureGermanCloud or AzureChinaCloud because the fallback url is used and not the configured endpoint url.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant