Skip to content

SQL VM IaaS Extension fixes and AKV Support #751

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 6 commits into from
Sep 14, 2015
Merged

Conversation

OJDUDE
Copy link

@OJDUDE OJDUDE commented Aug 14, 2015

  1. The AutoBackup feature includes private settings in the public
    settings section. The fix was to add a public settings class that is
    used to manage the AutoBackup settings in the set and get command.
    The change does not impact the cmdlet interface or the objects used to
    configure AutoBackup. The change is internal to the feature
    implementation.The AutoBackup syntax command is still the same. 2. SQL VM Azure key Vault Integration
    This is a new feature is added to configure SQL Connector to access
    Azure Key Vault on a SQL IaaS VM. The feature is only available for SQL
    Server 2012 and higher version. A new set of classes is added to manage
    Collecting the Azure Key Vault settings and new SQL credential settings.
    The user would provide the key vault url, principal name and secret and
    the SQL credential name. The user can enable \ disable the feature
    Using the Enable switch option. By default the feature is disabled. Get-AzureVM -ServiceName $serviceName -Name $vmName |
    Set-AzureVMSqlServerExtension -KeyVaultCredentialSettings $akvs |
    Update-AzureVM

The change also update the extension status. The status output now
includes the KeyVaultSettings object
Get-AzureVM -ServiceName $serviceName -Name $vmName |
Get-AzureVMSqlServerExtension

The following is a sample output of the get command
ExtensionName : SqlIaaSAgent
Publisher : Microsoft.SqlServer.Management
Version : 1.*
State : Enable
RoleName : afexttest
AutoPatchingSettings :
Microsoft.WindowsAzure.Commands.ServiceManagement.IaaS.Extensions.AutoPatchingSettings
AutoBackupSettings :
Microsoft.WindowsAzure.Commands.ServiceManagement.IaaS.Extensions.AutoBackupSettings
KeyVaultCredentialSettings :
Microsoft.WindowsAzure.Commands.ServiceManagement.IaaS.Extensions.KeyVaultCredentialSettings

OJDUDE added 3 commits August 7, 2015 22:50
The files in this change implement two changes:

1. The AutoBackup feature includes private settings in the public
settings section.  The fix was to add a public settings class that is
used to manage the AutoBackup settings in the set and get command.
The change does not impact the cmdlet interface or the objects used to
configure AutoBackup. The change is internal to the feature
implementation.

The AutoBackup syntax command is still the same. Here is an example:
$storageaccount = "nobrooklyninfrawe"
$storageaccountkey = (Get-AzureStorageKey -StorageAccountName
$storageaccount).Primary
$storagecontext = New-AzureStorageContext -StorageAccountName
$storageaccount -StorageAccountKey $storageaccountkey
$password = "P@ssw0rd"
$encryptionpassword = $password | ConvertTo-SecureString -AsPlainText
-Force
$autobackupconfig = New-AzureVMSqlServerAutoBackupConfig -StorageContext
$storagecontext -Enable -RetentionPeriod 10 -EnableEncryption
-CertificatePassword $encryptionpassword

Get-AzureVM -ServiceName $serviceName -Name $vmName |
Set-AzureVMSqlServerExtension -AutoBackupSettings $autobackupconfig |
Update-AzureVM

2. SQL VM Azure key Vault Integration
This is a new feature is added to configure SQL Connector to access
Azure Key Vault on a SQL IaaS VM. The feature is only available for SQL
Server 2012 and higher version. A new set of classes is added to manage
Collecting the Azure Key Vault settings and new SQL credential settings.
The user would provide the key vault url, principal name and secret and
the SQL credential name. The user can enable \ disable the feature
Using the Enable switch option. By default the feature is disabled. The
following is an example to enable the feature:

$akvsecret = "3j432j4lj32lk4j32lk4jlk32j4l32j4lj32lj4l32j4lk"
$secureakv =  $akvsecret | ConvertTo-SecureString -AsPlainText -Force
$akvs = New-AzureVMSqlServerKeyVaultCredentialConfig -Enable
-CredentialName mycredzz11 -AzureKeyVaultUrl
"http://afSqlKVT.vault.azure.net" -ServicePrincipalName
"jljlj3l-s4d4c-9d2d-42428ed7" -ServicePrincipalSecret $secureakv

Get-AzureVM -ServiceName $serviceName -Name $vmName |
Set-AzureVMSqlServerExtension -KeyVaultCredentialSettings $akvs |
Update-AzureVM

The change also update the extension status. The status output now
includes the KeyVaultSettings object
Get-AzureVM -ServiceName $serviceName -Name $vmName |
Get-AzureVMSqlServerExtension

The following is a sample output of the get command
ExtensionName              : SqlIaaSAgent
Publisher                  : Microsoft.SqlServer.Management
Version                    : 1.*
State                      : Enable
RoleName                   : afexttest
AutoPatchingSettings       :
Microsoft.WindowsAzure.Commands.ServiceManagement.IaaS.Extensions.AutoPatchingSettings
AutoBackupSettings         :
Microsoft.WindowsAzure.Commands.ServiceManagement.IaaS.Extensions.AutoBackupSettings
KeyVaultCredentialSettings :
Microsoft.WindowsAzure.Commands.ServiceManagement.IaaS.Extensions.KeyVaultCredentialSettings
In the previous change, default settings were used for AKV and
AutoBackup if the settings are not entered by the user. This is the
wrong behavior as it would always update the VM with the default
settings for feature that the user did not include in the set command.
1. Don't print or attempt to print private settings from the Get.
Instead print *** if the options are set.

