Azure / Azure/azure-powershell

Get-AzMySqlFlexibleServer reports incorrect results for NetworkPublicNetworkAccess property

Open
#29,365 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C#
Stars
4.8k
Forks
4.3k
Avg merge
3d 14h
Merged PRs (30d)
54

Description

### Description

Get-AzMySqlFlexibleServer returns NetworkPublicNetworkAccess = "Enabled" regardless of whether public network access is enabled or disabled.

### Issue script & Debug output

```PowerShell
az mysql flexible-server show -g rg-sand-dev-ssyk31tq -n mysql-sand-dev-ssyk31tq ; pwsh -Command "Get-AzMySqlFlexibleServer -ResourceGroupName rg-sand-dev-ssyk31tq -Name mysql-sand-dev-ssyk31tq | Format-List *"

Returns:

{
"administratorLogin": "bootstrapadmin",
"administratorLoginPassword": null,
"availabilityZone": "2",
"backup": {
"backupIntervalHours": 24,
"backupRetentionDays": 7,
"earliestRestoreDate": "2026-04-03T02:58:28.044376+00:00",
"geoRedundantBackup": "Disabled"
},
"createMode": null,
"dataEncryption": null,
"databasePort": 3306,
"fullVersion": "5.7.44",
"fullyQualifiedDomainName": "mysql-sand-dev-ssyk31tq.mysql.database.azure.com",
"highAvailability": {
"mode": "Disabled",
"replicationMode": "BinaryLog",
"standbyAvailabilityZone": "",
"state": "NotEnabled"
},
"id": "/subscriptions/8e93423f-d08c-4539-ba3d-8cbc20bc6aa5/resourceGroups/rg-sand-dev-ssyk31tq/providers/Microsoft.DBforMySQL/flexibleServers/mysql-sand-dev-ssyk31tq",
"identity": null,
"importSourceProperties": null,
"location": "East US 2",
"lowerCaseTableNames": null,
"maintenancePolicy": {
"patchStrategy": "Regular"
},
"maintenanceWindow": {
"batchOfMaintenance": "Default",
"customWindow": "Disabled",
"dayOfWeek": 0,
"startHour": 0,
"startMinute": 0
},
"name": "mysql-sand-dev-ssyk31tq",
"network": {
"delegatedSubnetResourceId": null,
"privateDnsZoneResourceId": null,
"publicNetworkAccess": "Disabled"
},
"privateEndpointConnections": [
{
"groupIds": [
"mysqlServer"
],
"id": "/subscriptions/8e93423f-d08c-4539-ba3d-8cbc20bc6aa5/resourceGroups/rg-sand-dev-ssyk31tq/providers/Microsoft.DBforMySQL/flexibleServers/mysql-sand-dev-ssyk31tq/privateEndpointConnections/pe-sand-dev-mysql-server-a364dc0f-2982-4cd2-86b2-a0915aad9d21",
"name": null,
"privateEndpoint": {
"id": "/subscriptions/8e93423f-d08c-4539-ba3d-8cbc20bc6aa5/resourceGroups/rg-sand-dev-ssyk31tq/providers/Microsoft.Network/privateEndpoints/pe-sand-dev-mysql-server",
"resourceGroup": "rg-sand-dev-ssyk31tq"
},
"privateLinkServiceConnectionState": {
"actionsRequired": "None",
"description": "Auto-approved",
"status": "Approved"
},
"provisioningState": "Ready",
"resourceGroup": "rg-sand-dev-ssyk31tq",
"systemData": null,
"type": null
}
],
"replicaCapacity": 10,
"replicationRole": "None",
"resourceGroup": "rg-sand-dev-ssyk31tq",
"restorePointInTime": null,
"sku": {
"name": "Standard_B1ms",
"tier": "Burstable"
},
"sourceServerResourceId": null,
"state": "Ready",
"storage": {
"autoGrow": "Enabled",
"autoIoScaling": "Disabled",
"iops": 360,
"logOnDisk": "Disabled",
"storageRedundancy": "LocalRedundancy",
"storageSizeGb": 20,
"storageSku": "Premium_LRS"
},
"systemData": {
"createdAt": "2026-04-03T02:48:28.044376+00:00",
"createdBy": null,
"createdByType": null,
"lastModifiedAt": null,
"lastModifiedBy": null,
"lastModifiedByType": null
},
"tags": {},
"type": "Microsoft.DBforMySQL/flexibleServers",
"version": "5.7"
}

AdministratorLogin : bootstrapadmin
AdministratorLoginPassword :
AvailabilityZone : 2
BackupEarliestRestoreDate : 04/03/2026 02:58:28
BackupGeoRedundantBackup : Disabled
BackupRetentionDay : 7
CreateMode :
FullyQualifiedDomainName : mysql-sand-dev-ssyk31tq.mysql.database.azure.com
HighAvailabilityMode : Disabled
HighAvailabilityStandbyAvailabilityZone :
HighAvailabilityState : NotEnabled
Id : /subscriptions/8e93423f-d08c-4539-ba3d-8cbc20bc6aa5/resourceGroups/rg-sand-dev-ssyk31tq/providers/Microsoft.DBforMySQL/flexibleServers/mysql-sand-dev-ssyk31tq
Location : East US 2
MaintenanceWindowCustomWindow : Disabled
MaintenanceWindowDayOfWeek : 0
MaintenanceWindowStartHour : 0
MaintenanceWindowStartMinute : 0
Name : mysql-sand-dev-ssyk31tq
NetworkDelegatedSubnetResourceId :
NetworkPrivateDnsZoneResourceId :
NetworkPublicNetworkAccess : Enabled
ReplicaCapacity : 10
ReplicationRole : None
RestorePointInTime :
SkuName : Standard_B1ms
SkuTier : Burstable
SourceServerResourceId :
State : Ready
StorageAutoGrow : Enabled
StorageIop : 360
StorageSizeGb : 20
StorageSku : Premium_LRS
SystemDataCreatedAt : 04/03/2026 02:48:28
SystemDataCreatedBy :
SystemDataCreatedByType :
SystemDataLastModifiedAt :
SystemDataLastModifiedBy :
SystemDataLastModifiedByType :
Tag : Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api10.TrackedResourceTags
Type : Microsoft.DBforMySQL/flexibleServers
Version : 5.7
SecuredPassword :
FirewallRuleName :
DatabaseName :
```

