Skip to content
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

[SQL] Bump sdk version #18373

Merged
merged 51 commits into from
Jun 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
4dc4fec
Bump sdk version
strehan1993 Jun 7, 2021
ed94334
Switch to LongTermRetentionPolicies
strehan1993 Jun 7, 2021
974197c
Fix sql db threat-policy
strehan1993 Jun 7, 2021
98e01c4
some test fixes
strehan1993 Jun 7, 2021
be7f737
Fix threat detection
strehan1993 Jun 7, 2021
a597a4e
re-record test_sql_server_security_mgmt
strehan1993 Jun 8, 2021
8bbd2c5
Merge branch 'dev' into wmt
strehan1993 Jun 8, 2021
d31effe
Fix tde tests
strehan1993 Jun 9, 2021
879dd77
add more passing tests
strehan1993 Jun 9, 2021
1d2056b
fix ltr test
strehan1993 Jun 9, 2021
90ad543
Fix elastic pool
strehan1993 Jun 9, 2021
cc2e65e
fix sql mi aad tests
strehan1993 Jun 9, 2021
910554a
Failover group
strehan1993 Jun 9, 2021
655c14a
fix firewall rule
strehan1993 Jun 9, 2021
f6e4ca1
Fix for tde byok
strehan1993 Jun 9, 2021
a65282f
push test file
strehan1993 Jun 10, 2021
b17f89c
Skip MI tests
strehan1993 Jun 10, 2021
123f455
skip server trust groups
strehan1993 Jun 10, 2021
bf5b73d
Add dns alias management
strehan1993 Jun 14, 2021
b5e813e
fix backupstorageredundancy
strehan1993 Jun 14, 2021
00e1e84
backupstorage related fixes
strehan1993 Jun 14, 2021
22eb890
Push test files
strehan1993 Jun 14, 2021
d81e3ee
Fix test_sql_db_sensitivity_classifications, skip instance pools
strehan1993 Jun 15, 2021
4dba8bf
Push sens classification re-record
strehan1993 Jun 15, 2021
999c005
retry sensitivity test
strehan1993 Jun 15, 2021
b95c63f
Fix instance group failover management
strehan1993 Jun 15, 2021
7420e68
restore db test passing
xaliciayang Jun 17, 2021
4050b51
record restore deleted
xaliciayang Jun 18, 2021
bf9fe76
skip restore deleted and classification
strehan1993 Jun 18, 2021
118d9d8
management endpoint
xaliciayang Jun 18, 2021
738c4a4
Merge branch 'wmt' of https://github.com/strehan1993/azure-cli into wmt
xaliciayang Jun 18, 2021
9907c7d
remove skip tag
xaliciayang Jun 18, 2021
9b6502a
rerecord import export
xaliciayang Jun 20, 2021
deff7e6
modify validators to separate db and MI
xaliciayang Jun 21, 2021
df8756d
change back MI to expect LRS/ZRS/GRS
xaliciayang Jun 21, 2021
3225c89
Add CMK changes
viparek Jun 22, 2021
f5a4685
Fix linter and style issues
viparek Jun 22, 2021
f97f2fa
remove current_bsr from create params
xaliciayang Jun 22, 2021
e04c85e
Merge pull request #1 from strehan1993/viparek/cmk
strehan1993 Jun 22, 2021
2440513
Fix failure due to --ids
strehan1993 Jun 23, 2021
cc2d4c5
more fixes, tests and linter
strehan1993 Jun 23, 2021
3908cc4
More linter issues
strehan1993 Jun 23, 2021
980dd23
External admin changes
strehan1993 Jun 23, 2021
9a0fc24
Style and Linter fixes
strehan1993 Jun 23, 2021
2d4cf83
Fix show command
strehan1993 Jun 23, 2021
1ab342e
Fix more style issues
strehan1993 Jun 23, 2021
e0e6f5b
Add help for external admin
strehan1993 Jun 23, 2021
156e69d
linter fix
strehan1993 Jun 24, 2021
bfd969a
Add examples for CMK with UMI
viparek Jun 24, 2021
0a2834f
Merge pull request #2 from strehan1993/viparek/addhelp
strehan1993 Jun 24, 2021
bca0525
more linter fixes
strehan1993 Jun 24, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/azure-cli/azure/cli/command_modules/sql/_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,16 +244,15 @@ def elastic_pool_transform(result):
'''
Transforms the json response for an elastic pool.
'''
from azure.mgmt.sql.models import ElasticPoolEdition

# Add properties in order to improve backwards compatibility with api-version 2014-04-01
result.edition = result.sku.tier
result.storageMb = result.max_size_bytes / 1024 / 1024

is_dtu = result.sku.tier in (
ElasticPoolEdition.basic.value,
ElasticPoolEdition.standard.value,
ElasticPoolEdition.premium.value)
'Basic',
'Standard',
'Premium')
strehan1993 marked this conversation as resolved.
Show resolved Hide resolved

