Skip to content

Set-AzureVMChefExtension command in ARM #1504

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 6, 2016

Conversation

NimishaS
Copy link

In Progress

@azurecla
Copy link

Hi @NimishaS, I'm your friendly neighborhood Azure Pull Request Bot (You can call me AZPRBOT). Thanks for your contribution!
You've already signed the contribution license agreement. Thanks!
We will now validate the agreement and then real humans will evaluate your PR.

TTYL, AZPRBOT;

@NimishaS NimishaS changed the title Nim/arm set azurevmchefextension Set-AzureVMChefExtension command in ARM Dec 16, 2015
@markcowl
Copy link
Member

@azuresdkci retest this please

@markcowl
Copy link
Member

@NimishaS Thanks for the contribution, were you going to add online help for this cmdlet?

@NimishaS
Copy link
Author

@markcowl , this is still in testing phase. I will confirm once I am done. I am going to update the help files also.

@stankovski
Copy link
Member

@NimishaS is this PR ready to be merged?

@NimishaS
Copy link
Author

@stankovski, @markcowl we are facing issues while testing it. While running the command Set-AzureVMChefExtension, we get this error:

Set-AzureVMChefExtension : Run Login-AzureRmAccount to login.
At line:1 char:1
+ Set-AzureVMChefExtension -ResourceGroupName "testresourcegrp1" -VMName "test-vm- ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Set-AzureVMChefExtension], PSInvalidOperationException
    + FullyQualifiedErrorId : InvalidOperation,Microsoft.Azure.Commands.Compute.Extension.Chef.SetAzureVMChefExtension

We get the same error even after running Login-AzureRmAccount command. It doesn't go inside our code at all.
Can you please suggest something here?

@stankovski
Copy link
Member

@huangpf can you take a look at the cmdlet to make sure the base cmdlet is prperly executed?

@@ -87,6 +87,7 @@ public static class ProfileNouns
public const string VirtualMachineExtensionImage = "AzureRmVMExtensionImage";
public const string VirtualMachineExtensionImageVersion = "AzureRmVMExtensionImageVersion";
public const string VirtualMachineExtensionImageType = "AzureRmVMExtensionImageType";
public const string VirtualMachineChefExtension = "AzureVMChefExtension";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AzureRmVMChefExtension

@huangpf
Copy link
Contributor

huangpf commented Dec 30, 2015

@NimishaS
Try to rename your cmdlet to *AzureRm*, so that it's not overlapped with the RDFE ones. Thanks.

@NimishaS
Copy link
Author

@huangpf I tried with AzureRmVMChefExtension too, but still facing the same issue. While debugging I found that DefaultProfile.Context is null here https://github.com/Azure/azure-powershell/blob/dev/src/ResourceManager/Common/Commands.ResourceManager.Common/AzureRMCmdlet.cs#L75, which results into the error that we are facing.
I have tried commands like Select-AzureRmProfile, Set-AzureRmContext etc, but nothing helped.

One more thing, I face the same issue when I try to run other commands like Set-AzureRmVmBGInfoExtension too. It seems like I am missing something while testing the code in Debug mode. I am novice to C#.

@huangpf
Copy link
Contributor

huangpf commented Dec 30, 2015

@NimishaS
Copy link
Author

@huangpf we are following the instructions from https://github.com/Azure/azure-powershell/wiki/Microsoft-Azure-PowerShell-Developer-Guide#importing-modules-automatically-when-start-debugging only. Below is the value of Command line arguments that we are using:

-NoExit -Command "C:\Users\azure\nim\azure-powershell\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.Compute\Microsoft.Azure.Commands.Compute.dll"

@huangpf
Copy link
Contributor

huangpf commented Dec 31, 2015

@hyonholee @stankovski
Any thoughts on why the wiki about debug settings doens't work as expected for @NimishaS?

@markcowl
Copy link
Member

markcowl commented Jan 1, 2016

@NimishaS This isn't actually following the advice - it needs to use

Import-Module "C:\Users\azure\nim\azure-powershell\srcPackage\Debug\ResourceManager\AzureResourceManager\AzureRM.Compute\AzureRm.Compute.psd1"

@markcowl
Copy link
Member

markcowl commented Jan 4, 2016

@NimishaS Is this PR ready to merge?

@NimishaS
Copy link
Author

NimishaS commented Jan 5, 2016

@markcowl , thanks for help. Importing AzureRm.Compute.psd1 helped but we had to modify the paths of some modules inside AzureRm.Compute.psd1 to get this working.
The command is executing successfully for both windows and linux, but it's currently not picking the default value of -TypeHandlerVersion. We need to fix that and also check if there is any other such option.
We'll update this very soon.

@NimishaS
Copy link
Author

NimishaS commented Jan 6, 2016

@markcowl , we have tested this. It can be merged now.

stankovski added a commit that referenced this pull request Jan 6, 2016
…chefextension

Set-AzureVMChefExtension command in ARM
@stankovski stankovski merged commit 320d022 into Azure:dev Jan 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants