Skip to content

AzureRmVMDiagnostics command change [yantang] #1381

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 8 commits into from
Dec 3, 2015
Merged

Conversation

yantang-msft
Copy link
Contributor

Hi, this code is changed by Microsoft FTE from azure tools team. Alias: yantang
The change aimed at making AzureRmVMDiagnostics related command more reasonable to use, also fixed some bugs. Detailed changes are listed below.

Set-AzureRMVMDiagnosticsExtension
a) Make StorageContext optional, and make -StorageAccountName -StorageAccountKey as optional parameter
a. Can parse account name from config file if not specified
b. Can get the account key if not specified and account is under current subs
c. Handle storage endpoint address.
b) Fix bug so that user can use a storage account in a different subscription other than the current one.
c) Make -Name an optional parameter, default to "Microsoft.Insights.VMDiagnosticsSettings"
d) Make -Location optional, default to using the VM's location.
e) -Version Optional parameter, default is 1.5
f) -AutoUpgradeMinorVersion optional, default is true

Get-AzureRMVMDiagnosticsExtension & Remove-AzureRMVMDiagnosticsExtension
a) Make -Name optional parameter

@azurecla
Copy link

azurecla commented Dec 1, 2015

Hi @yantang-msft, I'm your friendly neighborhood Azure Pull Request Bot (You can call me AZPRBOT). Thanks for your contribution!

In order for us to evaluate and accept your PR, we ask that you sign a contribution license agreement. It's all electronic and will take just minutes. I promise there's no faxing. https://cla.azure.com.

TTYL, AZPRBOT;

@azuresdkci
Copy link

Can one of the admins verify this patch?

@yantang-msft
Copy link
Contributor Author

For testing, Get and Remove is fairly easy, just specify the ResourceGroupName and VMName name. I've tested locally for the case with/without diagnostics extension.
For Set, ResourceGroupName, VMName, DiagnosticsConfigurationFilePath is required. Other parameters should be automatically resolved in most cases. The only special parameter is StorageAccountKey. If the StorageAccountName is not within current subscription, then user must specify the key as well since we can't resolve it.
I've tested the case for using storage within same resource group, within current subscription but different resource group and storage in another subscription. I can see the diagnostics logs sent to the storage tables.

There is also a known issue, if there is already an diagnostics extension, user must first Remove the extension then Set.

Let me know if you have any other questions (alias: yantang).

@markcowl
Copy link
Member

markcowl commented Dec 1, 2015

@azuresdkci add to whitelist

[Cmdlet(
VerbsCommon.Set,
ProfileNouns.VirtualMachineDiagnosticsExtension)]
public class SetAzureVMDiagnosticsExtensionCommand : VirtualMachineExtensionBaseCmdlet
Copy link
Contributor

Choose a reason for hiding this comment

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

please change the class name to reflect cmdlet name change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Resolved

@hovsepm
Copy link
Contributor

hovsepm commented Dec 2, 2015

@yantang-msft please change all class names in your PR to reflect cmdlet name (see my comment in SetAzureRmVMDiagnosticsExtension.cs).

@hovsepm
Copy link
Contributor

hovsepm commented Dec 2, 2015

Also add tests to verify changed functionality.

@markcowl
Copy link
Member

markcowl commented Dec 2, 2015

@yantang-msft Please address review feedback. Note that code complete is EOD today, so this PR is at risk of slipping until the January release

@yantang-msft
Copy link
Contributor Author

@hovsepm @markcowl Comments addressed, with "adding test case" pending.
We've manually tested E2E scenarios within our team. Will send another pull request to add test cases, hopefully this week.

hovsepm pushed a commit that referenced this pull request Dec 3, 2015
AzureRmVMDiagnostics command change [yantang]
@hovsepm hovsepm merged commit 9ffca4d into Azure:dev Dec 3, 2015
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