![](/img/trans.png)
[英]How to deploy App Service with Azure Container Registry by cdktf
[英]Failed to deploy Azure Function using Aure Container Registry
我們的團隊已經建立了一個 ansible-playbook 來部署 Azure Function 使用這個參考。 我們使用用戶分配的身份從 ACR 中提取 function 應用程序圖像,如下所示:
- name: Force Login using identity
command: az login --identity
- name: Get subscriptionId
command: az account show --query id --output tsv
register: subscriptionId
- name: Get functionapp identity's clientId
command: az identity show --resource-group "{{ functionapp_resource_group }}" --name "{{ functionapp_user_identity }}" --query clientId --output tsv
register: identityId
- name: Use functionapp identity for acr pull
command:
az resource update
--ids /subscriptions/{{ subscriptionId.stdout }}/resourceGroups/{{ functionapp_resource_group }}/providers/Microsoft.Web/sites/{{ functionapp_name }}/config/web
--set properties.acrUseManagedIdentityCreds=True
--set properties.AcrUserManagedIdentityID={{ identityId.stdout }}
- name: Config the functionapp
command:
az functionapp config appsettings set --name "{{ functionapp_name }}"
--resource-group "{{ functionapp_resource_group }}"
--settings
"Key1={{ Value1 }}"
"Key2={{ Value2 }}"
- name: Deploy the functionapp
command:
az functionapp config container set --name "{{ functionapp_name }}"
--resource-group "{{ functionapp_resource_group }}"
--docker-custom-image-name "{{ docker_registry_host }}/{{ image_name }}:{{ image_tag }}"
--docker-registry-server-url "{{ docker_registry_host }}"
通常,腳本工作正常。 部署成功的日志應該是這樣的:
然而,我們今天遇到了一個奇怪的故障。 部署鏡像時,Azure Portal 顯示不完整的日志:
有誰知道為什么會發生這種故障?
我終於想通了,這可能意味着今天沒有進一步的 docker 日志。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.