Skip to main content

local_users

Creates, updates, deletes, gets or lists a local_users resource.

Overview

Namelocal_users
TypeResource
Idazure.storage.local_users

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
allowAclAuthorizationbooleanIndicates whether ACL authorization is allowed for this user. Set it to false to disallow using ACL authorization.
extendedGroupsarraySupplementary group membership. Only applicable for local users enabled for NFSv3 access.
groupIdintegerAn identifier for associating a group of users.
hasSharedKeybooleanIndicates whether shared key exists. Set it to false to remove existing shared key.
hasSshKeybooleanIndicates whether ssh key exists. Set it to false to remove existing SSH key.
hasSshPasswordbooleanIndicates whether ssh password exists. Set it to false to remove existing SSH password.
homeDirectorystringOptional, local user home directory.
isNFSv3EnabledbooleanIndicates if the local user is enabled for access with NFSv3 protocol.
permissionScopesarrayThe permission scopes of the local user.
sidstringA unique Security Identifier that is generated by the server.
sshAuthorizedKeysarrayOptional, local user ssh authorized keys for SFTP.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".
userIdintegerA unique Identifier that is generated by the server.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, account_name, username, subscription_idGet the local user of the storage account by username.
listselectresource_group_name, account_name, subscription_id$maxpagesize, $filter, $includeList the local users associated with the storage account.
create_or_updateinsertresource_group_name, account_name, username, subscription_idCreate 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_updatereplaceresource_group_name, account_name, username, subscription_idCreate 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.
deletedeleteresource_group_name, account_name, username, subscription_idDeletes the local user associated with the specified storage account.
list_keysexecresource_group_name, account_name, username, subscription_idList SSH authorized keys and shared key of the local user.
regenerate_passwordexecresource_group_name, account_name, username, subscription_idRegenerate 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.

NameDatatypeDescription
account_namestringThe 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_namestringThe name of the resource group. The name is case insensitive. Required.
subscription_idstring
usernamestringThe name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. Required.
$filterstringOptional. When specified, only local user names starting with the filter will be listed. Default value is None.
$includestringOptional, when specified, will list local users enabled for the specific protocol. Lists all users by default. "nfsv3" Default value is None.
$maxpagesizeinteger

SELECT examples

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
;

INSERT examples

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
;

REPLACE examples

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

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 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
;