あなたのスロットスワップのステータスを追跡するためにActivity Log APIを使用できます。次に、REST APIの簡単なサンプル呼び出しを示します。
HTTP Method:
GET
Absolute Uri:
https://management.azure.com/subscriptions/{mysubscriptionid}/providers/microsoft.insights/eventtypes/management/values?api-version=2015-04-01&$filter=eventTimestamp ge '2016-09-08T01:53:03.0422573Z' and eventTimestamp le '2016-09-08T02:53:03.0422573Z' and resourceUri eq '/subscriptions/{mysubscriptionid}/resourcegroups/{myresourcegroup}/providers/Microsoft.Web/sites/fooapp/slots/slot1'&select=Authorization,Caller,CorrelationId,Category,EventTimestamp,OperationName,ResourceGroupName,ResourceUri,Status,SubscriptionId,SubStatus
このREST APIでは、注意が必要ないくつかのことがあります。
- URLエンコーディングが必要な場合があることに注意してください。
- "eventTimestamp"をスロットスワップを呼び出す直前のタイムスタンプ以上に設定すると、
eventTimestamp ge '2016-09-08T01:53:03.0422573Z'
を変更する必要があります。
eventTimestamp le '2016-09-08T02:53:03.0422573Z'
に似ています。 "eventTimestamp"を現在のタイムスタンプ以下に設定する必要があります。
取得しようとしている可能性のあるログが3つあります。これは、スロットのスワップが成功したことを示します。
最初の1つは「開始済み」です。
Authorization :
Scope : /subscriptions/{mysubscriptionid}/resourcegroups/{myresourcegroup}/providers/Microsoft.Web/sites/fooapp/slots/slot1
Action : Microsoft.Web/sites/slots/slotsswap/action
Role :
Condition :
Caller : <your Azure account>
CorrelationId : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Category : Administrative
EventTimestamp : 2016-09-08 2:48:39 AM
OperationName : Microsoft.Web/sites/slots/slotsswap/action
ResourceGroupName : {myresourcegroup}
ResourceId :
Status : Started
SubscriptionId : {mysubscriptionid}
SubStatus :
第2の1つは「受け入れられる」。
Authorization :
Scope : /subscriptions/{mysubscriptionid}/resourcegroups/{myresourcegroup}/providers/Microsoft.Web/sites/fooapp/slots/slot1
Action : Microsoft.Web/sites/slots/slotsswap/action
Role :
Condition :
Caller : <your Azure account>
CorrelationId : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Category : Administrative
EventTimestamp : 2016-09-08 2:48:41 AM
OperationName : Microsoft.Web/sites/slots/slotsswap/action
ResourceGroupName : {myresourcegroup}
ResourceId :
Status : Accepted
SubscriptionId : {mysubscriptionid}
SubStatus : Accepted
第3の1つは「成功」です。
Authorization :
Scope : /subscriptions/{mysubscriptionid}/resourcegroups/{myresourcegroup}/providers/Microsoft.Web/sites/fooapp/slots/slot1
Action : Microsoft.Web/sites/slots/write
Role :
Condition :
Caller : <your Azure account>
CorrelationId : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Category : Administrative
EventTimestamp : 2016-09-08 2:49:44 AM
OperationName : Microsoft.Web/sites/slots/write
ResourceGroupName : {myresourcegroup}
ResourceId :
Status : Succeeded
SubscriptionId : {mysubscriptionid}
SubStatus :
サービスプリンシパルを使用している場合、出力の「発信者」は異なる場合があります。スロットスワップが失敗した場合は、2番目または3番目のログに「失敗」が表示されます。
迅速な対応をありがとう!私は今働いていますが、どこからこの情報を入手したのか尋ねたいのですが?私はAzureのウェブサイトでこれを見つけることができませんでした。またAzure Resource Explorerでは 'https://management.azure.com/subscriptions/ {mysubscriptionid}/providers/microsoft.insights'を見つけることができませんでしたが、私のRESTクライアントを入れたときなどです。郵便配達員の絶対URLは –
でした。私はAzure PowerShellコマンド 'Get-AzureRmLog'を調べてこの情報を得ました。 '-debug'オプションを付けてコマンドを実行すると、REST APIを見ることができます。たとえば、 'Get-AzureRmLog -ResourceId /subscriptions/{mysubscriptionid}/resourcegroups/{myresourcegroup}/providers/Microsoft.Web/sites/fooapp/slots/slot1 -debug'とします。 –