2. Print a message to educate the user when disabling Azure key vault
that existing credentials will not be removed but AKV status will not be
reported.

3. Update the help file.

4. No new tests are required as the current tests already cover the
changes in this changeset.
@azuresdkci
Copy link

Can one of the admins verify this patch?

@azurecla
Copy link

Hi @OJDUDE, 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;

@ogail
Copy link
Contributor

ogail commented Aug 14, 2015

@OJDUDE please pull from upstream and resolve conflicts

@OJDUDE
Copy link
Author

OJDUDE commented Aug 15, 2015

This is now update and all conflicts resolved

@ogail
Copy link
Contributor

ogail commented Aug 15, 2015

@azuresdkci add to whitelist

@OJDUDE
Copy link
Author

OJDUDE commented Aug 15, 2015

Thanks for the update

@markcowl
Copy link
Member

@OJDUDE This has merge conflicts - can you please update?

@markcowl
Copy link
Member

@OJDUDE If you are an ms employee, please add yopurself to the organization. If you are not, please sign the CLA

@azurecla
Copy link

@OJDUDE, Thanks for signing the contribution license agreement so quickly! Actual humans will now validate the agreement and then evaluate the PR.

Thanks, AZPRBOT;

@markcowl
Copy link
Member

@OJDUDE Are you plannign to update this PR< or should I close it?

@OJDUDE
Copy link
Author

OJDUDE commented Aug 28, 2015

Why are you planning to close it. The Azure CLA process is the reason I got delayed not me. I will be updating. We need this for the September release. Don't close it.

@OJDUDE
Copy link
Author

OJDUDE commented Aug 28, 2015

Why are you planning to close it. The Azure CLA process is the reason I got delayed not me. I will be updating. We need this for the September release. Don't close it.

From: Mark Cowlishaw [mailto:[email protected]]
Sent: Friday, August 28, 2015 1:58 PM
To: Azure/azure-powershell [email protected]
Cc: Omar Jaber [email protected]
Subject: Re: [azure-powershell] SQL VM IaaS Extension fixes and AKV Support (#751)

@OJDUDEhttps://na01.safelinks.protection.outlook.com/?url=https%3a%2f%2fi.8713187.xyz%2fOJDUDE&data=01%7c01%7comjaber%40microsoft.com%7c68167d935353488f3eb308d2afeb4b03%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=PqppmyL79BBMqv3IgwoHMPfBz0O3x%2fblVJFZiieKosQ%3d Are you plannign to update this PR< or should I close it?


Reply to this email directly or view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3a%2f%2fi.8713187.xyz%2fAzure%2fazure-powershell%2fpull%2f751%23issuecomment-135886174&data=01%7c01%7comjaber%40microsoft.com%7c68167d935353488f3eb308d2afeb4b03%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=gNBBV8whJxErpZESX%2fAB%2bDHj%2b0NA%2biE8YHDJ3BVAXqE%3d.

@OJDUDE
Copy link
Author

OJDUDE commented Aug 29, 2015

I have just updated due a single conflict in the setup files. This always happens and auto merge fails on it. Can you please merge the change.

@OJDUDE
Copy link
Author

OJDUDE commented Aug 29, 2015

The PR is updated. If you could please merge it.

Thanks,
Omar

From: Mark Cowlishaw [mailto:[email protected]]
Sent: Friday, August 28, 2015 1:58 PM
To: Azure/azure-powershell [email protected]
Cc: Omar Jaber [email protected]
Subject: Re: [azure-powershell] SQL VM IaaS Extension fixes and AKV Support (#751)

@OJDUDEhttps://na01.safelinks.protection.outlook.com/?url=https%3a%2f%2fi.8713187.xyz%2fOJDUDE&data=01%7c01%7comjaber%40microsoft.com%7c68167d935353488f3eb308d2afeb4b03%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=PqppmyL79BBMqv3IgwoHMPfBz0O3x%2fblVJFZiieKosQ%3d Are you plannign to update this PR< or should I close it?


Reply to this email directly or view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3a%2f%2fi.8713187.xyz%2fAzure%2fazure-powershell%2fpull%2f751%23issuecomment-135886174&data=01%7c01%7comjaber%40microsoft.com%7c68167d935353488f3eb308d2afeb4b03%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=gNBBV8whJxErpZESX%2fAB%2bDHj%2b0NA%2biE8YHDJ3BVAXqE%3d.

@markcowl
Copy link
Member

@azuresdkci retest this please

@OJDUDE
Copy link
Author

OJDUDE commented Aug 31, 2015

Thanks Mark for following up on this on your day off.

@OJDUDE
Copy link
Author

OJDUDE commented Aug 31, 2015

Could you please test and merge this change please.

@OJDUDE
Copy link
Author

OJDUDE commented Sep 3, 2015

Branch is updated. This is a comment to trigger the test.

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.

6 participants