Editar

Compartilhar via


New-AzStorageCache

Create or update a cache.

Syntax

New-AzStorageCache
   -Name <String>
   -ResourceGroupName <String>
   [-SubscriptionId <String>]
   [-CacheSizeGb <Int32>]
   [-DirectoryServicesSetting <ICacheDirectorySettings>]
   [-EncryptionSettingRotationToLatestKeyVersionEnabled]
   [-IdentityType <CacheIdentityType>]
   [-IdentityUserAssignedIdentity <Hashtable>]
   [-KeyEncryptionKeyUrl <String>]
   [-Location <String>]
   [-NetworkSettingDnsSearchDomain <String>]
   [-NetworkSettingDnsServer <String[]>]
   [-NetworkSettingMtu <Int32>]
   [-NetworkSettingNtpServer <String>]
   [-SecuritySettingAccessPolicy <INfsAccessPolicy[]>]
   [-SkuName <String>]
   [-SourceVaultId <String>]
   [-Subnet <String>]
   [-Tag <Hashtable>]
   [-UpgradeSettingScheduledTime <DateTime>]
   [-UpgradeSettingUpgradeScheduleEnabled]
   [-Zone <String[]>]
   [-DefaultProfile <PSObject>]
   [-AsJob]
   [-NoWait]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Create or update a cache.

Examples

Example 1: Create or update a cache.

New-AzStorageCache -Name azps-storagecache -ResourceGroupName azps_test_gp_storagecache -Location eastus -CacheSizeGb "3072" -Subnet "/subscriptions/{subId}/resourceGroups/azps_test_gp_storagecache_2/providers/Microsoft.Network/virtualNetworks/azps-virtual-network/subnets/default" -SkuName "Standard_2G" -Zone 1

Location Name              ResourceGroupName
-------- ----              -----------------
eastus   azps-storagecache azps_test_gp_storagecache

Create or update a cache.

Example 2: Create or update a cache.

New-AzStorageCache -Name azps-storagecache -ResourceGroupName azps_test_gp_storagecache -IdentityType 'UserAssigned' -IdentityUserAssignedIdentity @{"/subscriptions/{subId}/resourcegroups/azps_test_gp_storagecache/providers/Microsoft.ManagedIdentity/userAssignedIdentities/azps-management-identity" = @{}} -KeyEncryptionKeyUrl "https://azps-keyvault.vault.azure.net/keys/azps-kv/4cc795e46f114ce2a65b82b312964e0e" -SourceVaultId "/subscriptions/{subId}/resourceGroups/azps_test_gp_storagecache/providers/Microsoft.KeyVault/vaults/azps-keyvault" -Location eastus -CacheSizeGb "3072" -Subnet "/subscriptions/{subId}/resourceGroups/azps_test_gp_storagecache/providers/Microsoft.Network/virtualNetworks/azps-virtual-network/subnets/default" -SkuName "Standard_2G" -Zone 1

Location Name              ResourceGroupName
-------- ----              -----------------
eastus   azps-storagecache azps_test_gp_storagecache

Create or update a cache.

Parameters

-AsJob

Run the command as a job

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-CacheSizeGb

The size of this Cache, in GB.

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.

Type:PSObject
Aliases:AzureRMContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DirectoryServicesSetting

Specifies Directory Services settings of the cache. To construct, see NOTES section for DIRECTORYSERVICESSETTING properties and create a hash table.

Type:ICacheDirectorySettings
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-EncryptionSettingRotationToLatestKeyVersionEnabled

Specifies whether the service will automatically rotate to the newest version of the key in the key vault.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-IdentityType

The type of identity used for the cache

Type:CacheIdentityType
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-IdentityUserAssignedIdentity

A dictionary where each key is a user assigned identity resource ID, and each key's value is an empty dictionary.

Type:Hashtable
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-KeyEncryptionKeyUrl

The URL referencing a key encryption key in key vault.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Location

Region name string.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

Name of cache. Length of name must not be greater than 80 and chars must be from the [-0-9a-zA-Z_] char class.

Type:String
Aliases:CacheName
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-NetworkSettingDnsSearchDomain

DNS search domain

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-NetworkSettingDnsServer

DNS servers for the cache to use. It will be set from the network configuration if no value is provided.

Type:String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-NetworkSettingMtu

The IPv4 maximum transmission unit configured for the subnet.

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-NetworkSettingNtpServer

NTP server IP Address or FQDN for the cache to use. The default is time.windows.com.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-NoWait

Run the command asynchronously

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ResourceGroupName

The name of the resource group. The name is case insensitive.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-SecuritySettingAccessPolicy

NFS access policies defined for this cache. To construct, see NOTES section for SECURITYSETTINGACCESSPOLICY properties and create a hash table.

Type:INfsAccessPolicy[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-SkuName

SKU name for this cache.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-SourceVaultId

Resource Id.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Subnet

Subnet used for the cache.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-SubscriptionId

The ID of the target subscription.

Type:String
Position:Named
Default value:(Get-AzContext).Subscription.Id
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Tag

Resource tags.

Type:Hashtable
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-UpgradeSettingScheduledTime

When upgradeScheduleEnabled is true, this field holds the user-chosen upgrade time. At the user-chosen time, the firmware update will automatically be installed on the cache.

Type:DateTime
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-UpgradeSettingUpgradeScheduleEnabled

True if the user chooses to select an installation time between now and firmwareUpdateDeadline. Else the firmware will automatically be installed after firmwareUpdateDeadline if not triggered earlier via the upgrade operation.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Zone

Availability zones for resources. This field should only contain a single element in the array.

Type:String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Outputs

ICache