Skip to content

Commit d886060

Browse files
authored
Merge pull request #95873 from j82w/users/jawilley/gateway_note
Added note about 503 exception
2 parents a542d64 + ea841ba commit d886060

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](performance-tips.md#networking) for direct mode are blocked by a firewall. To fix this issue, either open the required [ports](performance-tips.md#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)