Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
a2f6b6c
Initial updates to use track 2 Hub GA SDK
c-ryan-k Mar 3, 2021
45cadfb
WIP initial user-assigned identity functionality
c-ryan-k Mar 16, 2021
2acf8e6
Added routing endpoint identity and added some preliminary test code
c-ryan-k Mar 17, 2021
b613397
Updated identity code with enums and minor logic updates
c-ryan-k Mar 18, 2021
b3208a4
More identity updates, role and scope assignment
c-ryan-k Mar 18, 2021
ee48812
Minor fixes to identity functions and return values
c-ryan-k Mar 19, 2021
ee807a0
Linting fixes
c-ryan-k Mar 19, 2021
ea84c66
WIP testing updates
c-ryan-k Mar 19, 2021
44117af
Merge branch 'azure-dev' into hub_track2
c-ryan-k Mar 26, 2021
fa2dbb8
Help/Param updates and minor tweaks/fixes
c-ryan-k Mar 30, 2021
691950d
Test updates, help updates, polling updates
c-ryan-k Mar 30, 2021
8fc4f2e
Test recording updates
c-ryan-k Mar 31, 2021
1282c05
test updates
c-ryan-k Apr 6, 2021
0a76443
minor fix in consumer_group_create, test updates
c-ryan-k Apr 6, 2021
5060def
Initial updates to use track 2 Hub GA SDK
c-ryan-k Mar 3, 2021
14fa27d
WIP initial user-assigned identity functionality
c-ryan-k Mar 16, 2021
bc5e641
Added routing endpoint identity and added some preliminary test code
c-ryan-k Mar 17, 2021
8779d9a
Updated identity code with enums and minor logic updates
c-ryan-k Mar 18, 2021
889f42c
More identity updates, role and scope assignment
c-ryan-k Mar 18, 2021
90342f9
Minor fixes to identity functions and return values
c-ryan-k Mar 19, 2021
9b25700
Linting fixes
c-ryan-k Mar 19, 2021
850ab5e
WIP testing updates
c-ryan-k Mar 19, 2021
a65084e
Help/Param updates and minor tweaks/fixes
c-ryan-k Mar 30, 2021
c92c45f
Test updates, help updates, polling updates
c-ryan-k Mar 30, 2021
5f5e1e2
Test recording updates
c-ryan-k Mar 31, 2021
df59fbf
test updates
c-ryan-k Apr 6, 2021
e6308da
minor fix in consumer_group_create, test updates
c-ryan-k Apr 6, 2021
47e700a
Merge branch 'hub_track2' of https://github.com/c-ryan-k/azure-cli in…
c-ryan-k Apr 12, 2021
0214f61
Test updates and new recordings
c-ryan-k Apr 12, 2021
3ea6fc4
Merge branch 'azure-dev' into hub_track2
c-ryan-k Apr 20, 2021
a29fe37
Fix for ARM issue - user identity object must be empty upon removal o…
c-ryan-k Apr 27, 2021
1a0ceeb
Updates to use stable multiapi SDK (2021-03-03) with backfill for dev…
c-ryan-k Apr 28, 2021
d1b5f0d
Merge branch 'dev' into hub_track2
c-ryan-k Apr 28, 2021
ef103b3
Help/Param string updates
c-ryan-k Apr 28, 2021
fb759e6
Version fix for new SDK (2021-03-31)
c-ryan-k Apr 29, 2021
bdc3f5a
Parameter updates
c-ryan-k May 11, 2021
a599f8b
Test and recording updates
c-ryan-k May 11, 2021
cd59e5a
Certificate create/update fixes and test updates
c-ryan-k May 11, 2021
4e8d6a3
Add DeviceConnectionStateEvents as a routing source type
c-ryan-k May 13, 2021
0ab2ae5
RoutingSource test updates
c-ryan-k May 14, 2021
20992a8
SDK version update to 2.0.0
c-ryan-k May 14, 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
Prev Previous commit
Next Next commit
Help/Param string updates
  • Loading branch information
