fix bug that blocked local mongo proxy and cassandra proxy development

This commit is contained in:
Asier Isayas
2024-04-09 11:39:11 -04:00
parent 6bdc714e11
commit 16c7b2567b
4 changed files with 15 additions and 3 deletions

View File

@@ -696,7 +696,10 @@ function useMongoProxyEndpoint(api: string): boolean {
MongoProxyEndpoints.Prod,
];
let canAccessMongoProxy: boolean = userContext.databaseAccount.properties.publicNetworkAccess === "Enabled";
if (userContext.databaseAccount.properties.ipRules?.length > 0) {
if (
configContext.MONGO_PROXY_ENDPOINT != MongoProxyEndpoints.Development &&
userContext.databaseAccount.properties.ipRules?.length > 0
) {
canAccessMongoProxy = canAccessMongoProxy && configContext.MONGO_PROXY_OUTBOUND_IPS_ALLOWLISTED;
}