https://pulumi.com logo
Title
b

billions-holiday-91290

12/22/2022, 3:38 AM
Hi Experts, I'm using Pulumi python and pulumi-azure-native I created a simple website with AppService, keyvault, container registry etc. I'm trying to set keyvault and container registry "Public Network Access" to "Disabled" but I couldnt find where to set it in the code. Has anyone able to set the public network access for keyvaults or container registry?
m

many-telephone-49025

12/22/2022, 11:07 AM
Can you use for vault the
2022-07-01
api, there you have the property
publicNetworkAccess
Same for Container registry:
2021-09-01
and use
publicNetworkAccess
b

billions-holiday-91290

12/22/2022, 9:03 PM
Hi Engin, Sorry if thats a silly question, what do you mean by 2022-07-01 or 2021-09-01 API ? Do you mean there is a separate python pulumi library version ? I didnt aware there is a way to change the API in the code.
this is how I call the pulumi library in the code
from pulumi import Config, export
from pulumi_azure_native import keyvault
from resources.resource_group import resourceGroup
from pulumi_azure_native import cache
from resources.redis import redis, hostname
from resources.cosmos_db import connectionString
from resources.app_services import backendApi
mainParams = Config().require_object("main-params")
vaultParams = Config().require_object("vault-params")
environment = mainParams["environment"]
vault = keyvault.Vault(
vaultParams["name"],
vault_name=vaultParams["name"],
location=resourceGroup.location
Solved!
from pulumi_azure_native.containerregistry.v20210901 import (
Registry,
SkuArgs,
list_registry_credentials_output,
PublicNetworkAccess,
)
m

many-telephone-49025

12/23/2022, 8:27 AM
Awesome YhanL! 🎉