Visual Studio 開発者ツールで以下を入力
makecert -r -pe -n CN=azure-cert -sky exchange azure.cer -sv azure.pvk
pvk2pfx -pvk azure.pvk -spc azure.cer -pfx azure.pfx
OpenSSL をインストールして以下を入力
openssl pkcs12 -in azure.pfx -out azure.pem -nodes
vagrant plugin install vagrant-azure
vagrant up --provider=azure
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "azure"
config.vm.box_url = "https://github.com/msopentech/vagrant-azure/raw/master/dummy.box"
config.vm.provider :azure do |azure|
azure.mgmt_certificate = 'azure-cert.pem'
azure.mgmt_endpoint = 'https://management.core.windows.net'
azure.subscription_id = 'YOUR AZURE SUBSCRIPTION ID'
azure.vm_image = 'a699494373c04fc0bc8f2bb1389d6106__Windows-Server-2012-R2-201411.01-en.us-127GB.vhd'
azure.vm_location = 'Japan West'
azure.vm_size = 'ExtraSmall' # ExtraSmall,Small,Medium,Large,ExtraLarge,A6,A7
azure.vm_user = 'vagrant'
azure.vm_password = 'PROVIDE A VALID PASSWORD'
azure.vm_name = 'vagrant-test-01'
azure.cloud_service_name = 'vagrant-test-01'
azure.tcp_endpoints = '3389:53389' # IISにアクセスするなら'80,3389:53389'
end
end
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "azure"
config.vm.box_url = "https://github.com/msopentech/vagrant-azure/raw/master/dummy.box"
config.vm.provider :azure do |azure|
azure.mgmt_certificate = 'azure-cert.pem'
azure.mgmt_endpoint = 'https://management.core.windows.net'
azure.subscription_id = 'YOUR AZURE SUBSCRIPTION ID'
azure.vm_image = 'a699494373c04fc0bc8f2bb1389d6106__Windows-Server-2012-R2-201411.01-en.us-127GB.vhd'
azure.vm_location = 'Japan West'
azure.vm_size = 'ExtraSmall'
azure.vm_user = 'vagrant'
azure.vm_password = 'PROVIDE A VALID PASSWORD'
azure.vm_name = 'vagrant-test-01'
azure.cloud_service_name = 'vagrant-test-01'
azure.winrm_transport = [ 'http', 'https' ]
azure.tcp_endpoints = '3389:53389'
end
end
Set-NetConnectionProfile -InterfaceAlias (Get-NetConnectionProfile -IPv4Connectivity Internet).InterfaceAlias -NetworkCategory Private
iex ((new-object net.webclient).DownloadString('https://github.com/ansible/ansible/raw/devel/examples/scripts/ConfigureRemotingForAnsible.ps1'))
[windows]
vagrant-test-01.cloudapp.net
[windows:vars]
ansible_ssh_user=vagrant
ansible_ssh_pass=(PROVIDE A VALID PASSWORD)
ansible_ssh_port=5986
ansible_connection=winrm