Gio gram
Gio gram

Reputation: 11

Errors while running vagrant up command

I am working on provisioning azure boxes with vagrant. i followed the steps mentioned in the below link https://stapp.space/setup-vagrant-with-azure/ to create the vagrant file.while running vagrant up command at the end i am facing following errorsenter code here There are errors in the configuration of this machine. Please fix the following errors and try again:

Microsoft Azure Provider: * The following settings shouldn't exist: mgmt_certificate, mgmt_endpoint, ssh_c ertificate_file, ssh_port, ssh_private_key_file, vm_image, vm_location * You must provide Azure Active Directory Tenant ID, Application Client ID and Application Client Secret via ENV or Vagrantfile.

Vagrant file:

VAGRANTFILE_API_VERSION = '2'

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box     = 'azure'
  config.vm.box_url = 'https://github.com/msopentech/vagrant-azure/raw/master/dummy.box'

  config.ssh.username         = 'vagrant'
  config.ssh.private_key_path = File.expand_path('C:\Windows\System32\cert.pem')

  config.vm.provider :azure do |azure|
    azure.mgmt_certificate = File.expand_path('C:\Windows\System32\cert.pem')
    azure.mgmt_endpoint    = 'https://management.core.windows.net'
    azure.subscription_id  = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'

    azure.cloud_service_name = 'Windows Azure MSDN - Visual Studio Ultimate(Converted to EA)12-9-2016-credentials'
    azure.storage_acct_name  = 'Windows Azure MSDN - Visual Studio Ultimate(Converted to EA)'
    azure.deployment_name    = 'azurevagrantdeployment'

    azure.vm_name     = 'azurevagrantsmall1'
    azure.vm_password = 'vagrant123'
    azure.vm_image    = '03f55de797f546a1b29d1b8d66be687a__VS-2017-RC1-Comm-WS2012R22016-11-16 '
    azure.vm_size     = 'Small'
    azure.vm_location = 'North Europe'


    azure.ssh_port             = '22'   
    azure.ssh_private_key_file = File.expand_path('C:\Windows\System32.pem')
    azure.ssh_certificate_file = File.expand_path('C:\Windows\System32.cer')

    azure.tcp_endpoints = '8000'
  end

  config.vm.provision 'shell', inline: 'echo OHAI'
end

please provide the optimal solution

machine configuration:windows 8.1 64 bit

Upvotes: 1

Views: 352

Answers (2)

Kannan
Kannan

Reputation: 56

Yes, If i remove other optional then getting the image not found.

"response": { "body": "{\r\n \"error\": {\r\n \"code\": \"NotFound\",\r\n \"message\": \"Artifact: VMImage was not found.\" \r\n }\r\n}", "headers": { "cache-control": "no-cache", "pragma": "no-cache", "content-length": "99", "content-type": "application/json; charset=utf-8", "expires": "-1", "strict-transport-security": "max-age=31536000; includeSubDomains", "x-ms-request-id": "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "server": "Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0", "x-ms-ratelimit-remaining-subscription-reads": "14998", "x-ms-correlation-request-id": "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy", "x-ms-routing-request-id": "SOUTHEASTASIA:20170102T093102Z:yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy", "date": "Mon, 02 Jan 2017 09:31:02 GMT", "connection": "close" }, "status": 404 } }

Upvotes: 1

Frederic Henri
Frederic Henri

Reputation: 53733

This is some documentation from previous version of the plugin.

You should check with the github readme document - Your vagrant file will look like

Vagrant.configure('2') do |config|
  config.vm.box     = 'azure'
  config.vm.box_url = 'https://github.com/msopentech/vagrant-azure/raw/master/dummy.box'

  config.ssh.username         = 'vagrant'
  config.ssh.private_key_path = File.expand_path('C:\Windows\System32\cert.pem')

  config.vm.provider :azure do |azure, override|

    # use Azure Active Directory Application / Service Principal to connect to Azure
    # see: https://azure.microsoft.com/en-us/documentation/articles/resource-group-create-service-principal-portal/

    # each of the below values will default to use the env vars named as below if not specified explicitly
    azure.tenant_id = ENV['AZURE_TENANT_ID']
    azure.client_id = ENV['AZURE_CLIENT_ID']
    azure.client_secret = ENV['AZURE_CLIENT_SECRET']
    azure.subscription_id = ENV['AZURE_SUBSCRIPTION_ID']
  end

end

Upvotes: 1

Related Questions