- 回答を参照してください。
私の同僚がAzureの文書化されていないAPI(これはbash
スクリプト)を使用して、この問題の次の一時的な解決策を発見しました。 LOCATION
、RESOURCE_GROUP
およびBM_ACCOUNT
を渡します。このスクリプトは、有効な集約パイプラインが設定されたMongo API Cosmos DBアカウントを作成します。
TOKEN=$(az account get-access-token | jq ".accessToken" | tr -d '"')
if [ -z "$LOCATION" ]; then
export LOCATION="NorthEurope"
fi
echo "INFO [cosmos]: Using location: $LOCATION"
echo "INFO [cosmos]: Creating bookmarks DB"
BM_ACCOUNT="name-of-your-bookmark-db"
az cosmosdb create --resource-group $RESOURCE_GROUP \
--name $BM_ACCOUNT \
--kind MongoDB \
--locations "$LOCATION=0"
curl -X PATCH \
-H "Authorization: Bearer ${TOKEN}" \
-H 'Content-Type: application/json' \
--data '{"properties":{"capabilities":[{"name":"EnableAggregationPipeline","description":null}]}}' \
"https://management.azure.com/subscriptions/${SUBSCRIPTION_ID}/resourceGroups/${RESOURCE_GROUP}/providers/Microsoft.DocumentDb/databaseAccounts/${BM_ACCOUNT}/?api-version=2015-04-08"
WAIT_FOR=12
SUCCESS=0
while [ $WAIT_FOR -gt 0 ]; do
sleep 10
RESULT=$(curl -H "Authorization: Bearer ${TOKEN}" \
-H 'Content-Type: application/json' \
"https://management.azure.com/subscriptions/${SUBSCRIPTION_ID}/resourceGroups/${RESOURCE_GROUP}/providers/Microsoft.DocumentDb/databaseAccounts/${BM_ACCOUNT}/?api-version=2015-04-08" \
| jq ".properties.capabilities[].name" \
| tr -d '"')
if [ "$RESULT" == "EnableAggregationPipeline" ]; then
SUCCESS=1
break;
fi
echo "INFO [cosmos]: Waiting another ${WAIT_FOR} tries for 'EnableAggregationPipeline' capability..."
((WAIT_FOR--))
done
if [ $SUCCESS -eq 0 ]; then
echo "ERROR [cosmos]: Did not get required CosmosDB capability of 'EnableAggregationPipeline' in time for account ${BM_ACCOUNT} - giving up." >&2
exit 1
fi
これは生産目的では使用しないことをおすすめしますが、実際には実際には動作します。
現在のところ、この機能はAzure Portalでのみ利用できます。 Azure CLIによるプレビュー機能のサポートはすぐに追加されます。これがライブであれば、ドキュメントへのリンクを共有します。 –
@SiddheshVetheよ、ありがとう。これは素晴らしいことです。 – donmartin
これに関するすべてのニュース、@SiddheshVethe?残念ながら、これは迷惑になりつつあります。 – donmartin