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

ARM gems error out with uninitialized constant Azure #327

Closed
jervill opened this issue Mar 11, 2016 · 7 comments
Closed

ARM gems error out with uninitialized constant Azure #327

jervill opened this issue Mar 11, 2016 · 7 comments

Comments

@jervill
Copy link

jervill commented Mar 11, 2016

The 0.2.0 versions of the Azure Resource Management gems throw an error "uninitialized constant Azure".

To repro, either

  1. Download the source.
  2. Set up your AZURE_TENANT_ID, etc.
  3. rspec

or

  1. Install the gem gem install azure_mgmt_compute:0.2.0
  2. Open irb
  3. In irb, require 'azure_mgmt_compute'

Rather than loading the required gem, I get the error that Azure is an uninitialized constant.

azure_mgmt_resources.rb:21:in<top (required)>': uninitialized constant Azure (NameError)`

@jervill jervill changed the title Uninitialized Constant Azure ARM gems error out with uninitialized constant Azure Mar 11, 2016
@devigned
Copy link
Member

Thank you. Looking at it now.

@devigned
Copy link
Member

Looks good locally. Please ping back with your results.

@jervill
Copy link
Author

jervill commented Mar 11, 2016

Hi @devigned thanks for the update. I pulled your latest changes and installed v.0.2.1. I'm no longer hitting the uninitialized constant error when requiring the gems. I see other errors with rspec, but I think those might be issues on my end. Thanks! Marking this as closed.

@jervill jervill closed this as completed Mar 11, 2016
@devigned
Copy link
Member

Yeah... the project setup right now has an excepectation that you will do a bundle install in the root of ./resource_manager and then run rake arm:spec to execute test across all of the gems.

We need to clean up the test / developer workflow as it's rather awkward right now.

Thank you for the issue report and for the prompt response. Please don't hesitate to provide feedback. Cheers!

@jervill
Copy link
Author

jervill commented Mar 17, 2016

Hi @devigned , just a question here about auth and service principals, only loosely related to this issue. I tried running the tests again and I get an error stating:

The client '[redacted]' with object id '[redacted]' does not have authorization to perform action 'Microsoft.Resources/subscriptions/resourcegroups/write' over scope '/subscriptions/[redacted]/resourcegroups/RubySDKTest_72cc1e98d6464f4fb812e7b2388a3abd'.\

That make sense to me because as I understand it, the tests generate a new resource group each time. Thing is, my service principal does not have access to those groups yet. Is there a way to give my service principal access to all the resource groups in my subscription? Or at least to all the resource groups that it creates? Thanks in advance!

@devigned
Copy link
Member

Awesome question! You can give your service principal contributor rights to your subscription.

In the Azure portal, click on Subscriptions, click on the user icon, then add your user or find the service principal / application and give the service principal rights to contribute to the subscription. See below.

sub-role

@jervill
Copy link
Author

jervill commented Mar 17, 2016

Ah cool, I didn't realize you could dig deeper into subscriptions via the portal. Thanks!

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

2 participants