Trying to set "Public Network Access" to "Disabled" for both keyvault and container registry.
I was able to set it for AppService, CosmosDB etc, but I couldn't find the way to set it for both the service I mention above.
Check the azure portal console and I can see the option there.
Here is a snippet for how I set up the container registry
from pulumi.config import Config
from pulumi_azure_native import containerregistry
from resources.resource_group import resourceGroup
# Create Azrure container registry
mainParams = Config().require_object("main-params")
containerRegistry = containerregistry.Registry(
f"ACRFakename{mainParams['environment']}",
resource_group_name=resourceGroup.name,
sku=containerregistry.SkuArgs(name="Premium"),
admin_user_enabled=True,
)
Here is how I set it on Cosmos
cosmosdb_account = documentdb.DatabaseAccount(
"testaccount",
resource_group_name=resourceGroup.name,
database_account_offer_type=documentdb.DatabaseAccountOfferType.STANDARD,
kind=documentdb.DatabaseAccountKind.MONGO_DB,
locations=[
documentdb.LocationArgs(
location_name=resourceGroup.location,
failover_priority=0,
)
],
backup_policy=documentdb.ContinuousModeBackupPolicyArgs(type="Continous"),
consistency_policy=documentdb.ConsistencyPolicyArgs(
default_consistency_level=documentdb.DefaultConsistencyLevel.SESSION,
),
** public_network_access="Disabled",**
)
Is there another way to set this public network access property ? any help will be appreciated:)
I've try setting the access_policies etc, but it wont change the public network access setting.
I've tried do that on the portal console and it work, but my goal is do that in the IaC so I can avoid manually configuring this when deploying to different environment.