result.dtu = result.sku.capacity if is_dtu else None
result.database_dtu_min = int(result.per_database_settings.min_capacity) if is_dtu else None
Expand Down
42 changes: 42 additions & 0 deletions src/azure-cli/azure/cli/command_modules/sql/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,20 @@
text: az sql mi create -g mygroup -n myinstance -l mylocation -i -u myusername -p mypassword --license-type LicenseIncluded --subnet /subscriptions/{SubID}/resourceGroups/{ResourceGroup}/providers/Microsoft.Network/virtualNetworks/{VNETName}/subnets/{SubnetName} --capacity 8 --storage 32GB --edition GeneralPurpose --family Gen5 --backup-storage-redundancy Local
- name: Create a managed instance with maintenance configuration
text: az sql mi create -g mygroup -n myinstance -l mylocation -i -u myusername -p mypassword --subnet /subscriptions/{SubID}/resourceGroups/{ResourceGroup}/providers/Microsoft.Network/virtualNetworks/{VNETName}/subnets/{SubnetName} -m SQL_{Region}_{MaintenanceConfigName}
- name: Create a managed instance without SQL Admin, with AAD admin and AD Only enabled
text: az sql mi create --enable-ad-only-auth --external-admin-principal-type User --external-admin-name myUserName --external-admin-sid c5e964e2-6bb2-2222-1111-3b16ec0e1234 -g myResourceGroup -n miName --subnet /subscriptions/78975f9f-2222-1111-1111-29c42ac70000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/vnet-test/subnets/ManagedInstance
strehan1993 marked this conversation as resolved.
Show resolved Hide resolved
- name: Create a managed instance without SQL Admin, with AD admin, AD Only enabled, User ManagedIdenties and Identity Type is SystemAssigned,UserAssigned.
text: az sql mi create --enable-ad-only-auth --external-admin-principal-type User --external-admin-name myUserName \\
--external-admin-sid c5e964e2-6bb2-1111-1111-3b16ec0e1234 -g myResourceGroup -n myServer -i \\
--user-assigned-identity-id /subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testumi \\
--identity-type SystemAssigned,UserAssigned --pid /subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testumi \\
--subnet /subscriptions/78975f9f-2222-1111-1111-29c42ac70000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/vnet-test/subnets/ManagedInstance
- name: Create a managed instance without SQL Admin, with AD admin, AD Only enabled, User ManagedIdenties and Identity Type is UserAssigned.
text: az sql mi create --enable-ad-only-auth --external-admin-principal-type User --external-admin-name myUserName \\
--external-admin-sid c5e964e2-6bb2-1111-1111-3b16ec0e1234 -g myResourceGroup -n myServer -i \\
--user-assigned-identity-id /subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testumi \\
--identity-type UserAssigned --pid /subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testumi \\
--subnet /subscriptions/78975f9f-2222-1111-1111-29c42ac70000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/vnet-test/subnets/ManagedInstance
"""

helps['sql mi delete'] = """
Expand Down Expand Up @@ -848,6 +862,14 @@
text: az sql mi update -g mygroup -n myinstance -m SQL_{Region}_{MaintenanceConfigName}
- name: Remove maintenance configuration from managed instance
text: az sql mi update -g mygroup -n myinstance -m SQL_Default
- name: Update a managed instance with User Managed Identies and Identity Type is SystemAssigned,UserAssigned.
text: az sql mi update -g myResourceGroup -n myServer -i \\
--user-assigned-identity-id /subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testumi \\
--identity-type SystemAssigned,UserAssigned --pid /subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testumi
- name: Update a managed instance with User Managed Identies and Identity Type is UserAssigned.
text: az sql mi update -g myResourceGroup -n myServer -i \\
--user-assigned-identity-id /subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testumi \\
--identity-type UserAssigned --pid /subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testumi
"""

helps['sql midb'] = """
Expand Down Expand Up @@ -1255,6 +1277,18 @@
text: az sql server create -l westus -g mygroup -n myserver -u myadminuser -p myadminpassword
- name: Create a server with disabled public network access to server.
text: az sql server create -l westus -g mygroup -n myserver -u myadminuser -p myadminpassword -e false
- name: Create a server without SQL Admin, with AD admin and AD Only enabled.
text: az sql server create --enable-ad-only-auth --external-admin-principal-type User --external-admin-name myUserName --external-admin-sid c5e964e2-6bb2-1111-1111-3b16ec0e1234 -g myResourceGroup -n myServer
- name: Create a server without SQL Admin, with AD admin, AD Only enabled, User ManagedIdenties and Identity Type is SystemAssigned,UserAssigned.
text: az sql server create --enable-ad-only-auth --external-admin-principal-type User --external-admin-name myUserName \\
--external-admin-sid c5e964e2-6bb2-1111-1111-3b16ec0e1234 -g myResourceGroup -n myServer -i \\
--user-assigned-identity-id /subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testumi \\
--identity-type SystemAssigned,UserAssigned --pid /subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testumi
- name: Create a server without SQL Admin, with AD admin, AD Only enabled, User ManagedIdenties and Identity Type is UserAssigned.
text: az sql server create --enable-ad-only-auth --external-admin-principal-type User --external-admin-name myUserName \\
--external-admin-sid c5e964e2-6bb2-1111-1111-3b16ec0e1234 -g myResourceGroup -n myServer -i \\
--user-assigned-identity-id /subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testumi \\
--identity-type UserAssigned --pid /subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testumi
"""

helps['sql server dns-alias'] = """
Expand Down Expand Up @@ -1353,6 +1387,14 @@
- name: Update a server. (autogenerated)
text: az sql server update --admin-password myadminpassword --name MyAzureSQLServer --resource-group MyResourceGroup
crafted: true
- name: Update a server with User Managed Identies and Identity Type is SystemAssigned,UserAssigned.
text: az sql server update -g myResourceGroup -n myServer -i \\
--user-assigned-identity-id /subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testumi \\
--identity-type SystemAssigned,UserAssigned --pid /subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testumi
- name: Update a server with User Managed Identies and Identity Type is UserAssigned.
text: az sql server update -g myResourceGroup -n myServer -i \\
--user-assigned-identity-id /subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testumi \\
--identity-type UserAssigned --pid /subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testumi
"""

helps['sql server vnet-rule'] = """
Expand Down
Loading