c-ryan-k committed Apr 28, 2021
commit ef103b3fdb5da20e1f238b5b72949cb6ee31e227
18 changes: 9 additions & 9 deletions src/azure-cli/azure/cli/command_modules/iot/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@
- name: Create an IoT Hub with the standard pricing tier S1 and 4 partitions, in the 'westus' region, with tags.
text: >
az iot hub create --resource-group MyResourceGroup --name MyIotHub --location westus --tags a=b c=d
- name: Create an IoT Hub with a system-assigned identity, and assign a role and scope to a storage account for the created system identity.
- name: Create an IoT Hub with a system-assigned managed identity, and assign a role and scope to a storage account for the created identity.
text: >
az iot hub create --resource-group MyResourceGroup --name MyIotHub --location westus --assign-identity [system] --role "Storage Blob Data Contributor" --scopes {resourceId}
"""
Expand Down Expand Up @@ -438,12 +438,12 @@

helps['iot hub identity assign'] = """
type: command
short-summary: Assign identities to an IoT Hub
short-summary: Assign managed identities to an IoT Hub
examples:
- name: Assign a user-assigned identity to an IoT Hub
- name: Assign a user-assigned managed identity to an IoT Hub
text: >
az iot hub identity assign --name MyIoTHub --resource-group MyResourceGroup --identities {resourceId}
- name: Assign a system-assigned identity to an IoT Hub and assign a role to that identity.
- name: Assign a system-assigned managed identity to an IoT Hub and assign a role to that identity.
text: >
az iot hub identity assign --name MyIoTHub --resource-group MyResourceGroup --identities [system] --role "Storage Blob Data Contributor" --scopes {resourceId}
"""
Expand All @@ -459,12 +459,12 @@

helps['iot hub identity remove'] = """
type: command
short-summary: Remove identities from an IoT Hub
short-summary: Remove managed identities from an IoT Hub
examples:
- name: Remove a user-assigned identity to an IoT Hub
- name: Remove a user-assigned managed identity from an IoT Hub
text: >
az iot hub identity remove --name MyIoTHub --resource-group MyResourceGroup --identities {resourceId}
- name: Remove a system-assigned identity from an IoT Hub.
- name: Remove a system-assigned managed identity from an IoT Hub.
text: >
az iot hub identity remove --name MyIoTHub --resource-group MyResourceGroup --identities [system]
"""
Expand Down Expand Up @@ -694,7 +694,7 @@
--endpoint-subscription-id {SubscriptionId} --connection-string {ConnectionString} \\
--container-name {ContainerName} --batch-frequency 100 --chunk-size 100 \\
--ff {iothub}-{partition}-{YYYY}-{MM}-{DD}-{HH}-{mm}
- name: Add a new identity-based EventHub endpoint named "EventHubIdentity" and authenticate using a user-assigned identity
- name: Add a new identity-based EventHub endpoint named "EventHubIdentity" and authenticate using a user-assigned managed identity
text: >
az iot hub routing-endpoint create --resource-group MyResourceGroup --hub-name MyIotHub --endpoint-name EventHubIdentity --endpoint-type eventhub --endpoint-resource-group {ResourceGroup} --endpoint-subscription-id {SubscriptionId} --auth-type identityBased --identity {userIdentityResourceId} --endpoint-uri {EventHubEndpointUri} --entity-path {EntityPath}
"""
Expand Down Expand Up @@ -820,7 +820,7 @@
- name: Update the IoT Hub feedback queue settings
text: >
az iot hub update --name MyIoTHub --feedback-max-delivery-count 20 --feedback-lock-duration 100 --feedback-ttl 4
- name: Update the IoT Hub file upload settings
- name: Update the IoT Hub file upload settings, and assign a managed identity to user for file upload)
text: >
az iot hub update -n MyIoTHub --fileupload-sas-ttl 5 --fileupload-storage-auth-type identityBased --fileupload-storage-identity [system]
- name: Update the IoT Hub file upload notification settings
Expand Down
8 changes: 4 additions & 4 deletions src/azure-cli/azure/cli/command_modules/iot/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,23 +181,23 @@ def load_arguments(self, _): # pylint: disable=too-many-statements
c.argument('fileupload_storage_identity',
options_list=['--fileupload-storage-identity', '--fsi'],
help="The managed identity to use for file upload authentication. Use '[system]' to "
"refer to the system-assigned identity or a resource ID to refer to a user-assigned identity.")
"refer to the system-assigned managed identity or a resource ID to refer to a user-assigned managed identity.")
c.argument('min_tls_version', options_list=['--min-tls-version', '--mintls'],
type=str, help='Specify the minimum TLS version to support for this hub. Can be set to'
' "1.2" to have clients that use a TLS version below 1.2 to be rejected.')
c.argument('tags', tags_type)
c.argument('identities', options_list=['--assign-identity'],
nargs='*', help="Accepts system or user assigned identities separated by spaces. Use '[system]'"
nargs='*', help="Accepts system or user-assigned managed identities separated by spaces. Use '[system]'"
" to refer to the system-assigned identity or a resource ID to refer to a user-assigned identity.")
c.argument('identity_role', options_list=['--role'],
help="Role to assign to the hub's system-assigned identity")
help="Role to assign to the hub's system-assigned managed identity")
c.argument('identity_scopes', options_list=['--scopes'], nargs='*',
help="Space separated list of scopes to assign the role (--role) "
"for the system-assigned managed identity.")

with self.argument_context('iot hub identity') as c:
c.argument('identities', options_list=['--identities'],
nargs='*', help="Accepts system or user assigned identities separated by spaces. Use '[system]'"
nargs='*', help="Accepts system or user-assigned managed identities separated by spaces. Use '[system]'"
" to refer to the system-assigned identity or a resource ID to refer to a user-assigned identity.")

for subgroup in ['consumer-group', 'policy', 'certificate', 'routing-endpoint', 'route']:
Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli/azure/cli/command_modules/iot/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ def iot_hub_create(cmd, client, hub_name, resource_group_name, location=None,
tags=tags)
hub_description.identity = _build_identity(identities) if identities else None
if bool(identity_role) ^ bool(identity_scopes):
raise CLIError('At least one scope (--scopes) and one role (--role) required for system-managed identity role assignment')
raise CLIError('At least one scope (--scopes) and one role (--role) required for system-assigned managed identity role assignment')

def identity_assignment(lro):
try:
Expand Down