local_users
Creates, updates, deletes, gets or lists a local_users resource.
Overview
| Name | local_users |
| Type | Resource |
| Id | azure.storage.local_users |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
allowAclAuthorization | boolean | Indicates whether ACL authorization is allowed for this user. Set it to false to disallow using ACL authorization. |
extendedGroups | array | Supplementary group membership. Only applicable for local users enabled for NFSv3 access. |
groupId | integer | An identifier for associating a group of users. |
hasSharedKey | boolean | Indicates whether shared key exists. Set it to false to remove existing shared key. |
hasSshKey | boolean | Indicates whether ssh key exists. Set it to false to remove existing SSH key. |
hasSshPassword | boolean | Indicates whether ssh password exists. Set it to false to remove existing SSH password. |
homeDirectory | string | Optional, local user home directory. |
isNFSv3Enabled | boolean | Indicates if the local user is enabled for access with NFSv3 protocol. |
permissionScopes | array | The permission scopes of the local user. |
sid | string | A unique Security Identifier that is generated by the server. |
sshAuthorizedKeys | array | Optional, local user ssh authorized keys for SFTP. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
userId | integer | A unique Identifier that is generated by the server. |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
allowAclAuthorization | boolean | Indicates whether ACL authorization is allowed for this user. Set it to false to disallow using ACL authorization. |
extendedGroups | array | Supplementary group membership. Only applicable for local users enabled for NFSv3 access. |
groupId | integer | An identifier for associating a group of users. |
hasSharedKey | boolean | Indicates whether shared key exists. Set it to false to remove existing shared key. |
hasSshKey | boolean | Indicates whether ssh key exists. Set it to false to remove existing SSH key. |
hasSshPassword | boolean | Indicates whether ssh password exists. Set it to false to remove existing SSH password. |
homeDirectory | string | Optional, local user home directory. |
isNFSv3Enabled | boolean | Indicates if the local user is enabled for access with NFSv3 protocol. |
permissionScopes | array | The permission scopes of the local user. |
sid | string | A unique Security Identifier that is generated by the server. |
sshAuthorizedKeys | array | Optional, local user ssh authorized keys for SFTP. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
userId | integer | A unique Identifier that is generated by the server. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | resource_group_name, account_name, username, subscription_id | Get the local user of the storage account by username. | |
list | select | resource_group_name, account_name, subscription_id | $maxpagesize, $filter, $include | List the local users associated with the storage account. |
create_or_update | insert | resource_group_name, account_name, username, subscription_id | Create or update the properties of a local user associated with the storage account. Properties for NFSv3 enablement and extended groups cannot be set with other properties. | |
create_or_update | replace | resource_group_name, account_name, username, subscription_id | Create or update the properties of a local user associated with the storage account. Properties for NFSv3 enablement and extended groups cannot be set with other properties. | |
delete | delete | resource_group_name, account_name, username, subscription_id | Deletes the local user associated with the specified storage account. | |
list_keys | exec | resource_group_name, account_name, username, subscription_id | List SSH authorized keys and shared key of the local user. | |
regenerate_password | exec | resource_group_name, account_name, username, subscription_id | Regenerate the local user SSH password. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
account_name | string | The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. Required. |
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
subscription_id | string | |
username | string | The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. Required. |
$filter | string | Optional. When specified, only local user names starting with the filter will be listed. Default value is None. |
$include | string | Optional, when specified, will list local users enabled for the specific protocol. Lists all users by default. "nfsv3" Default value is None. |
$maxpagesize | integer |
SELECT examples
- get
- list
Get the local user of the storage account by username.
SELECT
id,
name,
allowAclAuthorization,
extendedGroups,
groupId,
hasSharedKey,
hasSshKey,
hasSshPassword,
homeDirectory,
isNFSv3Enabled,
permissionScopes,
sid,
sshAuthorizedKeys,
systemData,
type,
userId
FROM azure.storage.local_users
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND account_name = '{{ account_name }}' -- required
AND username = '{{ username }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
List the local users associated with the storage account.
SELECT
id,
name,
allowAclAuthorization,
extendedGroups,
groupId,
hasSharedKey,
hasSshKey,
hasSshPassword,
homeDirectory,
isNFSv3Enabled,
permissionScopes,
sid,
sshAuthorizedKeys,
systemData,
type,
userId
FROM azure.storage.local_users
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND account_name = '{{ account_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND $maxpagesize = '{{ $maxpagesize }}'
AND $filter = '{{ $filter }}'
AND $include = '{{ $include }}'
;
INSERT examples
- create_or_update
- Manifest
Create or update the properties of a local user associated with the storage account. Properties for NFSv3 enablement and extended groups cannot be set with other properties.
INSERT INTO azure.storage.local_users (
properties,
resource_group_name,
account_name,
username,
subscription_id
)
SELECT
'{{ properties }}',
'{{ resource_group_name }}',
'{{ account_name }}',
'{{ username }}',
'{{ subscription_id }}'
RETURNING
id,
name,
properties,
systemData,
type
;
# Description fields are for documentation purposes
- name: local_users
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the local_users resource.
- name: account_name
value: "{{ account_name }}"
description: Required parameter for the local_users resource.
- name: username
value: "{{ username }}"
description: Required parameter for the local_users resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the local_users resource.
- name: properties
description: |
Storage account local user properties.
value:
permissionScopes:
- permissions: "{{ permissions }}"
service: "{{ service }}"
resourceName: "{{ resourceName }}"
homeDirectory: "{{ homeDirectory }}"
sshAuthorizedKeys:
- description: "{{ description }}"
key: "{{ key }}"
sid: "{{ sid }}"
hasSharedKey: {{ hasSharedKey }}
hasSshKey: {{ hasSshKey }}
hasSshPassword: {{ hasSshPassword }}
userId: {{ userId }}
groupId: {{ groupId }}
allowAclAuthorization: {{ allowAclAuthorization }}
extendedGroups:
- {{ extendedGroups }}
isNFSv3Enabled: {{ isNFSv3Enabled }}
REPLACE examples
- create_or_update
Create or update the properties of a local user associated with the storage account. Properties for NFSv3 enablement and extended groups cannot be set with other properties.
REPLACE azure.storage.local_users
SET
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND account_name = '{{ account_name }}' --required
AND username = '{{ username }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
properties,
systemData,
type;
DELETE examples
- delete
Deletes the local user associated with the specified storage account.
DELETE FROM azure.storage.local_users
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND account_name = '{{ account_name }}' --required
AND username = '{{ username }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;
Lifecycle Methods
- list_keys
- regenerate_password
List SSH authorized keys and shared key of the local user.
EXEC azure.storage.local_users.list_keys
@resource_group_name='{{ resource_group_name }}' --required,
@account_name='{{ account_name }}' --required,
@username='{{ username }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Regenerate the local user SSH password.
EXEC azure.storage.local_users.regenerate_password
@resource_group_name='{{ resource_group_name }}' --required,
@account_name='{{ account_name }}' --required,
@username='{{ username }}' --required,
@subscription_id='{{ subscription_id }}' --required
;