2016-04-14 1 views
0

Azure CDNに私の起源が特定の経路にあることを伝えたい。 mydomain.com/cdn。このオプションは、Azureポータル(CDNプロファイル>エンドポイント>設定>オリジナルパス)で利用できます。Resouce Manager APIを使用してAzure CDNでOriginパスを設定するにはどうすればよいですか?

私はAzureリソースをResource Manager APIとJsonテンプレートを使用して配備しています。ただし、ここのテンプレートでこの設定が見つかりません:https://github.com/Azure/azure-quickstart-templates/tree/master/201-cdn-customize

これは利用できないのですか、または何か不足していますか?リソースエクスプローラを使用して

更新

は、私は nullで、エンドポイントノードのプロパティを見つけました。値を設定しようとしてもAPIがそれを受け入れる場合でも、値は設定されません。それは任意の構成であるので

{ 
     "value": [ 
     { 
      "name": "<hidden>", 
      "id": "/subscriptions/<hidden>/resourcegroups/<hidden>/providers/Microsoft.Cdn/profiles/<hidden>/endpoints/<hidden>", 
      "type": "Microsoft.Cdn/profiles/endpoints", 
      "tags": {}, 
      "location": "NorthEurope", 
      "properties": { 
      "hostName": "<hidden>", 
      "originHostHeader": "<hidden>", 
      "provisioningState": "Succeeded", 
      "resourceState": "Running", 
      "isHttpAllowed": true, 
      "isHttpsAllowed": true, 
      "queryStringCachingBehavior": "UseQueryString", 
      "originPath": null, 
      "origins": [ 
       { 
       "name": "<hidden>", 
       "properties": { 
        "hostName": "<hidden>", 
        "httpPort": null, 
        "httpsPort": null 
       } 
       } 
      ], 
      "contentTypesToCompress": [ 
       "application/x-javascript", 
       "text/css", 
       "text/html", 
       "text/javascript", 
       "text/plain" 
      ], 
      "isCompressionEnabled": false 
      } 
     } 
     ] 
    } 

答えて

0

編集2016年4月15日にコードインサートを

を修正するために、テンプレートは、それを有していなくてもよいです。 azuredeploy.json行97の部分がCDNエンドポイントを構成しているようです。以下のように行104を追加すると役立ちます。パラメータ・ファイル内

あなたはこのブロックを追加する必要があります。もちろん、
97  "properties": { 
98  "originHostHeader": "[parameters('originUrl')]", 
99  "isHttpAllowed": "[parameters('isHttpAllowed')]", 
100  "isHttpsAllowed": "[parameters('isHttpsAllowed')]", 
101  "queryStringCachingBehavior": "[parameters('queryStringCachingBehavior')]", 
102  "contentTypesToCompress": "[parameters('contentTypesToCompress')]", 
103  "isCompressionEnabled": "[parameters('isCompressionEnabled')]", 
104  "originPath": "[parameters('originPath')]", 
105  "origins": [ 
106  { 
107  "name": "origin1", 
108  "properties": { 
109   "hostName": "[parameters('originUrl')]" 
110 
111  } 
112  } 
113 ] 

 "originPath": { 
     "value": "/cdn" 
    } 

うまくいけば、これは

+0

あなたのために働くだろうあなたの指導は私が考えるようになったと私は見てリソースエクスプローラを使用私は何を見つけることができた。エンドポイントのプロパティの下には、実際には 'originPath'プロパティがあります。残念ながら、この値の変更は保持されません。 – Anton

+0

アップデートと出力をありがとう。私は間違っていました。それは起源の副産物ではなく、親に直接付いています。 '' originPath ":" [parameters( 'originPath')] "、' 103行目と104行目の代わりに '' originPath ''を挿入すると動作するはずです。この変更に反映された答えを編集しました –

+0

私はついにこれを動作させました。おそらく問題は、既存のエンドポイントを更新したことでした。新しいエンドポイントを作成すると、設定が機能します。 – Anton

関連する問題