ruby - fog-azure-rm: creating Disks fails with uninitialized constant Azure::Core -


i'm unable create disks in azure. below steps did create failing.

versions:

fog-azure-rm (0.3.2)

ruby version 2.4.0

azure_storage_service = fog::storage::azurerm.new(   :tenant_id => '<tenantid>',                                                         :client_id =>    '<clientid>',                                                      :client_secret => '<clientsecret>',                                                 :subscription_id => '<subscriptionid>' )       azure_storage_service.create_disk('disk_name',1023)  /usr/local/lib/ruby/gems/2.4.0/gems/fog-azure-rm-0.3.2/lib/fog/azurerm/requests/storage/create_page_blob.rb:13:in `rescue in create_page_blob': uninitialized constant azure::core (nameerror)     /usr/local/lib/ruby/gems/2.4.0/gems/fog-azure-rm-0.3.2/lib/fog/azurerm/requests/storage/create_page_blob.rb:11:in `create_page_blob'     /usr/local/lib/ruby/gems/2.4.0/gems/fog-azure-rm-0.3.2/lib/fog/azurerm/requests/storage/create_disk.rb:37:in `create_disk'     createdisk.rb:12:in `<main>' 

first of all, need require fog library executing:

require 'fog/azurerm' 

next, if use existing storage account, please add storage account , key connection. if remove them code, same error log you. following codes work me. please replace * value.

require 'fog/azurerm' azure_storage_service = fog::storage.new(   :provider => 'azurerm',   :tenant_id => '*****',                                                       # tenant id of azure active directory application   :client_id =>    '*****************',                                                    # client id of azure active directory application   :client_secret => '************',                                               # client secret of azure active directory application   :subscription_id => '***************',                                           # subscription id of azure account   :azure_storage_account_name => 'shuiwindiag907',                            # name of azure storage account   :azure_storage_access_key => '************************',                               # key of azure storage account   :environment => 'azurecloud' # azure cloud environment. default azurecloud. )  azure_storage_service.create_disk('shui_test',5) ##by default disk created in container 'vhds'. if container not exist, please create or set options[:container_name]. 

more information please refer link.


Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -