Sitecore Managed Cloud Services Client with IP address '20.205.248.223' is not allowed to access the server
After a successful deployment of the application on an MCS environment. I started facing an issue on CMS regarding the client IP address '20.205.248.223' is not allowed to access the server.
I have uploaded the upgraded Sitecore Master, Core, and Web database and changed it into the connection string. I was not using the default Sitecore 10.2 MCS database.
ERROR: | |
Server Error in '/' Application. | |
Cannot open server 'mc-********-***-****-****-****-sql' requested by the login. Client with IP address '20.205.248.223' is not allowed to access the server. To enable access, use the Windows Azure Management Portal or run sp_set_firewall_rule on the master database to create a firewall rule for this IP address or address range. It may take up to five minutes for this change to take effect. | |
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. | |
Exception Details: System.Data.SqlClient.SqlException: Cannot open server 'mc-********-***-****-****-****-sql' requested by the login. Client with IP address '20.205.248.223' is not allowed to access the server. To enable access, use the Windows Azure Management Portal or run sp_set_firewall_rule on the master database to create a firewall rule for this IP address or address range. It may take up to five minutes for this change to take effect. | |
Source Error: | |
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. | |
Stack Trace: | |
[SqlException (0x80131904): Cannot open server 'mc-********-***-****-****-****-sql' requested by the login. Client with IP address '20.205.248.223' is not allowed to access the server. To enable access, use the Windows Azure Management Portal or run sp_set_firewall_rule on the master database to create a firewall rule for this IP address or address range. It may take up to five minutes for this change to take effect.] | |
System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, DbConnectionPool pool, String accessToken, Boolean applyTransientFaultHandling, SqlAuthenticationProviderManager sqlAuthProviderManager) +1481 | |
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) +1150 | |
System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions) +70 | |
System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) +810 | |
System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) +103 | |
System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) +1598 | |
System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) +159 | |
System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) +382 | |
System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) +307 | |
System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry) +198 | |
System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry) +422 | |
System.Data.SqlClient.SqlConnection.Open() +199 | |
Hangfire.SqlServer.SqlServerStorage.CreateAndOpenConnection() +78 | |
Hangfire.SqlServer.SqlServerStorage.UseConnection(DbConnection dedicatedConnection, Func`2 func) +55 | |
Hangfire.SqlServer.SqlServerStorage.Initialize() +76 | |
Hangfire.SqlServerStorageExtensions.UseSqlServerStorage(IGlobalConfiguration configuration, String nameOrConnectionString) +86 | |
MillenniumHotels.Website.Global.Application_Start(Object sender, EventArgs e) +68 | |
[HttpException (0x80004005): Cannot open server 'mc-********-***-****-****-****-sql' requested by the login. Client with IP address '20.205.248.223' is not allowed to access the server. To enable access, use the Windows Azure Management Portal or run sp_set_firewall_rule on the master database to create a firewall rule for this IP address or address range. It may take up to five minutes for this change to take effect.] | |
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +517 | |
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +185 | |
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +168 | |
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +277 | |
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +369 | |
[HttpException (0x80004005): Cannot open server 'mc-********-***-****-****-****-sql' requested by the login. Client with IP address '20.205.248.223' is not allowed to access the server. To enable access, use the Windows Azure Management Portal or run sp_set_firewall_rule on the master database to create a firewall rule for this IP address or address range. It may take up to five minutes for this change to take effect.] | |
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +532 | |
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +111 | |
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +724 |
Solution:
The issue looks related to configuration of your Azure SQL Server "mc-********-***-****-****-****-sql".
If you navigate:
mc-********-***-****-****-****-sql -> "Security" section -> "Networking" tab
we can see that the "Allow Azure services and resources to access this server" checkbox is unchecked. Thus, web apps cannot connect to databases without explicitly allowing their IP (which may change).
For resolving the issue, please consider checking/enabling the mentioned checkbox.
Happy Sitecoreing 😊
Comments
Post a Comment