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:

OK -- Get the local user properties successfully.

NameDatatypeDescription
idstring (arm-id)Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
namestringThe name of the resource
propertiesobjectStorage account local user properties.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresourceGroupName, accountName, subscriptionId, usernameGet the local user of the storage account by username.
listselectresourceGroupName, accountName, subscriptionId$maxpagesize, $filter, $includeList the local users associated with the storage account.
create_or_updateinsertresourceGroupName, accountName, subscriptionId, usernameCreate 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.
deletedeleteresourceGroupName, accountName, subscriptionId, usernameDeletes the local user associated with the specified storage account.
regenerate_passwordexecresourceGroupName, accountName, subscriptionId, usernameRegenerate 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
accountNamestringThe 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.
resourceGroupNamestringThe name of the resource group within the user's subscription. The name is case insensitive.
subscriptionIdstring (uuid)The ID of the target subscription. The value must be an UUID.
usernamestringThe name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account.
$filterstringOptional. When specified, only local user names starting with the filter will be listed.
$includestringOptional, when specified, will list local users enabled for the specific protocol. Lists all users by default.
$maxpagesizeinteger (int32)Optional, specifies the maximum number of local users that will be included in the list response.

SELECT examples

Get the local user of the storage account by username.

SELECT
id,
name,
properties,
systemData,
type
FROM azure.storage.local_users
WHERE resourceGroupName = '{{ resourceGroupName }}' -- required
AND accountName = '{{ accountName }}' -- required
AND subscriptionId = '{{ subscriptionId }}' -- required
AND username = '{{ username }}' -- 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 (
data__properties,
resourceGroupName,
accountName,
subscriptionId,
username
)
SELECT
'{{ properties }}',
'{{ resourceGroupName }}',
'{{ accountName }}',
'{{ subscriptionId }}',
'{{ username }}'
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 resourceGroupName = '{{ resourceGroupName }}' --required
AND accountName = '{{ accountName }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
AND username = '{{ username }}' --required
;

Lifecycle Methods

Regenerate the local user SSH password.

EXEC azure.storage.local_users.regenerate_password 
@resourceGroupName='{{ resourceGroupName }}' --required,
@accountName='{{ accountName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required,
@username='{{ username }}' --required
;