### Environment data

```PowerShell
Name Value
---- -----
PSVersion 7.6.0
PSEdition Core
GitCommitId 7.6.0
OS Ubuntu 24.04.4 LTS
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.4
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
```

### Module versions

```PowerShell
Script 5.3.0 Az.Accounts Core,Desk {Disable-AzDataCollection, Disa…
Script 2.1.1 Az.Advisor Core,Desk {Disable-AzAdvisorRecommendatio…
Script 7.0.0 Az.Aks Core,Desk {Disable-AzAksAddOn, Enable-AzA…
Script 1.2.0 Az.AnalysisServices Core,Desk {Add-AzAnalysisServicesAccount,…
Script 4.1.0 Az.ApiManagement Core,Desk {Add-AzApiManagementApiToGatewa…
Script 2.0.1 Az.App Core,Desk {Disable-AzContainerAppRevision…
Script 2.0.0 Az.AppConfiguration Core,Desk {Clear-AzAppConfigurationDelete…
Script 2.3.1 Az.ApplicationInsights Core,Desk {Get-AzApplicationInsights, Get…
Script 1.1.1 Az.ArcResourceBridge Core,Desk {Get-AzArcResourceBridge, Get-A…
Script 1.0.0 Az.ArizeAI Core,Desk {Get-AzArizeAIOrganization, New…
Script 2.1.1 Az.Attestation Core,Desk {Add-AzAttestationPolicySigner,…
Script 1.1.1 Az.Automanage Core,Desk {Get-AzAutomanageBestPractice, …
Script 1.11.2 Az.Automation Core,Desk {Export-AzAutomationDscConfigur…
Script 3.7.1 Az.Batch Core,Desk {Disable-AzBatchAutoScale, Disa…
Script 2.2.0 Az.Billing Core,Desk {Get-AzBillingAccount, Get-AzBi…
Script 5.0.1 Az.Cdn Core,Desk {Clear-AzCdnEndpointContent, Cl…
Script 2.1.1 Az.CloudService Core,Desk {Get-AzCloudService, Get-AzClou…
Script 1.16.0 Az.CognitiveServices Core,Desk {Add-AzCognitiveServicesAccount…
Script 10.4.0 Az.Compute Core,Desk {Add-AzGalleryInVMAccessControl…
Script 1.1.1 Az.ConfidentialLedger Core,Desk {Get-AzConfidentialLedger, New-…
Script 1.1.1 Az.ConnectedMachine Core,Desk {Connect-AzConnectedMachine, Ge…
Script 4.1.2 Az.ContainerInstance Core,Desk {Add-AzContainerInstanceOutput,…
Script 4.3.1 Az.ContainerRegistry Core,Desk {Connect-AzContainerRegistry, G…
Script 1.18.2 Az.CosmosDB Core,Desk {Get-AzCosmosDBAccount, Get-AzC…
Script 1.2.1 Az.DataBoxEdge Core,Desk {Get-AzDataBoxEdgeBandwidthSche…
Script 1.10.1 Az.Databricks Core,Desk {Get-AzDatabricksAccessConnecto…
Script 1.19.5 Az.DataFactory Core,Desk {Add-AzDataFactoryV2DataFlowDeb…
Script 1.1.0 Az.DataLakeAnalytics Core,Desk {Add-AzDataLakeAnalyticsDataSou…
Script 1.5.0 Az.DataLakeStore Core,Desk {Add-AzDataLakeStoreFirewallRul…
Script 1.0.0 Az.DataMigration Core,Desk {Get-AzDataMigrationProject, Ge…
Script 2.7.0 Az.DataProtection Core,Desk {Backup-AzDataProtectionBackupI…
Script 1.1.1 Az.DataShare Core,Desk {Get-AzDataShare, Get-AzDataSha…
Script 1.0.0 Az.DataTransfer Core,Desk {Approve-AzDataTransferConnecti…
Script 5.4.1 Az.DesktopVirtualization Core,Desk {Disconnect-AzWvdUserSession, E…
Script 2.0.2 Az.DevCenter Core,Desk {Connect-AzDevCenterAdminCatalo…
Script 1.1.0 Az.DevTestLabs Core,Desk {Get-AzDtlAllowedVMSizesPolicy,…
Script 1.3.2 Az.Dns Core,Desk {Add-AzDnsRecordConfig, Get-AzD…
Script 1.1.1 Az.DnsResolver Core,Desk {Get-AzDnsForwardingRuleset, Ge…
Script 1.4.1 Az.ElasticSan Core,Desk {Add-AzElasticSanVolumeGroupNet…
Script 2.2.0 Az.EventGrid Core,Desk {Disable-AzEventGridPartnerTopi…
Script 5.4.0 Az.EventHub Core,Desk {New-AzEventHubAuthorizationRul…
Script 1.0.0 Az.Fabric Core,Desk {Get-AzFabricCapacity, Get-AzFa…
Script 1.0.0 Az.FirmwareAnalysis Core,Desk {Get-AzFirmwareAnalysisBinaryHa…
Script 1.13.0 Az.FrontDoor Core,Desk {Disable-AzFrontDoorCustomDomai…
Script 4.2.1 Az.Functions Core,Desk {Get-AzFunctionApp, Get-AzFunct…
Script 6.4.0 Az.HDInsight Core,Desk {Add-AzHDInsightClusterIdentity…
Script 2.1.1 Az.HealthcareApis Core,Desk {Get-AzHealthcareApisService, G…
Script 1.0.0 Az.HealthDataAIServices Core,Desk {Get-AzDeidService, New-AzDeidS…
Script 2.8.0 Az.IotHub Core,Desk {Add-AzIotHubCertificate, Add-A…
Script 6.4.0 Az.KeyVault Core,Desk {Add-AzKeyVaultCertificate, Add…
Script 2.4.0 Az.Kusto Core,Desk {Add-AzKustoClusterCalloutPolic…
Script 1.0.0 Az.LambdaTest Core,Desk {Get-AzLambdaTestOrganization, …
Script 1.1.1 Az.LoadTesting Core,Desk {Get-AzLoad, New-AzLoad, Remove…
Script 1.6.0 Az.LogicApp Core,Desk {Get-AzIntegrationAccount, Get-…
Script 1.2.0 Az.MachineLearning Core,Desk {Add-AzMlWebServiceRegionalProp…
Script 1.2.0 Az.MachineLearningServices Core,Desk {Get-AzMLServiceQuota, Get-AzML…
Script 1.5.1 Az.Maintenance Core,Desk {Get-AzApplyUpdate, Get-AzConfi…
Script 2.0.0 Az.ManagedServiceIdentity Core,Desk {Get-AzFederatedIdentityCredent…
Script 3.1.2 Az.ManagedServices Core,Desk {Get-AzManagedServicesAssignmen…
Script 2.2.0 Az.MarketplaceOrdering Core,Desk {Get-AzMarketplaceTerms, Invoke…
Script 2.10.0 Az.Migrate Core,Desk {Get-AzMigrateDiscoveredServer,…
Script 6.0.3 Az.Monitor Core,Desk {Add-AzLogProfile, Add-AzMetric…
Script 1.5.0 Az.MySql Core,Desk {Get-AzMySqlConfiguration, Get-…
Script 7.21.0 Az.Network Core,Desk {Add-AzApplicationGatewayAuthen…
Script 1.2.1 Az.NetworkCloud Core,Desk {Deploy-AzNetworkCloudCluster, …
Script 1.2.1 Az.Nginx Core,Desk {Get-AzNginxCertificate, Get-Az…
Script 1.2.0 Az.NotificationHubs Core,Desk {Get-AzNotificationHub, Get-AzN…
Script 3.3.0 Az.OperationalInsights Core,Desk {Disable-AzOperationalInsightsI…
Script 1.2.0 Az.Oracle Core,Desk {Add-AzOracleCloudVMClusterVM, …
Script 1.7.1 Az.PolicyInsights Core,Desk {Get-AzPolicyAttestation, Get-A…
Script 1.4.0 Az.PostgreSql Core,Desk {Get-AzPostgreSqlConfiguration,…
Script 2.1.0 Az.PowerBIEmbedded Core,Desk {Get-AzPowerBIEmbeddedCapacity,…
Script 1.2.0 Az.PrivateDns Core,Desk {Add-AzPrivateDnsRecordConfig, …
Script 7.9.0 Az.RecoveryServices Core,Desk {Add-AzRecoveryServicesAsrRepli…
Script 1.11.0 Az.RedisCache Core,Desk {Export-AzRedisCache, Get-AzRed…
Script 1.5.0 Az.RedisEnterpriseCache Core,Desk {Export-AzRedisEnterpriseCache,…
Script 2.1.2 Az.Relay Core,Desk {Get-AzRelayAuthorizationRule, …
Script 1.2.1 Az.ResourceGraph Core,Desk {Search-AzGraph, Get-AzResource…
Script 1.3.1 Az.ResourceMover Core,Desk {Add-AzResourceMoverMoveResourc…
Script 8.1.1 Az.Resources Core,Desk {Export-AzResourceGroup, Export…
Script 1.8.0 Az.Security Core,Desk {Add-AzSecurityAdaptiveNetworkH…
Script 3.2.1 Az.SecurityInsights Core,Desk {Get-AzSentinelAlertRule, Get-A…
Script 4.1.1 Az.ServiceBus Core,Desk {New-AzServiceBusAuthorizationR…
Script 3.8.0 Az.ServiceFabric Core,Desk {Add-AzServiceFabricClientCerti…
Script 2.2.0 Az.SignalR Core,Desk {Get-AzSignalR, Get-AzSignalRKe…
Script 6.2.0 Az.Sql Core,Desk {Add-AzSqlDatabaseToFailoverGro…
Script 2.4.0 Az.SqlVirtualMachine Core,Desk {Assert-AzSqlVMEntraAuth, Get-A…
Script 2.6.3 Az.StackHCI Core,Desk {Add-AzStackHCIVMAttestation, D…
Script 1.1.0 Az.StackHCIVM Core,Desk {Add-AzStackHCIVMVirtualMachine…
Script 9.2.0 Az.Storage Core,Desk {Add-AzRmStorageContainerLegalH…
Script 1.0.0 Az.StorageAction Core,Desk {Get-AzStorageActionTask, Get-A…
Script 1.0.0 Az.StorageDiscovery Core,Desk {Get-AzStorageDiscoveryWorkspac…
Script 1.6.0 Az.StorageMover Core,Desk {Get-AzStorageMover, Get-AzStor…
Script 2.5.2 Az.StorageSync Core,Desk {Get-AzStorageSyncCloudEndpoint…
Script 2.1.1 Az.StreamAnalytics Core,Desk {Get-AzStreamAnalyticsCluster, …
Script 2.1.0 Az.Support Core,Desk {Get-AzSupportChatTranscript, G…
Script 3.2.2 Az.Synapse Core,Desk {Add-AzSynapseDataFlowDebugSess…
Script 1.3.0 Az.TrafficManager Core,Desk {Add-AzTrafficManagerCustomHead…
Script 3.4.2 Az.Websites Core,Desk {Add-AzWebAppAccessRestrictionR…
Script 1.0.1 Az.Workloads Core,Desk {Get-AzWorkloadsMonitor, Get-Az…
```

### Error output

```PowerShell
N/A
```

Contributor guide

Open the contributing guide

Research direction

Start with the Get-AzMySqlFlexibleServer entry point and trace how the NetworkPublicNetworkAccess value is mapped from the Azure MySQL response. Reproduce the comparison with az mysql flexible-server show using a server with public access disabled; done means the cmdlet reports the same enabled or disabled state.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, mysql, powershell
Domain
databases, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.