Home > Net >  Is there a way to set "Allow access to Azure services" in Microsoft.DBforPostgreSQL/server
Is there a way to set "Allow access to Azure services" in Microsoft.DBforPostgreSQL/server

Time:05-31

I've been working with Microsoft.DBforPostgreSQL/servers resource and Azure Bicep specifically using enter image description here

I thought publicNetworkAccess: 'Enabled' should do the trick, but it's not. Any thoughts / recommendations?

Thanks.

CodePudding user response:

The Allow access to Azure services setting can be scripted using a firewall rule for IP 0.0.0.0:

param serverName string

resource server 'Microsoft.DBforPostgreSQL/servers@2017-12-01' existing = {
  name: serverName
}

resource allowAllWindowsAzureIps 'Microsoft.DBforPostgreSQL/servers/firewallRules@2017-12-01' = {
  name: 'AllowAllWindowsAzureIps' // don't change the name
  parent: server
  properties: {
    endIpAddress: '0.0.0.0'
    startIpAddress: '0.0.0.0'
  }
}
  • Related