Azure / azure-powershell

Microsoft Azure PowerShell
Other
4.26k stars 3.86k forks source link

New-AzVmssConfig missing -SecurityType parameter #24013

Closed stan-spotts closed 9 months ago

stan-spotts commented 9 months ago

Description

As documented here: https://learn.microsoft.com/en-us/powershell/module/az.compute/new-azvmconfig?view=azps-11.2.0#-securitytype

New-AzVMConfig should have a -SecurityType parameter. But it does not recognize one. I see only these:

Name Aliases SwitchParameter
VMName {ResourceName, Name} False
VMSize {} False
AvailabilitySetId {} False
LicenseType {} False
IdentityType {} False
IdentityId {} False
Zone {} False
ProximityPlacementGroupId {} False
HostId {} False
VmssId {} False
MaxPrice {} False
EvictionPolicy {} False
Priority {} False
Tags {Tag} False
EnableUltraSSD {} True
EncryptionAtHost {} True
CapacityReservationGroupId {} False
ImageReferenceId {} False
DiskControllerType {} False
UserData {} False
PlatformFaultDomain {} False
HibernationEnabled {} True
vCPUCountAvailable {} False
vCPUCountPerCore {} False
DefaultProfile {AzContext, AzureRmContext, AzureCredential} False
Verbose {vb} True
Debug {db} True
ErrorAction {ea} False
WarningAction {wa} False
InformationAction {infa} False
ErrorVariable {ev} False
WarningVariable {wv} False
InformationVariable {iv} False
OutVariable {ov} False
OutBuffer {ob} False
PipelineVariable {pv} False

Issue script & Debug output

PS> $vmconfig = New-AzVMConfig -VMName $vmname -vmsize $VMsize -SecurityType $securityTypeStnd

New-AzVMConfig : A parameter cannot be found that matches parameter name 'SecurityType'.
At line:1 char:60
+ ...  New-AzVMConfig -VMName $vmname -vmsize $VMsize -SecurityType $securi ...
+                                                     ~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [New-AzVMConfig], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.Azure.Commands.Compute.NewAzureVMConfigCommand

Environment data

