Forum Discussion
Matt Godby
Oct 10, 2017Copper Contributor
Ruby SDK token issues
Hello, everyone!
I am having issues setting up the ability to deploy resources via the Ruby SDK. After downloading an Azure-generated template.json, parameters.json, and the Ruby-based deployer.rb script, I am unable to run that deployer script successfully.
I have:
- Installed the required gems per: https://github.com/Azure/azure-sdk-for-ruby/blob/master/README.md
- Configured an 'application' with which to access the API per: https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-create-service-principal-portal
- Eactly followed the process for using the SDK to deploy resources per: https://azure.microsoft.com/en-us/resources/samples/resource-manager-ruby-template-deployment/
In spite of following all of those articles exactly, I am getting the error output shown here:
mgodby@DESKTOP-9JNCEG4:/mnt/c/Users/mgodby/git/azure-lab/os-azure-deployer$ ./deployer.rb <redacted> <redacted> 'East US'
Initializing the Deployer class with subscription id: <redacted>, resource group: <redacted>
and resource group location: East US...
Beginning the deployment...
/var/lib/gems/2.3.0/gems/ms_rest_azure-0.9.0/lib/ms_rest_azure/credentials/application_token_provider.rb:108:in `acquire_token': { (MsRestAzure::AzureOperationError)
"message": "Couldn't login to Azure, please verify your tenant id, client id and client secret",
"request": null,
"response": null
}
from /var/lib/gems/2.3.0/gems/ms_rest_azure-0.9.0/lib/ms_rest_azure/credentials/application_token_provider.rb:69:in `get_authentication_header'
from /var/lib/gems/2.3.0/gems/ms_rest-0.7.1/lib/ms_rest/credentials/token_credentials.rb:49:in `sign_request'
from /var/lib/gems/2.3.0/gems/ms_rest-0.7.1/lib/ms_rest/service_client.rb:51:in `block in make_request_async'
from /var/lib/gems/2.3.0/gems/ms_rest-0.7.1/lib/ms_rest/http_operation_request.rb:82:in `block (2 levels) in run_promise'
from /var/lib/gems/2.3.0/gems/faraday-0.13.1/lib/faraday/connection.rb:384:in `block in run_request'
from /var/lib/gems/2.3.0/gems/faraday-0.13.1/lib/faraday/connection.rb:398:in `block in build_request'
from /var/lib/gems/2.3.0/gems/faraday-0.13.1/lib/faraday/request.rb:26:in `block in create'
from /var/lib/gems/2.3.0/gems/faraday-0.13.1/lib/faraday/request.rb:25:in `tap'
from /var/lib/gems/2.3.0/gems/faraday-0.13.1/lib/faraday/request.rb:25:in `create'
from /var/lib/gems/2.3.0/gems/faraday-0.13.1/lib/faraday/connection.rb:394:in `build_request'
from /var/lib/gems/2.3.0/gems/faraday-0.13.1/lib/faraday/connection.rb:379:in `run_request'
from /var/lib/gems/2.3.0/gems/ms_rest-0.7.1/lib/ms_rest/http_operation_request.rb:80:in `block in run_promise'
from /var/lib/gems/2.3.0/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/safe_task_executor.rb:24:in `block in execute'
from /var/lib/gems/2.3.0/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/mri_lockable_object.rb:38:in `block in synchronize'
from /var/lib/gems/2.3.0/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/mri_lockable_object.rb:38:in `synchronize'
from /var/lib/gems/2.3.0/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/mri_lockable_object.rb:38:in `synchronize'
from /var/lib/gems/2.3.0/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/safe_task_executor.rb:19:in `execute'
from /var/lib/gems/2.3.0/gems/concurrent-ruby-1.0.5/lib/concurrent/promise.rb:531:in `block in realize'
from /var/lib/gems/2.3.0/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:348:in `run_task'
from /var/lib/gems/2.3.0/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:337:in `block (3 levels) in create_worker'
from /var/lib/gems/2.3.0/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:320:in `loop'
from /var/lib/gems/2.3.0/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:320:in `block (2 levels) in create_worker'
from /var/lib/gems/2.3.0/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:319:in `catch'
from /var/lib/gems/2.3.0/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:319:in `block in create_worker'What am I missing? What else needs doing besides the steps listed above? Any help would be immensely appreciated.
With regards,
Matt
No RepliesBe the first to reply