Skip to content

Commit ba6d7d2

Browse files
author
Jake Willey
committed
Added note about 503 exception
1 parent af3e7f7 commit ba6d7d2

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

articles/cosmos-db/sql-api-get-started.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,16 @@ A database is the logical container of items partitioned across containers. Eith
253253

254254
1. Select F5 to run your application.
255255

256+
> [!NOTE]
257+
> If you get a 503 service unavailable exception it's possible the required [ports](https://docs.microsoft.com/en-us/azure/cosmos-db/performance-tips#networking) for direct mode blocked by a firewall. To fix this issue either open the required [ports](https://docs.microsoft.com/en-us/azure/cosmos-db/performance-tips#networking) or try to use gateway mode as shown below.
258+
```csharp
259+
// Create a new instance of the Cosmos Client in Gateway mode
260+
this.cosmosClient = new CosmosClient(EndpointUri, PrimaryKey, new CosmosClientOptions()
261+
{
262+
ConnectionMode = ConnectionMode.Gateway
263+
});
264+
```
265+
256266
Congratulations! You've successfully created an Azure Cosmos database.
257267

258268
## <a id="CreateColl"></a>Step 5: Create a container

0 commit comments

Comments
 (0)