Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
130 commits
Select commit Hold shift + click to select a range
fd6af49
{ARO} add __init__.py for ARO tests and update recording (#13089)
Apr 20, 2020
ad2a70f
{Profile} az login: Polish UnicodeDecodeError (#12972)
jiasli Apr 20, 2020
8937383
{Aladdin} add usage examples for module: monitor network privatedns r…
Apr 20, 2020
66fe624
[Compute] az vmss disk detach: fix data disk NoneType issue (#13069)
arrownj Apr 20, 2020
2989946
[ARO] Fixed az aro table output bug (#13066)
m1kola Apr 20, 2020
758f7e9
fix CI (#13114)
mmyyrroonn Apr 22, 2020
9abb510
[Core] fix logging file fd leaking (#13102)
Apr 22, 2020
0ae790c
[AppService] remove sleep after request.get() (#12609)
bmc-msft Apr 22, 2020
2862ce5
[Network] az network security-partner: support security partner provi…
mmyyrroonn Apr 22, 2020
89cf88c
[KeyVault] Add new parameter `--enable-rbac-authorization` during cre…
bim-msft Apr 22, 2020
21172d9
[AKS] az aks create: Add support for Windows (#13084)
AbelHu Apr 23, 2020
facd2bd
fix ci (#13132)
mmyyrroonn Apr 23, 2020
b3d6fb7
{ACR} Fix small typos (#13142)
pablomh Apr 24, 2020
fdc155c
{Compute} Delete stale test of image builder (#13134)
qwordy Apr 24, 2020
12367f8
rename (#13147)
mmyyrroonn Apr 24, 2020
4a58bcb
[Core] fix core tests failed under certain profiles (#13136)
Apr 24, 2020
b93fab1
[Privatedns] Add feature in private DNS zone to import export zone fi…
rahisshaikh Apr 26, 2020
d10679e
{Resource} Remove resource test test_resource_policyset from profile …
Apr 26, 2020
f4ff610
[Monitor] Support LA cluster CMK features (#13133)
jsntcy Apr 26, 2020
80c7bc7
{Core} support get msal accesstoken with adal refresh token for vm ss…
arrownj Apr 26, 2020
4e1ed61
{REST} az rest: Refine help (#13067)
jiasli Apr 26, 2020
dada5c0
{Compute} Update doc of image-version (#13112)
qwordy Apr 27, 2020
5fff003
[Compute] az vm availability-set list: Support showing VM list (#13090)
qwordy Apr 27, 2020
32e5102
[ACS] BREAKING CHANGE: ARO remove vnet-peer, upgrade to 2019-10-27-pr…
Apr 27, 2020
984817c
[Compute] az vm list-skus: Fix display problem of table format (#13184)
qwordy Apr 27, 2020
79964fb
[Monitor] az monitor log-analytics workspace linked-storage: supports…
mmyyrroonn Apr 27, 2020
d261ede
[CI] Onboard pytest and deprecate nose for Automation Test (#13153)
Apr 27, 2020
a638130
[ARM] az deployment sub/group what-if:Add new commands to support Wha…
shenglol Apr 27, 2020
44c3b4a
[Core] Unpin wheel version via pkginfo to query metadata for Python P…
Apr 27, 2020
06cce5b
revert wheel to 0.30.0 (#13198)
Apr 27, 2020
2349420
update azure-cli version to 2.5.0 (#13206)
Apr 28, 2020
37fcdc6
fix style (#13218)
Juliehzl Apr 28, 2020
69c9933
{CI} Fix running full test timeout on profile when in batch mode (#13…
Apr 28, 2020
21e8a2c
upgrade package (#13183)
Juliehzl Apr 28, 2020
cf7f852
[Storage] Support GZRS for storage account creation and update (#13196)
Juliehzl Apr 28, 2020
015be59
[SQL] `az sql instance-pool`: Add instance pools command group (#11721)
rohands Apr 28, 2020
c8edc08
re-run (#13224)
mmyyrroonn Apr 28, 2020
d60ceda
[Compute] vm list-ip-addresses: Error handling (#13186)
qwordy Apr 28, 2020
35c140c
{Network} fix duplicated quotes for private-endpoint example (#13227)
Apr 28, 2020
91f91cc
[Extension] fix loading wrong metadata for wheel type extension (#13222)
Apr 28, 2020
3315616
[Cosmos DB] az cosmosdb create/update: add --enable-public-network su…
soeom Apr 28, 2020
16de64f
[ACR] `az acr check-health`: Fix "DOCKER_PULL_ERROR" on Windows (#13158)
Wwwsylvia Apr 29, 2020
b302f30
[Compute] Fix a bug of vm create if endpoint_vm_image_alias_doc is no…
qwordy Apr 29, 2020
868decc
[Packaging] Add az script for Git Bash/Cygwin on Windows (#13197)
fengzhou-msft Apr 29, 2020
154ecaa
[Compute] vmss create: Add --os-disk-size-gb (#13180)
qwordy Apr 29, 2020
1d64349
{Packaging} Remove wheel as a runtime dependency (#13230)
fengzhou-msft Apr 29, 2020
bd8a963
[Storage] `az storage account failover`: Add support for grs/gzrs sto…
Juliehzl Apr 30, 2020
4acf761
{Extension} Enhance the ability to filter extension's dist-info in or…
Apr 30, 2020
6fc125b
[Storage] `az storage blob upload`: Add --encryption-scope parameter …
Juliehzl Apr 30, 2020
c8bb769
upgarde version (#13265)
Juliehzl Apr 30, 2020
ba399c7
{Release} Upgrade to Azure CLI 2.5.1 (#13263)
Apr 30, 2020
527267b
{Profile} az login: In WSL use powershell.exe to open the default bro…
jiasli Apr 30, 2020
2aa71a7
pass test for connection string (#13273)
Juliehzl Apr 30, 2020
44c092a
{Config} Add endpoint suffix for mysql and postgre sql (#13115)
handsomesun May 6, 2020
f4f44bd
[AppService] functionapp: AzureWebJobsDashboard will only be set if A…
gzuber May 6, 2020
b7a41a3
fix in enable protection for fileshare cmd (#13268)
May 6, 2020
066ca6e
Fix in restore flow (#13348)
May 6, 2020
2325d7c
{Docs} Quote code in help messages with backticks (#13060)
jiasli May 6, 2020
7674236
[Extension] Support installing extensions in a system directory (#12856)
fengzhou-msft May 6, 2020
2343260
[AppService] fix #10664- VNet Integration - Location Check Issue & fi…
Kotasudhakarreddy May 6, 2020
7a087b1
[IoT] Update the IoT command module first run extension awareness mes…
digimaun May 7, 2020
949aaa0
[Network] fix ttl value changed unintended for dns add-record (#13243)
May 7, 2020
e6a19f2
[Compute] New command az vm auto-shutdown (#13199)
qwordy May 7, 2020
a2ab44e
refine help message (#13372)
mmyyrroonn May 7, 2020
cd405fa
ACS: remove fields cleanup that no longer exist (#13315)
May 7, 2020
da047a1
[AKS] update uptime-sla command help context (#13300)
zqingqing1 May 7, 2020
a6fc7da
[Extension] support .egg-info to store wheel type extension metadata …
May 7, 2020
26e341b
[AppConfig] Bug fix for list key values with fields (#13326)
shenmuxiaosen May 7, 2020
df10af0
{AppService}: Updating websites to use the latest SDK version (#13328)
panchagnula May 7, 2020
cef3cf4
{CI} temporary disable CredScan since ADO bug (#13388)
May 8, 2020
f2fa95a
acr: add timeout of 5 minutes (#13349)
yugangw-msft May 8, 2020
08328cd
{Packaging} Clean some azure-cli dependencies (#13253)
fengzhou-msft May 8, 2020
c3f32ed
[ACR] Support disable public network access (#13347)
yugangw-msft May 8, 2020
aa9c4c1
[ARM] az deployment: Fix the problem that the templateLink will not b…
zhoxing-ms May 8, 2020
2de661c
{Storage} Use get_login_credentials from Core for --auth-mode login i…
Juliehzl May 8, 2020
28cc8f4
Bump ADAL version to 1.2.3 (#13371)
jiasli May 8, 2020
4b495b0
[Network] az network public-ip create: Inform customers of a coming b…
jsntcy May 8, 2020
a15c836
[ARO] Add examples to az aro create, list, list-credentials, show, de…
troy0820 May 9, 2020
f04507a
Update python SDK (#13287)
soeom May 9, 2020
14ecf9e
[Storage] az storage account file-service-properties update/show: Add…
Juliehzl May 9, 2020
05d6f12
[ACR]: bug fixes on token create and image import commands (#13392)
yugangw-msft May 9, 2020
137fcc8
{CI} Allow CI to pass on fork repos (#13398)
jiasli May 9, 2020
193c17c
{Docs} Documentation update for configuring machine in VS Code (#13239)
niswitze May 9, 2020
3c8bf29
Fixes az openshift show command (#13358)
m1kola May 9, 2020
5f3c3da
Fix the problem that deployment does not support specially encoded ch…
zhoxing-ms May 9, 2020
70bedda
{Compute} az vm auto-shutdown: remove a validation (#13409)
qwordy May 11, 2020
938bbaf
[RBAC] `az ad sp credential reset`: fix weak credential generation (#…
qianwens May 11, 2020
0caf144
[Network] support generic commands for private link scenario (#13225)
mmyyrroonn May 11, 2020
bd3dfd5
[Network] az network private-endpoint-connection: Support mysql, post…
mmyyrroonn May 11, 2020
197fcf6
acr: keep show-endpoints command in preview (#13430)
yugangw-msft May 11, 2020
0fc82ed
[AMS] Change az ams transform create and az ams content-key-policy cr…
hivyas May 12, 2020
827774b
[Packaging] Build MSI/Homebrew packages with dependecies resolved fro…
fengzhou-msft May 12, 2020
fce911e
[CI] Support flake8 3.8.0 (#13454)
May 12, 2020
b465b2a
{Docs} Increase visibility of doc/use_cli_effectively.md (#13249)
jiasli May 13, 2020
50a18e8
[Network] az network private-endpoint-connection: Support cosmosdb ty…
mmyyrroonn May 13, 2020
0ce0448
[Core] Update local context on/off status to global user level (#13277)
arrownj May 13, 2020
830672d
remove range check for updating min count for autoscaler (#13215)
marwanad May 13, 2020
c07a398
{CI} Code style check use latest azdev (#13450)
May 13, 2020
fe18bc1
[AppService] az webapp|functionapp config ssl import: Lookup key vaul…
madsd May 14, 2020
df5cfde
{CI} Re-enable CredScan (#13464)
May 14, 2020
39c0d01
[ARM] az deployment sub/group what-if: Fix array alignment and error …
shenglol May 14, 2020
3d1fc80
change sappservice code (#13412)
Juliehzl May 14, 2020
f629608
{ACR} Use azure.multiapi.storage for storage blob service (#13411)
Juliehzl May 14, 2020
bcb9921
{batchai} Change storage dependency (#13414)
Juliehzl May 14, 2020
a6a469f
{TestSDK} Delete local context file when local context scenario test …
arrownj May 14, 2020
8f149eb
[ARO]Add generate_random_id function (#13482)
troy0820 May 14, 2020
863517e
{Resource} Remove unused f-string to fix code style (#13493)
May 14, 2020
8027e06
{Doc} Add quoting-issues-with-powershell.md (#13419)
jiasli May 14, 2020
989924e
{Core} Load vnet/subnet global definition for local context by defaul…
arrownj May 14, 2020
a70d7db
Added "MAB" backupmanagementtype to item list command (#13449)
May 14, 2020
ca63e5d
[Backup] Add support for retrying policy update for failed items. (#1…
May 14, 2020
28b1422
[Backup] Add Resume Protection functionality for Azure Virtual Machin…
May 14, 2020
2c3097b
[Backup] Add support to specify ResourceGroup for storing instantRP d…
May 14, 2020
73ee5ce
[Storage] `az storage container create`: Fix #13373 by adding validat…
Juliehzl May 14, 2020
e6e437a
[Output] Show update instruction in find, feedback and --help (#13345)
fengzhou-msft May 14, 2020
2439cc8
[Storage] Add ADLS Gen2 track2 support (#12729)
Juliehzl May 15, 2020
50cedea
{ACR}: expose --expiration from token commands (#13451)
yugangw-msft May 15, 2020
f7e6bba
Fix that cli doe not fail when user only specifies Windows password (…
AbelHu May 15, 2020
cb927d5
[Compute] az vm list-skus: Update --zone behavior, return all type sk…
qwordy May 15, 2020
58198af
[IoT Hub] Support for 2020-03-01 API and Network Isolation commands (…
c-ryan-k May 15, 2020
2e850ea
{Monitor} az monitor metrics alert: refine severity explanation (#13512)
mmyyrroonn May 15, 2020
80457eb
[AppService] Onboard local context for app service (#12984)
arrownj May 15, 2020
4d73f0f
Modify the deprecate information for deployment operation (#13390)
zhoxing-ms May 15, 2020
08432df
Support --connect-string for az storage blob sync (#13135)
zhoxing-ms May 15, 2020
9b71e8a
[Storage] az storage blob sync: Fix the incorrect error message when …
zhoxing-ms May 15, 2020
bae215b
{Network} az network nic create: Refine help message (#13513)
mmyyrroonn May 15, 2020
ee84afb
[NetAppFiles] Anf 5207 Bugfix - add missing snapshot restore function…
audunn May 15, 2020
fe1e042
{Resource} Add example to tell how to pass array to --parameters (#13…
May 16, 2020
530cd07
fix (#13511)
mmyyrroonn May 18, 2020
029e73b
{Release} Upgrade to Azure CLI 2.6.0 (#13542)
May 18, 2020
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
Prev Previous commit
Next Next commit
[Monitor] az monitor log-analytics workspace linked-storage: supports…
… BYOS features (#13187)

* finish code

recording

finish tests

* address comments and rerun tests

* refine logic

* address comments

* fix style
  • Loading branch information
mmyyrroonn authored Apr 27, 2020
commit 79964fb5ec46abb010362d8a812c75ad7a7e87ca
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,7 @@ def cf_log_analytics_workspace_linked_service(cli_ctx, _):

def cf_log_analytics_cluster(cli_ctx, _):
return _log_analytics_client_factory(cli_ctx).clusters


def cf_log_analytics_linked_storage(cli_ctx, _):
return _log_analytics_client_factory(cli_ctx).linked_storage_accounts
54 changes: 54 additions & 0 deletions src/azure-cli/azure/cli/command_modules/monitor/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -1103,6 +1103,60 @@
text: az monitor log-analytics workspace linked-service wait -n cluster -g MyResourceGroup --workspace-name MyWorkspace --created
"""

helps['monitor log-analytics workspace linked-storage'] = """
type: group
short-summary: Manage linked storage account for log analytics workspace.
"""

helps['monitor log-analytics workspace linked-storage create'] = """
type: command
short-summary: Create some linked storage accounts for log analytics workspace.
examples:
- name: Create two linked storage accounts for a log analytics workspace
text: az monitor log-analytics workspace linked-storage create --type AzureWatson -g MyResourceGroup --workspace-name MyWorkspace --storage-accounts SA1 SA2
"""

helps['monitor log-analytics workspace linked-storage delete'] = """
type: command
short-summary: Delete all linked storage accounts with specific data source type for log analytics workspace.
examples:
- name: Delete all linked storage accounts with a specific type for a log analytics workspace
text: az monitor log-analytics workspace linked-storage delete --type AzureWatson -g MyResourceGroup --workspace-name MyWorkspace
"""

helps['monitor log-analytics workspace linked-storage add'] = """
type: command
short-summary: Add some linked storage accounts with specific data source type for log analytics workspace.
examples:
- name: Add two linked storage accounts for a log analytics workspace
text: az monitor log-analytics workspace linked-storage add --type AzureWatson -g MyResourceGroup --workspace-name MyWorkspace --storage-accounts SA1 SA2
"""

helps['monitor log-analytics workspace linked-storage remove'] = """
type: command
short-summary: Remove some linked storage accounts with specific data source type for log analytics workspace
examples:
- name: Remove two linked storage accounts for a log analytics workspace
text: az monitor log-analytics workspace linked-storage remove --type AzureWatson -g MyResourceGroup --workspace-name MyWorkspace --storage-accounts SA1 SA2.
"""

helps['monitor log-analytics workspace linked-storage list'] = """
type: command
short-summary: List all linked storage accounts for a log analytics workspace.
examples:
- name: List all linked storage accounts for a log analytics workspace
text: az monitor log-analytics workspace linked-storage list -g MyResourceGroup --workspace-name MyWorkspace

"""

helps['monitor log-analytics workspace linked-storage show'] = """
type: command
short-summary: List all linked storage accounts with specific data source type for a log analytics workspace.
examples:
- name: Show all linked storage accounts with a specific type for a log analytics workspace
text: az monitor log-analytics workspace linked-storage show --type AzureWatson -g MyResourceGroup --workspace-name MyWorkspace
"""

helps['monitor log-profiles'] = """
type: group
short-summary: Manage log profiles.
Expand Down
17 changes: 16 additions & 1 deletion src/azure-cli/azure/cli/command_modules/monitor/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from azure.cli.command_modules.monitor.util import get_operator_map, get_aggregation_map
from azure.cli.command_modules.monitor.validators import (
process_webhook_prop, validate_autoscale_recurrence, validate_autoscale_timegrain, get_action_group_validator,
get_action_group_id_validator, validate_metric_dimension)
get_action_group_id_validator, validate_metric_dimension, validate_storage_accounts_name_or_id)

from knack.arguments import CLIArgumentType

Expand Down Expand Up @@ -339,6 +339,11 @@ def load_arguments(self, _):
c.argument('workspace_name', options_list=['--workspace-name', '-n'], help="Name of the Log Analytics Workspace.")
c.ignore('sku')
c.argument('retention_time', help="The workspace data retention in days.", type=int, default=30)
from azure.mgmt.loganalytics.models import PublicNetworkAccessType
c.argument('public_network_access_for_ingestion', options_list=['--ingestion-access'], help='The public network access type to access workspace ingestion.',
arg_type=get_enum_type(PublicNetworkAccessType))
c.argument('public_network_access_for_query', options_list=['--query-access'], help='The public network access type to access workspace query.',
arg_type=get_enum_type(PublicNetworkAccessType))

with self.argument_context('monitor log-analytics workspace pack') as c:
c.argument('intelligence_pack_name', options_list=['--name', '-n'])
Expand Down Expand Up @@ -371,6 +376,16 @@ def load_arguments(self, _):
c.argument('key_version', help='The version of the key associated with the Log Analytics cluster.')
# endregion

# region Log Analytics Linked Storage Account
with self.argument_context('monitor log-analytics workspace linked-storage') as c:
from azure.mgmt.loganalytics.models import DataSourceType
c.argument('data_source_type', help='Data source type for the linked storage account.',
options_list=['--type'], arg_type=get_enum_type(DataSourceType))
c.argument('storage_account_ids', nargs='+', options_list=['--storage-accounts'],
help='List of Name or ID of Azure Storage Account.',
validator=validate_storage_accounts_name_or_id)
# endregion

# region monitor clone
with self.argument_context('monitor clone') as c:
c.argument('source_resource', help="Resource ID of the source resource.")
Expand Down
36 changes: 28 additions & 8 deletions src/azure-cli/azure/cli/command_modules/monitor/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def load_command_table(self, _):
cf_log_analytics_workspace_intelligence_packs, cf_log_analytics_cluster,
cf_log_analytics_workspace_linked_service, cf_diagnostics_category,
cf_private_link_resources, cf_private_link_scoped_resources,
cf_private_link_scopes, cf_private_endpoint_connections)
cf_private_link_scopes, cf_private_endpoint_connections, cf_log_analytics_linked_storage)
from ._exception_handler import monitor_exception_handler, missing_resource_handler
from .transformers import (action_group_list_table)
from .validators import process_autoscale_create_namespace, validate_private_endpoint_connection_id,\
Expand Down Expand Up @@ -229,6 +229,18 @@ def load_command_table(self, _):
exception_handler=monitor_exception_handler
)

log_analytics_linked_storage_sdk = CliCommandType(
operations_tmpl='azure.mgmt.loganalytics.operations#LinkedStorageAccountsOperations.{}',
client_factory=cf_log_analytics_linked_storage,
exception_handler=monitor_exception_handler
)

log_analytics_linked_storage_custom = CliCommandType(
operations_tmpl='azure.cli.command_modules.monitor.operations.log_analytics_linked_storage_account#{}',
client_factory=cf_log_analytics_linked_storage,
exception_handler=monitor_exception_handler
)

monitor_general_custom = CliCommandType(
operations_tmpl='azure.cli.command_modules.monitor.operations.general_operations#{}',
client_factory=cf_metric_alerts,
Expand Down Expand Up @@ -345,7 +357,7 @@ def load_command_table(self, _):
g.command('enable', 'enable')
g.command('disable', 'disable')

with self.command_group('monitor log-analytics workspace linked-service', log_analytics_workspace_linked_service_sdk, custom_command_type=log_analytics_workspace_linked_service_custom) as g:
with self.command_group('monitor log-analytics workspace linked-service', log_analytics_workspace_linked_service_sdk, custom_command_type=log_analytics_workspace_linked_service_custom, is_preview=True) as g:
g.custom_command('create', 'create_log_analytics_workspace_linked_service', supports_no_wait=True)
g.generic_update_command('update', custom_func_name='update_log_analytics_workspace_linked_service', supports_no_wait=True)
g.show_command('show', 'get')
Expand All @@ -361,28 +373,36 @@ def load_command_table(self, _):
g.custom_command('list', 'list_log_analytics_clusters')
g.wait_command('wait')

with self.command_group('monitor', metric_alert_sdk, custom_command_type=monitor_general_custom, is_preview=True) as g:
g.custom_command('clone', 'clone_existed_settings')
with self.command_group('monitor log-analytics workspace linked-storage', log_analytics_linked_storage_sdk, custom_command_type=log_analytics_linked_storage_custom, is_preview=True) as g:
g.command('create', 'create_or_update')
g.custom_command('add', 'add_log_analytics_workspace_linked_storage_accounts')
g.custom_command('remove', 'remove_log_analytics_workspace_linked_storage_accounts')
g.command('delete', 'delete', confirmation=True)
g.show_command('show', 'get')
g.command('list', 'list_by_workspace')

with self.command_group('monitor', metric_alert_sdk, custom_command_type=monitor_general_custom) as g:
g.custom_command('clone', 'clone_existed_settings', is_preview=True)

with self.command_group('monitor private-link-scope', private_link_scopes_sdk, custom_command_type=private_link_scope_custom) as g:
with self.command_group('monitor private-link-scope', private_link_scopes_sdk, custom_command_type=private_link_scope_custom, is_preview=True) as g:
g.custom_show_command('show', 'show_private_link_scope')
g.custom_command('list', 'list_private_link_scope')
g.custom_command('create', 'create_private_link_scope')
g.custom_command('update', 'update_private_link_scope')
g.custom_command('delete', 'delete_private_link_scope', confirmation=True)

with self.command_group('monitor private-link-scope scoped-resource', private_link_scoped_resources_sdk, custom_command_type=private_link_scope_custom) as g:
with self.command_group('monitor private-link-scope scoped-resource', private_link_scoped_resources_sdk, custom_command_type=private_link_scope_custom, is_preview=True) as g:
g.custom_show_command('show', 'show_private_link_scope_resource', client_factory=cf_private_link_scoped_resources)
g.custom_command('list', 'list_private_link_scope_resource', client_factory=cf_private_link_scoped_resources)
g.custom_command('create', 'create_private_link_scope_resource', client_factory=cf_private_link_scoped_resources)
g.custom_command('delete', 'delete_private_link_scope_resource', client_factory=cf_private_link_scoped_resources, confirmation=True)

with self.command_group('monitor private-link-scope private-link-resource', private_link_resources_sdk, custom_command_type=private_link_scope_custom) as g:
with self.command_group('monitor private-link-scope private-link-resource', private_link_resources_sdk, custom_command_type=private_link_scope_custom, is_preview=True) as g:
g.custom_show_command('show', 'show_private_link_resource', client_factory=cf_private_link_resources)
from azure.cli.core.commands.transform import gen_dict_to_list_transform
g.custom_command('list', 'list_private_link_resource', client_factory=cf_private_link_resources, transform=gen_dict_to_list_transform(key="value"))

with self.command_group('monitor private-link-scope private-endpoint-connection', private_endpoint_connections_sdk, custom_command_type=private_link_scope_custom) as g:
with self.command_group('monitor private-link-scope private-endpoint-connection', private_endpoint_connections_sdk, custom_command_type=private_link_scope_custom, is_preview=True) as g:
g.custom_show_command('show', 'show_private_endpoint_connection', client_factory=cf_private_endpoint_connections,
validator=validate_private_endpoint_connection_id)
g.custom_command('list', 'list_private_endpoint_connection', client_factory=cf_private_endpoint_connections)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------


def add_log_analytics_workspace_linked_storage_accounts(client, resource_group_name, workspace_name,
data_source_type, storage_account_ids):
linked_storage_accounts = client.get(resource_group_name=resource_group_name,
workspace_name=workspace_name,
data_source_type=data_source_type)
linked_storage_accounts.storage_account_ids.extend(storage_account_ids)
return client.create_or_update(resource_group_name=resource_group_name,
workspace_name=workspace_name,
data_source_type=data_source_type,
storage_account_ids=linked_storage_accounts.storage_account_ids)


def remove_log_analytics_workspace_linked_storage_accounts(client, resource_group_name, workspace_name,
data_source_type, storage_account_ids):
linked_storage_accounts = client.get(resource_group_name=resource_group_name,
workspace_name=workspace_name,
data_source_type=data_source_type)
storage_account_ids_set = set(str.lower(storage_account_id) for storage_account_id in storage_account_ids)
for existed_storage_account_id in linked_storage_accounts.storage_account_ids:
if str.lower(existed_storage_account_id) in storage_account_ids_set:
linked_storage_accounts.storage_account_ids.remove(existed_storage_account_id)
return client.create_or_update(resource_group_name=resource_group_name,
workspace_name=workspace_name,
data_source_type=data_source_type,
storage_account_ids=linked_storage_accounts.storage_account_ids)
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,33 @@


def create_log_analytics_workspace(cmd, client, resource_group_name, workspace_name, location=None, tags=None,
sku=WorkspaceSkuNameEnum.per_gb2018.value, retention_time=None):
sku=WorkspaceSkuNameEnum.per_gb2018.value, retention_time=None,
public_network_access_for_query=None, public_network_access_for_ingestion=None):
from azure.mgmt.loganalytics.models import Workspace, WorkspaceSku
from azure.cli.core.commands import LongRunningOperation
workspace_client = client
sku = WorkspaceSku(name=sku)
workspace_instance = Workspace(location=location,
tags=tags,
sku=sku,
retention_in_days=retention_time)
retention_in_days=retention_time,
public_network_access_for_query=public_network_access_for_query,
public_network_access_for_ingestion=public_network_access_for_ingestion)
return LongRunningOperation(cmd.cli_ctx)(workspace_client.create_or_update(resource_group_name,
workspace_name,
workspace_instance))


def update_log_analytics_workspace(instance, tags=None, retention_time=None):
def update_log_analytics_workspace(instance, tags=None, retention_time=None,
public_network_access_for_query=None, public_network_access_for_ingestion=None):
if tags is not None:
instance.tags = tags
if retention_time is not None:
instance.retention_in_days = retention_time
if public_network_access_for_query is not None:
instance.public_network_access_for_query = public_network_access_for_query
if public_network_access_for_ingestion is not None:
instance.public_network_access_for_ingestion = public_network_access_for_ingestion
return instance


Expand Down
Loading