Skip to content

Commit ed3595a

Browse files
committed
Adding Table API gateway connection mode example
1 parent 9dab06e commit ed3595a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

articles/cosmos-db/tutorial-develop-table-dotnet.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,12 @@ public static async Task<CloudTable> CreateTableAsync(string tableName)
174174
}
175175
```
176176

177+
If you get a "503 service unavailable exception" error, it's possible that the required ports for the connectivity mode are blocked by a firewall. To fix this issue, either open the required ports or use the gateway mode connectivity as shown in the following code:
178+
179+
```csharp
180+
tableClient.TableClientConfiguration.UseRestExecutorForCosmosEndpoint = true;
181+
```
182+
177183
## Define the entity
178184

179185
Entities map to C# objects by using a custom class derived from [TableEntity](https://docs.microsoft.com/dotnet/api/microsoft.azure.cosmos.table.tableentity). To add an entity to a table, create a class that defines the properties of your entity.

0 commit comments

Comments
 (0)