Name                           Value
----                           -----
PSVersion                      5.1.19041.3930
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.3930
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Module versions

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     9.3.0      az
Script     2.11.1     Az.Accounts                         {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, C...
Script     2.0.0      Az.Advisor                          {Disable-AzAdvisorRecommendation, Enable-AzAdvisorReco...
Script     5.2.0      Az.Aks                              {Disable-AzAksAddOn, Enable-AzAksAddOn, Get-AzAksClust...
Script     1.1.4      Az.AnalysisServices                 {Add-AzAnalysisServicesAccount, Export-AzAnalysisServi...
Script     4.0.2      Az.ApiManagement                    {Add-AzApiManagementApiToGateway, Add-AzApiManagementA...
Script     1.2.0      Az.AppConfiguration                 {Clear-AzAppConfigurationDeletedStore, Get-AzAppConfig...
Script     2.2.1      Az.ApplicationInsights              {Get-AzApplicationInsights, Get-AzApplicationInsightsA...
Script     2.0.0      Az.Attestation                      {Add-AzAttestationPolicySigner, Get-AzAttestationPolic...
Script     1.9.0      Az.Automation                       {Export-AzAutomationDscConfiguration, Export-AzAutomat...
Script     3.3.0      Az.Batch                            {Disable-AzBatchAutoScale, Disable-AzBatchComputeNodeS...
Script     2.0.0      Az.Billing                          {Get-AzBillingAccount, Get-AzBillingInvoice, Get-AzBil...
Script     2.1.0      Az.Cdn                              {Clear-AzCdnEndpointContent, Clear-AzFrontDoorCdnEndpo...
Script     1.1.0      Az.CloudService                     {Get-AzCloudService, Get-AzCloudServiceInstanceView, G...
Script     1.12.0     Az.CognitiveServices                {Add-AzCognitiveServicesAccountNetworkRule, Get-AzCogn...
Script     5.3.0      Az.Compute                          {Add-AzImageDataDisk, Add-AzVhd, Add-AzVMAdditionalUna...
Script     1.0.0      Az.ConfidentialLedger               {Get-AzConfidentialLedger, New-AzConfidentialLedger, N...
Script     3.1.0      Az.ContainerInstance                {Add-AzContainerInstanceOutput, Get-AzContainerGroup, ...
Script     3.0.1      Az.ContainerRegistry                {Connect-AzContainerRegistry, Get-AzContainerRegistry,...
Script     1.9.0      Az.CosmosDB                         {Get-AzCosmosDBAccount, Get-AzCosmosDBAccountKey, Get-...
Script     1.1.0      Az.DataBoxEdge                      {Get-AzDataBoxEdgeBandwidthSchedule, Get-AzDataBoxEdge...
Script     1.4.0      Az.Databricks                       {Get-AzDatabricksAccessConnector, Get-AzDatabricksOutb...
Script     1.16.11    Az.DataFactory                      {Add-AzDataFactoryV2DataFlowDebugSessionPackage, Add-A...
Script     1.0.2      Az.DataLakeAnalytics                {Add-AzDataLakeAnalyticsDataSource, Add-AzDataLakeAnal...
Script     1.3.0      Az.DataLakeStore                    {Add-AzDataLakeStoreFirewallRule, Add-AzDataLakeStoreI...
Script     1.0.1      Az.DataProtection                   {Backup-AzDataProtectionBackupInstanceAdhoc, Edit-AzDa...
Script     1.0.1      Az.DataShare                        {Get-AzDataShare, Get-AzDataShareAccount, Get-AzDataSh...
Script     1.1.0      Az.DeploymentManager                {Get-AzDeploymentManagerArtifactSource, Get-AzDeployme...
Script     3.1.1      Az.DesktopVirtualization            {Disconnect-AzWvdUserSession, Expand-AzWvdMsixImage, G...
Script     1.0.2      Az.DevTestLabs                      {Get-AzDtlAllowedVMSizesPolicy, Get-AzDtlAutoShutdownP...
Script     1.1.2      Az.Dns                              {Add-AzDnsRecordConfig, Get-AzDnsRecordSet, Get-AzDnsZ...
Script     1.5.0      Az.EventGrid                        {Enable-AzEventGridPartnerTopic, Get-AzEventGridChanne...
Script     3.2.0      Az.EventHub                         {Add-AzEventHubIPRule, Add-AzEventHubVirtualNetworkRul...
Script     1.9.0      Az.FrontDoor                        {Disable-AzFrontDoorCustomDomainHttps, Enable-AzFrontD...
Script     4.0.6      Az.Functions                        {Get-AzFunctionApp, Get-AzFunctionAppAvailableLocation...
Script     5.0.1      Az.HDInsight                        {Add-AzHDInsightClusterIdentity, Add-AzHDInsightCompon...
Script     2.0.0      Az.HealthcareApis                   {Get-AzHealthcareApisService, Get-AzHealthcareApisWork...
Script     2.7.4      Az.IotHub                           {Add-AzIotHubCertificate, Add-AzIotHubConfiguration, A...
Script     4.9.1      Az.KeyVault                         {Add-AzKeyVaultCertificate, Add-AzKeyVaultCertificateC...
Script     2.1.0      Az.Kusto                            {Add-AzKustoClusterLanguageExtension, Add-AzKustoDatab...
Script     1.5.0      Az.LogicApp                         {Get-AzIntegrationAccount, Get-AzIntegrationAccountAgr...
Script     1.1.3      Az.MachineLearning                  {Add-AzMlWebServiceRegionalProperty, Export-AzMlWebSer...
Script     1.2.1      Az.Maintenance                      {Get-AzApplyUpdate, Get-AzConfigurationAssignment, Get...
Script     1.1.0      Az.ManagedServiceIdentity           {Get-AzFederatedIdentityCredentials, Get-AzSystemAssig...
Script     3.0.0      Az.ManagedServices                  {Get-AzManagedServicesAssignment, Get-AzManagedService...
Script     2.0.0      Az.MarketplaceOrdering              {Get-AzMarketplaceTerms, Invoke-AzMarketplaceSignTerms...
Script     1.1.1      Az.Media                            {Get-AzMediaService, Get-AzMediaServiceKey, Get-AzMedi...
Script     2.1.0      Az.Migrate                          {Get-AzMigrateDiscoveredServer, Get-AzMigrateJob, Get-...
Script     4.4.0      Az.Monitor                          {Add-AzLogProfile, Add-AzMetricAlertRule, Add-AzMetric...
Script     1.1.0      Az.MySql                            {Get-AzMySqlConfiguration, Get-AzMySqlConnectionString...
Script     5.3.0      az.network                          {Add-AzApplicationGatewayAuthenticationCertificate, Ad...
Script     1.1.1      Az.NotificationHubs                 {Get-AzNotificationHub, Get-AzNotificationHubAuthoriza...
Script     3.2.0      Az.OperationalInsights              {Disable-AzOperationalInsightsIISLogCollection, Disabl...
Script     1.5.1      Az.PolicyInsights                   {Get-AzPolicyEvent, Get-AzPolicyMetadata, Get-AzPolicy...
Script     1.1.0      Az.PostgreSql                       {Get-AzPostgreSqlConfiguration, Get-AzPostgreSqlConnec...
Script     1.2.0      Az.PowerBIEmbedded                  {Get-AzPowerBIEmbeddedCapacity, Get-AzPowerBIWorkspace...
Script     1.0.3      Az.PrivateDns                       {Add-AzPrivateDnsRecordConfig, Get-AzPrivateDnsRecordS...
Script     6.1.2      Az.RecoveryServices                 {Add-AzRecoveryServicesAsrReplicationProtectedItemDisk...
Script     1.7.0      Az.RedisCache                       {Export-AzRedisCache, Get-AzRedisCache, Get-AzRedisCac...
Script     1.1.0      Az.RedisEnterpriseCache             {Export-AzRedisEnterpriseCache, Get-AzRedisEnterpriseC...
Script     1.0.3      Az.Relay                            {Get-AzRelayAuthorizationRule, Get-AzRelayHybridConnec...
Script     1.1.0      Az.ResourceMover                    {Add-AzResourceMoverMoveResource, Get-AzResourceMoverM...
Script     6.5.1      Az.Resources                        {Export-AzResourceGroup, Export-AzTemplateSpec, Get-Az...
Script     1.3.0      Az.Security                         {Add-AzSecurityAdaptiveNetworkHardening, Add-AzSecurit...
Script     3.0.1      Az.SecurityInsights                 {Get-AzSentinelAlertRule, Get-AzSentinelAlertRuleActio...
Script     2.1.0      Az.ServiceBus                       {Add-AzServiceBusIPRule, Add-AzServiceBusVirtualNetwor...
Script     3.1.0      Az.ServiceFabric                    {Add-AzServiceFabricClientCertificate, Add-AzServiceFa...
Script     1.5.0      Az.SignalR                          {Get-AzSignalR, Get-AzSignalRKey, Get-AzSignalRUsage, ...
Script     4.2.0      Az.Sql                              {Add-AzSqlDatabaseToFailoverGroup, Add-AzSqlElasticJob...
Script     1.1.0      Az.SqlVirtualMachine                {Get-AzAvailabilityGroupListener, Get-AzSqlVM, Get-AzS...
Script     1.4.1      Az.StackHCI                         {Add-AzStackHCIVMAttestation, Disable-AzStackHCIAttest...
Script     5.3.0      Az.Storage                          {Add-AzRmStorageContainerLegalHold, Add-AzStorageAccou...
Script     1.7.0      Az.StorageSync                      {Get-AzStorageSyncCloudEndpoint, Get-AzStorageSyncGrou...
Script     2.0.0      Az.StreamAnalytics                  {Get-AzStreamAnalyticsCluster, Get-AzStreamAnalyticsCl...
Script     1.0.0      Az.Support                          {Get-AzSupportProblemClassification, Get-AzSupportServ...
Script     2.2.0      Az.Synapse                          {Add-AzSynapseDataFlowDebugSessionPackage, Add-AzSynap...
Script     1.1.0      Az.TrafficManager                   {Add-AzTrafficManagerCustomHeaderToEndpoint, Add-AzTra...
Script     2.12.1     Az.Websites                         {Add-AzWebAppAccessRestrictionRule, Add-AzWebAppTraffi...

Error output

Message        : A parameter cannot be found that matches parameter name 'SecurityType'.
StackTrace     :    at System.Management.Automation.CmdletParameterBinderController.VerifyArgumentsProcessed(Parame
                 terBindingException originalBindingException)
                    at System.Management.Automation.CmdletParameterBinderController.BindCommandLineParametersNoVali
                 dation(Collection`1 arguments)
                    at System.Management.Automation.CmdletParameterBinderController.BindCommandLineParameters(Colle
                 ction`1 arguments)
                    at System.Management.Automation.CommandProcessor.BindCommandLineParameters()
                    at System.Management.Automation.CommandProcessor.Prepare(IDictionary psDefaultParameterValues)
                    at System.Management.Automation.CommandProcessorBase.DoPrepare(IDictionary
                 psDefaultParameterValues)
                    at System.Management.Automation.Internal.PipelineProcessor.Start(Boolean incomingStream)
                    at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object
                 input)
                 --- End of stack trace from previous location where exception was thrown ---
                    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
                    at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object
                 input)
                    at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput,
                 CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts,
                 CommandRedirection[][] commandRedirections, FunctionContext funcContext)
                    at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)
                    at
                 System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame
                 frame)
                    at
                 System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame
                 frame)
Exception      : System.Management.Automation.ParameterBindingException
InvocationInfo : {New-AzVMConfig}
Line           : $vmconfig = New-AzVMConfig -VMName $vmname -vmsize $VMsize -SecurityType $securityTypeStnd
Position       : At line:1 char:60
                 + ...  New-AzVMConfig -VMName $vmname -vmsize $VMsize -SecurityType $securi ...
                 +                                                     ~~~~~~~~~~~~~
HistoryId      : 206
isra-fel commented 9 months ago

Hi @stan-spotts this parameter/feature was introduced recently. Could you update your Azure PowerShell modules to the latest version?

stan-spotts commented 9 months ago

@isra-fel that was it, thanks!

stan-spotts commented 9 months ago

Updated the az modules and it works fine now