イベントドリブンのサーバーレス コンピューティング プラットフォームを提供する Azure サービス。
Azure Functions Flex Consumption の 設定を Azure portal から変更すると、関連する App Service planのタグが意図せず消失する
Azure Functions Flex Consumption の 常時使用可能なインスタンス数設定を Azure portal から変更したところ、関連する App Service planのタグが意図せず消失しました。
常時使用可能なインスタンス数 の変更操作が App Service plan の既存タグを削除する挙動について調査をお願いします。
またタグを保持する回避策があるか確認をお願いします。
Azure Functions
-
Likhitha Sulake • 105 評価のポイント • Microsoft 外部スタッフ • モデレーター
2026-07-30T11:30:23.5566667+00:00 Hi @伊藤 壮平 ,
こんにちは@伊藤壮平さん。 これを英語に翻訳するので、文法の誤りや不正確さがあればあらかじめお詫びします。この行動を報告し、詳細な情報を提供してくださりありがとうございます。
あなたの説明からすると、Always Readyの設定を更新することで、基盤となるApp Service Planリソースへの更新がトリガーされているようです。更新操作で既存のタグが保持されない場合、明示的なエラーが報告されずにタグを削除してもよいでしょう。
これがAzureポータル経由で起きているのか、それとも他のデプロイメントプロセスを通じて起きているのかを判断するために、以下のチェックを行っていただけますか?
アプリサービスプランのアクティビティログを確認してください
App Service Planのリソース(Function Appではなく)にアクセスし、アクティビティログを開きます。
Always Ready設定が変更された時刻をフィルターし、操作を探します:
Microsoft.Web/serverfarms/writeご確認ください:
操作を行ったのはユーザーアカウントかサービスプリンシパルかです。
リクエストの相関IDです。
これにより、アップデートがAzureポータルから発生したのか、別のデプロイメントプロセスから来たのかを判断するのに役立ちます。
テスト環境でその挙動を再現する
可能であれば、テスト用のFlex Consumption Functionアプリを作成し、以下を行ってください。
App Service Planにテストタグを追加してください。
Azureポータルの**「Always Ready**」設定を変更してください。
App Service Planタグがまだ残っているか確認してください。
例えば:
ヤムル
az tag update --resource-id <APP_SERVICE_PLAN_RESOURCE_ID> --operation Merge --tags TestTag=BeforeChange az resource show --ids <APP_SERVICE_PLAN_RESOURCE_ID> --query tagsもしAlways Ready設定を変更しただけでタグが消えるなら、さらなる調査のための再現可能なシナリオが提供されます。
タグを復元してください
タグがすでに削除されている場合は、マージ操作で復元できます:
ヤムル
az tag update --resource-id <APP_SERVICE_PLAN_RESOURCE_ID> --operation Merge --tags CostCenter=00123 Owner=TeamA Environment=Productionマージを使うと、指定されたタグを追加・更新しながら既存のタグは保持されます。
もしApp Service PlanがInfrastructure as Codeで管理されている場合
ARM、Bicep、またはTerraformのデプロイにApp Service Planに必要なタグが含まれているか必ず確認してください。
既存のタグを含めずにリソースを更新する場合、Azure Resource Managerは更新時にタグコレクションを上書きできます。
参考になれば幸いです。上記の検査結果をお知らせいただければ、さらにお手伝いいたします。
-
伊藤 壮平 • 10 評価のポイント
2026-07-31T04:38:50.5233333+00:00 Hi @Likhitha Sulake ,
Please excuse any lack of clarity in my English.
Thank you for your guidance. I performed the suggested reproduction tests and reviewed the Activity Log.
Validation in an Environment Without Azure Policy
In an existing Flex Consumption test environment, I configured test tags on the App Service plan and changed only the Function App's Always Ready setting through the Azure portal.
In this environment, the existing tags remained unchanged; no tags were removed or had their values changed.
Observed Behavior in an Environment Where Azure Policy Was Assigned
After comparing this environment with the environment where the issue occurred, I found that the built-in Azure Policy definition
Inherit a tag from the resource group if missing(effect:modify) was assigned with theenvironmenttag specified.In this environment, I changed only Always Ready through the Azure portal while the following tags were configured on the App Service plan.
Item Tags Resource group environment=devApp Service plan before the change environment=dev,function=testApp Service plan after changing Always Ready environment=devAfter this operation, the non-policy-targeted
functiontag was no longer present.Additional Validation
- I changed the App Service plan's
environmenttag to a value different from the resource group's value, and then changed Always Ready through the Azure portal. After the change, theenvironmenttag value reverted to the resource group value (dev). - I also assigned the same Azure Policy definition for an additional tag. When I changed Always Ready through the Azure portal in this state, that tag remained and was not removed.
Additional Information
For Consumption and Elastic Premium plans, I could not reproduce the same tag loss by changing the scale-out settings through the Azure portal.
Activity Log
During the same validation period,
Microsoft.Web/sites/writefor the Function App was recorded first, followed byMicrosoft.Web/serverfarms/writefor the App Service plan.The Function App write and the App Service plan write had different correlation IDs. However, the
Microsoft.Web/serverfarms/writeoperation for the App Service plan and theMicrosoft.Authorization/policies/modify/actionoperation for Azure Policy were recorded with the same correlation ID.The caller for the App Service plan write was a user account. The Always Ready change was made through the Azure portal. During that time, no updates were performed through Bicep, Terraform, Azure CLI, PowerShell, a service principal, or automated deployment.
Points to Confirm
My understanding is that
Inherit a tag from the resource group if missingis an Azure Policy definition that inherits the resource group value when the target resource does not have the specified tag.However, in this validation, changing Always Ready while existing tags were configured on the App Service plan changed the policy-targeted tag to the resource group value and removed the non-targeted tag.
Could you please confirm whether this result is expected when a
Microsoft.Web/serverfarms/writeoperation occurs in an environment where the Azure Policy definitionInherit a tag from the resource group if missingis assigned? - I changed the App Service plan's
-
伊藤 壮平 • 10 評価のポイント
2026-07-31T04:41:57.8533333+00:00 I apologize, but I accidentally posted my follow-up as an Answer instead of a Comment.
Please refer to that Answer for the requested validation results and Activity Log details. Sorry for the confusion.
-
Likhitha Sulake • 105 評価のポイント • Microsoft 外部スタッフ • モデレーター
2026-07-31T12:06:26.2566667+00:00 Hi @伊藤 壮平 ,
追加検査を行い、結果を共有していただきありがとうございます。Azure Policyがある環境となし環境の比較は非常に参考になりました。
ご提供いただいた情報に基づいて、私たちが見つけた結果は以下の通りです:
- **
環境**タグがリソースグループの値に戻ることが予想されます
この動作は、組み込みの**「リソースグループからタグを継承する」**Azureポリシーを使用する際に予想されます。
このポリシーはaddOrRestitu演算でModify効果を利用しており、リソースが作成されたり更新されたりするたびに、リソースグループの値にマッチするよう指定されたタグを更新します—たとえリソースの値がすでに異なっていてもです。
これが、リソースが更新された後に手動で環境タグを変更すると必ず開発者に戻る理由が説明できます。
関数タグが削除されることは予想されていません
しかし、関数タグが消えるのは予想される動作ではありません。
ポリシーは環境タグのみを管理しているため、他の既存のタグを削除しないはずです。あなたのテストによると、Always Ready設定を保存すると、App Service Planの更新とAzureポリシーが相互作用し、ポリシー管理タグのみが保持され、他のタグは削除されるようです。
あなたの追加の承認はこれを強く裏付けています:
ポリシーで管理される環境タグのみの場合、関数タグは消えます。 関数タグにポリシーを割り当てた場合、更新後もそのまま残ります。
これは、ポリシーで書かれたタグのみが更新時に保持されていることを示しています。
正確な原因を特定するために、以下の情報を収集していただけませんか?
App Service Planの更新リクエストをキャプチャする アプリサービスプランのアクティビティログを開きます。 Microsoft.Web/serverfarms/write操作を確認し、リクエストにタグセクションが含まれているか確認してください。 また、関連するMicrosoft.Authorization/policies/modify/actionエントリを確認し、ポリシーの詳細もメモしてください。 変更履歴のレビュー App Service Planリソースを開きます。 履歴変更のページに行き、Always Readyアップデートの前後のタグを比較してください。 Azure Policy モードの検証 ポリシーがIndexedモードに設定されているか確認してください。これはリソースのタグポリシーに推奨されるモードです。 一時的な回避策
根本原因が確認されるまでは、以下のいずれかの回避策を利用できます。
保存が必要なタグごとにAzureポリシーを割り当ててください。あなたのテストによると、これによりタグの削除はうまく防がれています。 あるいは、異なるタグ値を維持する必要がある場合は、Always Readyの設定を変更した後に欠落タグを再適用する方法もあります。
参考になれば幸いです。上記の検査結果をお知らせいただければ、さらにお手伝いいたします。追加検査を行い、結果を共有していただきありがとうございます。Azure Policyがある環境となし環境の比較は非常に参考になりました。
ご提供いただいた情報に基づいて、私たちが見つけた結果は以下の通りです:
**
環境**タグがリソースグループの値に戻ることが予想されますこの動作は、組み込みの**「リソースグループからタグを継承する」**Azureポリシーを使用する際に予想されます。
このポリシーはaddOrRestitu演算でModify効果を利用しており、リソースが作成されたり更新されたりするたびに、リソースグループの値にマッチするよう指定されたタグを更新します—たとえリソースの値がすでに異なっていてもです。
これが、リソースが更新された後に手動で環境タグを変更すると必ず開発者に戻る理由が説明できます。
関数タグが削除されることは予想されていません
しかし、関数タグが消えるのは予想される動作ではありません。
ポリシーは環境タグのみを管理しているため、他の既存のタグを削除しないはずです。あなたのテストによると、Always Ready設定を保存すると、App Service Planの更新とAzureポリシーが相互作用し、ポリシー管理タグのみが保持され、他のタグは削除されるようです。
あなたの追加の承認はこれを強く裏付けています:
ポリシーで管理される環境タグのみの場合、関数タグは消えます。
関数タグにポリシーを割り当てた場合、更新後もそのまま残ります。
これは、ポリシーで書かれたタグのみが更新時に保持されていることを示しています。
正確な原因を特定するために、以下の情報を収集していただけませんか?
App Service Planの更新リクエストをキャプチャする
アプリサービスプランのアクティビティログを開きます。
**Microsoft.Web/serverfarms/write**操作を確認し、リクエストに**タグ**セクションが含まれているか確認してください。 また、関連する**Microsoft.Authorization/policies/modify/action**エントリを確認し、ポリシーの詳細もメモしてください。 **変更履歴のレビュー** **App Service Plan**リソースを開きます。 **履歴変更**のページに行き、**Always Ready**アップデートの前後のタグを比較してください。 **Azure Policy モードの検証** ポリシーが**Indexed**モードに設定されているか確認してください。これはリソースのタグポリシーに推奨されるモードです。 一時的な回避策根本原因が確認されるまでは、以下のいずれかの回避策を利用できます。
保存が必要なタグごとにAzureポリシーを割り当ててください。あなたのテストによると、これによりタグの削除はうまく防がれています。
あるいは、異なるタグ値を維持する必要がある場合は、Always Readyの設定を変更した後に欠落タグを再適用する方法もあります。
参考になれば幸いです。上記の検査結果をお知らせいただければ、さらにお手伝いいたします。
- **
-
伊藤 壮平 • 10 評価のポイント
2026-08-03T07:08:09.05+00:00 Hi @Likhitha Sulake ,
I also reviewed the Activity Log, the Azure Policy definition, and the Change History.
Azure Policy Definition Review
The built-in Azure Policy definition that is applied is Inherit a tag from the resource group if missing (not
Inherit a tag from the resource group).- Mode:
Indexed(I confirmed that the mode isIndexed, as requested) - Effect:
modify - Operation defined in the definition:
add - Condition: the target tag does not exist (
exists: false)
The definition's description states that if the resource already has the tag with a different value, the existing value is left unchanged.
Activity Log Review
The Azure Policy record associated with the
Microsoft.Web/serverfarms/writeoperation on the App Service plan wasMicrosoft.Authorization/policies/modify/action.The recorded details are as follows:
- Policy definition:
Inherit a tag from the resource group if missing - Effect:
modify - Recorded field operation:
Add tags[environment]
The
Microsoft.Web/serverfarms/writeoperation and the Azure Policymodify/actionwere recorded under the same correlation ID and operation ID.However, the Activity Log contains no recorded operation that removes the
functiontag. TheMicrosoft.Web/serverfarms/writeentry reviewed in this case did not indicate whether the update request included atagssection or which tags it contained.Change History Review
Immediately after the Always Ready change, the App Service plan's Change History contained a
Resource Updatedentry withChanged By: UnspecifiedandClient Type: Unspecified.The diff for this change showed that the
functiontag, which had been present before the change, was no longer present afterward. No elements other than tags changed.As a temporary workaround, we are currently reapplying the lost tags each time. However, because manual tag restoration is required after every Always Ready change, this places a significant ongoing operational burden on us.
We would appreciate your continued investigation into whether this difference is expected behavior for the combination of the
Microsoft.Web/serverfarms/writeoperation associated with the Always Ready change and the Azure Policy definitionInherit a tag from the resource group if missing. - Mode:
-
Likhitha Sulake • 105 評価のポイント • Microsoft 外部スタッフ • モデレーター
2026-08-03T15:31:36.7433333+00:00 Hi @伊藤 壮平 ,
Thank you again for the detailed investigation and for sharing the Activity Log, policy definition, and Change History. Based on the information you provided, What we found
The Azure Policy itself does not appear to be deleting the
functiontag.The policy you are using only adds the
environmenttag when it is missing. It does not contain any operation to remove or replace thefunctiontag. Your Activity Log also shows that the policy action was limited to addingenvironment.The more likely cause is the App Service plan update itself.
When the Always Ready setting is changed, the portal appears to perform an update on the App Service plan. Based on the behaviour you observed, that update may be replacing the resource's tag collection instead of preserving all existing tags.
This would explain the behaviour you are seeing:
-
environmentremains because the policy adds it back. -
functiondisappears because it is not managed by that policy. - There is no separate "delete tag" operation in the Activity Log because the tag may be lost as part of the overall resource update.
- The matching correlation ID between the App Service plan update and the policy action further supports that both operations occurred as part of the same update.
At this point, however, the exact request payload that Azure received is required to confirm this mechanism. We don't want to present the above as a confirmed Microsoft product defect without that evidence.
Recommended next step
Since you have already completed the portal-side investigation, the next useful step is to test whether the same Always Ready change behaves differently when performed through the Azure CLI.
If the tags remain intact when the change is made through CLI but are removed when the same change is made through the Azure portal, this would strongly indicate that the issue is specific to the portal update path.
If the tags are removed through both methods, it would instead point more toward the underlying App Service resource-provider update.
Temporary workaround
Until the behaviour is confirmed and addressed, you can protect the
functiontag by managing it through Azure Policy as well.This would allow the policy to restore the tag automatically after an App Service plan update, avoiding the need for your team to manually add it back each time.
Please note that this is a workaround, not a root-cause fix. It is useful for preventing the operational impact while the underlying behaviour is investigated.
-
-
伊藤 壮平 • 10 評価のポイント
2026-08-04T00:18:51.8233333+00:00 Hi @Likhitha Sulake ,
Thank you for your guidance. I conducted similar validation using Azure CLI.
When I changed the Function App's scale configuration with
az functionapp scale config set, the App Service plan's tags were retained, and the issue did not reproduce.I also reviewed the Activity Log for the affected App Service plan at the time of this Azure CLI operation. No operation log entries including
Microsoft.Web/serverfarms/writewere recorded.Within the scope of this validation, I observed differences in both the App Service plan's tags and the Activity Log between changing Always Ready in the Azure portal and changing the scale configuration with Azure CLI. I would appreciate your continued review.
-
Likhitha Sulake • 105 評価のポイント • Microsoft 外部スタッフ • モデレーター
2026-09-10T16:49:55.8833333+00:00 Hi @伊藤 壮平 ,
これはエンジニアリングチームからの最新のアップデートです。[eos]こんにちは、以下のSRに関するコメントありがとうございます。 2608070030000531/、Flex Consumption の Function App の Always Ready 設定を Azure ポータルから変更すると、関連する App Service プラン(
Microsoft.Web/serverfarms)の既存タグが意図せず消えちゃいます。[eos]ICMを出しましたが、Azure Policy 側では特に問題はありませんでした。なので、Azure Functions と App Service のプロセスの HAR ファイルを取得する必要があります。[eos]
App Service チームにお願いしたんですが、Azure Policy 側からもできると言われたので、トレースの取得に少し時間がかかっています。[eos]
その結果、もう少し時間がかかりそうです。
サインインしてコメントする