Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] no convenience API to set PublicNetworkAccess in Vault #39192

Closed
3 tasks
promangallego opened this issue Mar 13, 2024 · 2 comments · Fixed by #39309
Closed
3 tasks

[BUG] no convenience API to set PublicNetworkAccess in Vault #39192

promangallego opened this issue Mar 13, 2024 · 2 comments · Fixed by #39309
Assignees
Labels
ARM customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@promangallego
Copy link

Describe the bug
azure sdk for java does not offer diable PublicNetworkAccess for keyvaults

Exception or Stack Trace
import com.azure.identity.DefaultAzureCredential;import com.azure.resourcemanager.AzureResourceManager;import com.azure.resourcemanager.keyvault.models.Vault;import com.azure.resourcemanager.keyvault.models.VaultCreateOrUpdateParameters;import com.azure.resourcemanager.keyvault.models.VaultProperties;import com.azure.resourcemanager.resources.fluentcore.arm.Region;import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils;
public class CreateKeyVaultExample {
public static void main(String[] args) {
String subscriptionId = "";
String resourceGroupName = "";
String keyVaultName = "";

    // Authenticate using DefaultAzureCredentialAzureResourceManager azureResourceManager = AzureResourceManager.configure()
            .withLogLevel(HttpLogDetailLevel.BASIC)                .authenticate(new DefaultAzureCredential())
            .withDefaultSubscription();

    // Create a new Key VaultVault vault = azureResourceManager.keyVaults().define(keyVaultName)
            .withRegion(Region.US_WEST)
            .withNewResourceGroup(resourceGroupName)
            .withEmptyAccessPolicy()
            .create();

    System.out.println("Key Vault created: " + vault.vaultUri());
}

}
To Reproduce
When coding with to the SDK properties there is no .withPublicNetworkAccess to set to False
It creates it with PublicNetworkAccess enabled

Code Snippet
See above

Expected behavior
To be able to disable publicNetwokAccess

Screenshots
If applicable, add screenshots to help explain your problem.

Setup (please complete the following information):

  • OS: [Mac]
  • IDE: [IntelliJ]
  • Library/Libraries: [azure-resource-manager-keyvault 2.36.0]
  • Java version: coreto 21
  • App Server/Environment: [openshift]
  • Frameworks: Spring Boot]

If you suspect a dependency version mismatch (e.g. you see NoClassDefFoundError, NoSuchMethodError or similar), please check out Troubleshoot dependency version conflict article first. If it doesn't provide solution for the problem, please provide:

  • verbose dependency tree (mvn dependency:tree -Dverbose)
  • exception message, full stack trace, and any available logs

Additional context
Add any other context about the problem here.

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Bug Description Added
  • Repro Steps Added
  • Setup information Added
@github-actions github-actions bot added ARM customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Mar 13, 2024
Copy link

Thank you for your feedback. Tagging and routing to the team member best able to assist.

@weidongxu-microsoft weidongxu-microsoft changed the title [BUG] [BUG] no convenience API to set PublicNetworkAccess in Vault Mar 13, 2024
@weidongxu-microsoft
Copy link
Member

weidongxu-microsoft commented Mar 20, 2024

PR #39309

.disablePublicNetworkAccess()

Should be included in next 2.37.0 release, scheduled before end of March.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
ARM customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
2 participants