Azureã³ã©ã 第11åãAzure Virtual Desktop éç¨èªåå Vol.2ã
Azure Virtual Desktop éç¨èªåå Vol.2ã§ã¯ãVol.1ã«ã¦ä½æããã¹ã¯ãªããããã¼ã¹ã«ãAzure DevOpsã¨ã®é£æºã«ããæ´ãªãèªååããå±ããã¾ãã
- æ¡ä»¶ã»å¶ç´
- ã¹ã¯ãªããã®å¤æ´ç¹
- [Entra ID] ãµã¼ãã¹ããªã³ã·ãã«ã®ä½æ
- [Azure DevOps] çµç¹ã®ä½æï¼ããã¸ã§ã¯ãã®ä½æ
- [Azure DevOps] ããã¸ã§ã¯ãã®ãµã¼ãã¹æ¥ç¶ç»é²
- [Azure DevOps] ãªãã¸ããªã®ä½æ
- [Azure DevOps] ãã¤ãã©ã¤ã³ã®å¤æ°ã°ã«ã¼ãç»é²
- [Azure DevOps] ãã¤ãã©ã¤ã³ã®ä½æ
- [Azure DevOps] ãã¤ãã©ã¤ã³ã®ã¢ã¯ã»ã¹è¨±å¯è¨å®
- [Azure DevOps] ãã¤ãã©ã¤ã³ã®å®è¡
- å¥æ·»
- ãããã«
æ¡ä»¶ã»å¶ç´
- â!!!!! ã¹ã¯ãªããã®å®è¡ã¯èªå·±è²¬ä»»ã§ãé¡ããã¾ã !!!!!
- âPowerShellã¢ã¸ã¥ã¼ã«ã¯2024å¹´8æ20æ¥æç¹ã§ææ°åãã¦åä½ç¢ºèªãè¡ã£ã¦ãã¾ãã
ã¹ã¯ãªããã®å¤æ´ç¹
Vol.1ããã¹ã¯ãªããã®å¤æ´ãè¡ã£ã¦ãã¾ãã®ã§ãã¾ãã¯ãã®å 容ãè¨è¼ãã¾ãã
â ãã©ã«ãé層ã®åç·¨
Vol.1ã§ã¯ã¹ã¯ãªãããã¡ã¤ã«ã¨ARMãã³ãã¬ã¼ãã®2ã¤ã®ãã©ã«ãã®ã¿ã§ããããå
±éåããã³ãã©ã¡ã¼ã¿ãã¡ã¤ã«ã®åãåºãã®ããã«ä¸è¨ã®ãã©ã«ãé層ã«åç·¨ãã¦ãã¾ãã
root ââdeploy --- ã¹ã¯ãªããã«èªã¿è¾¼ã¾ãããã©ã¡ã¼ã¿ãã¡ã¤ã« â ââmaster â ââprod â ââtest ââparameters --- ARMãã³ãã¬ã¼ãã®ãã©ã¡ã¼ã¿ãã¡ã¤ã« ââscripts --- ã¹ã¯ãªãããã¡ã¤ã«æ¬ä½ ââtemplates --- ARMãã³ãã¬ã¼ãã®ãã³ãã¬ã¼ããã¡ã¤ã«
â ãã©ã¡ã¼ã¿ãã¡ã¤ã«ã®åãåºã
Vol.1ã§ã¯ã¹ã¯ãªãããã¡ã¤ã«ã®ä¸ã«ãã©ã¡ã¼ã¿ãç´æ¥è¨è¼ãã¦ãã¾ããããã¹ã¯ãªãããã¡ã¤ã«ã®å
±éåã®ããã«ãã©ã¡ã¼ã¿ã¯åãåºãã¦ç°å¢ãã¨ã«ãã¡ã¤ã«ãä½æããå½¢ã«ãã¾ããã
â ã¹ã¯ãªããå®è¡æ¹æ³ã®å¤æ´
ãã©ã¡ã¼ã¿ãã¡ã¤ã«ã®åãåºãã«ä¼´ããã¹ã¯ãªããå®è¡ã³ãã³ãã§ãã©ã¡ã¼ã¿ãã¡ã¤ã«ã®ãã¹ãæå®ããå½¢ã«ãªã£ã¦ãã¾ãã
./scripts/Add_Host.ps1 ../deploy/prod/Add_Host.param.ps1
次ã®ã»ã¯ã·ã§ã³ããAzure DevOpså¨ãã®è¨å®ã«å ¥ã£ã¦ããã¾ãã
[Entra ID] ãµã¼ãã¹ããªã³ã·ãã«ã®ä½æ
Azure DevOpsã®åã«Entra IDã«ãã¤ãã©ã¤ã³ã§ä½¿ç¨ãããµã¼ãã¹ããªã³ã·ãã«ãä½æãã¾ããç¶ãã¦ã¯ã©ã¤ã¢ã³ãã·ã¼ã¯ã¬ãããä½æãã¦æå
ã«æ§ãã¦ãã ããã
æ¬ç¨¿ã§ã¯ãã®ãµã¼ãã¹ããªã³ã·ãã«ã«Azure Virtual Desktopãµãã¹ã¯ãªãã·ã§ã³ã®å
±åä½æè
ãå²ãå½ã¦ã¦ãã¾ãã
[Microsoft Entra ã¢ããªãç»é²ãããµã¼ãã¹ ããªã³ã·ãã«ãä½æãã]
https://learn.microsoft.com/ja-jp/entra/identity-platform/howto-create-service-principal-portal
â»ãªãã¤ã¬ã¯ã URIã¯æªç»é²ã§å¤§ä¸å¤«ã§ã
[Azure DevOps] çµç¹ã®ä½æï¼ããã¸ã§ã¯ãã®ä½æ
ãã¦ãããããAzure DevOpsã®è¨å®ã«å
¥ã£ã¦ããã¾ããã¾ãAzure DevOpsãéè¨ããã¦ããªãå ´åã¯ãçµç¹ã®ä½æããã³ããã¸ã§ã¯ãä½æãè¡ãã¾ãã
å ãã¦ç¡ææ ã使ç¨ããå ´åã¯ã[Azure Pipelines ã®ç¡æä»ä¸ã«å¯¾ããå¤æ´]ã«è¨è¼ã®ç³è«ãè¡ã£ã¦ãã ãããï¼æ¬ç¨¿ã§ã¯ããããã£ã¦ãªãã¦ä¸ç¬ã¯ã¾ãã¾ããâ¦ï¼
[çµç¹ã®ä½æ]
https://learn.microsoft.com/en-us/azure/devops/organizations/accounts/create-organization?view=azure-devops
[Azure DevOps ã§ã®ããã¸ã§ã¯ãã®ä½æ]
https://learn.microsoft.com/en-us/azure/devops/organizations/projects/create-project?view=azure-devops&tabs=browser
[Azure Pipelines ã®ç¡æä»ä¸ã«å¯¾ããå¤æ´]
https://learn.microsoft.com/en-us/azure/devops/release-notes/2021/sprint-184-update#azure-pipelines-1
[Azure DevOps] ããã¸ã§ã¯ãã®ãµã¼ãã¹æ¥ç¶ç»é²
Azure DevOpsããã¸ã§ã¯ãã®è¨å®ã§ããµã¼ãã¹æ¥ç¶ã«å ã«åå¾æ¸ã¿ã®ãµã¼ãã¹ããªã³ã·ãã«ãç»é²ãã¾ãã
[æ¢åã®ãµã¼ãã¹ ããªã³ã·ãã«ã使ç¨ãã Azure Resource Manager ãµã¼ãã¹æ¥ç¶ãä½æãã]
https://learn.microsoft.com/en-us/azure/devops/pipelines/library/connect-to-azure?view=azure-devops#create-an-azure-resource-manager-service-connection-that-uses-an-existing-service-principal
[Azure DevOps] ãªãã¸ããªã®ä½æ
Azure Reposã«ãªãã¸ããªãä½æãã¦ã³ã¼ããç»é²ãã¾ãã
[ãªãã¸ããªã®ä½æ]
https://learn.microsoft.com/en-us/azure/devops/repos/git/create-new-repo?view=azure-devops
[Azure DevOps] ãã¤ãã©ã¤ã³ã®å¤æ°ã°ã«ã¼ãç»é²
ãã©ã¡ã¼ã¿ãã¡ã¤ã«å
ã®èªè¨¼æ
å ±ç§å¿åã®ãããAzure Pipelinesã®ã©ã¤ãã©ãªã«å¤æ°ã°ã«ã¼ããç»é²ãã¾ãã
æ¬ç¨¿ã§ã¯ä»®æ³ãã·ã³ç®¡çè
ã¨ãã¡ã¤ã³ç®¡çè
ã®èªè¨¼æ
å ±ãç»é²ãã¦ãã¾ãã
[å¤æ°ã°ã«ã¼ãã管çãã]
https://learn.microsoft.com/en-us/azure/devops/pipelines/library/variable-groups?view=azure-devops&tabs=azure-pipelines-ui%2Cyaml
[Azure DevOps] ãã¤ãã©ã¤ã³ã®ä½æ
Azure Pipelinesã§ãã¤ãã©ã¤ã³ã®ä½æãè¡ãã¾ãã
æ¬ç¨¿ã§ã¯æ次æ´æ°ããã¼ã®ãã¡ä¸è¨ã®5ã¤ã®ããã¼ããã¤ãã©ã¤ã³åã®å¯¾è±¡ã¨ãªãã¾ãã
Step | ããã¼ | Pipelines | |
---|---|---|---|
1 | ãã¹ã¿ã¼VMã®ããã㤠| ååæ´æ°æã«åå¾ããã¹ãããã·ã§ãããããã¹ã¿ã¼VMãããã㤠| Deploy_Master |
2 | ãã¹ã¿ã¼VMã®æ´æ°â | 1. æ´æ°ããã°ã©ã ã®é©ç¨ 2. ï¼ããã°ï¼FSLogixã®æ´æ° 3. ãã£ã¹ã¯ã¯ãªã¼ã³ã¢ãã |
â» æ¬ç¨¿ã®èªååå¯¾è±¡å¤ |
3 | ã¹ãããã·ã§ããåå¾ | ãã¹ã¿ã¼VMã®ã¹ãããã·ã§ããåå¾ | Create_Snapshot |
4 | ãã¹ã¿ã¼VMã®æ´æ°â¡ | sysprepå®è¡ | â» æ¬ç¨¿ã®èªååå¯¾è±¡å¤ |
5 | ã¤ã¡ã¼ã¸ã®ãã£ãã㣠| ãã¹ã¿ã¼VMãã®ã£ã©ãªã¼ã¤ã¡ã¼ã¸ã«ãã£ãã㣠| Capture_Mater |
6 | ãã¹ãAVDã®ããã㤠| ã®ã£ã©ãªã¼ã¤ã¡ã¼ã¸ãããã¹ãAVDãããã㤠| Add_Host_test |
7 | ãã¹ãå®æ½ | ãã¹ãAVDã«ã¦æ¥ç¶ãã¹ããå®æ½ | â» æ¬ç¨¿ã®èªååå¯¾è±¡å¤ |
8 | æ¬çªAVDã®ããã㤠| ã®ã£ã©ãªã¼ã¤ã¡ã¼ã¸ããæ¬çªAVDãããã㤠| Add_Host_Prod |
9 | ãªã½ã¼ã¹ã¯ãªã¼ã³ã¢ãã | å¤ãAVDãªã©ä¸è¦ãªãªã½ã¼ã¹ãã¯ãªã¼ã³ã¢ãã | â» ãã¤ãã©ã¤ã³åå¯¾è±¡å¤ |
ãã¤ãã©ã¤ã³ã®ã³ã¼ãã¯å¤æ°ã°ã«ã¼ã使ç¨æç¡ã®å·®ç°ã§2ãã¿ã¼ã³ã«åããã¾ãã®ã§ãããã§ã¯ããããã®yamlãã³ãã¬ã¼ããè¨è¼ãããã¾ãã
â å¤æ°ã°ã«ã¼ãã使ç¨ããªããã¤ãã©ã¤ã³
# Comment trigger: - none pool: vmImage: ubuntu-latest steps: - task: CmdLine@2 inputs: script: 'tree' - task: AzurePowerShell@5 inputs: azureSubscription: 'ãµã¼ãã¹æ¥ç¶ã®åå' ScriptType: 'FilePath' ScriptPath: 'ã¹ã¯ãªãããã¡ã¤ã«ã®ãã¹' ScriptArguments: 'ãã©ã¡ã¼ã¿ãã¡ã¤ã«ã®ãã¹' azurePowerShellVersion: 'LatestVersion'
â å¤æ°ã°ã«ã¼ãã使ç¨ãããã¤ãã©ã¤ã³
# Comment trigger: - none pool: vmImage: ubuntu-latest variables: - group: å¤æ°ã°ã«ã¼ãã®åå steps: - task: CmdLine@2 inputs: script: 'tree' - task: AzurePowerShell@5 env: ADMINISTRATOR_ACCOUNT_USERNAME : $(ãã¡ã¤ã³ç®¡çè ã¦ã¼ã¶ã¼å¤æ°ã®åå) ADMINISTRATOR_ACCOUNT_PASSWORD : $(ãã¡ã¤ã³ç®¡çè ãã¹ã¯ã¼ãå¤æ°ã®åå) VM_ADMINISTRATOR_ACCOUNT_USERNAME : $(ä»®æ³ãã·ã³ç®¡çè ã¦ã¼ã¶ã¼å¤æ°ã®åå) VM_ADMINISTRATOR_ACCOUNT_PASSWORD : $(ä»®æ³ãã·ã³ç®¡çè ãã¹ã¯ã¼ãå¤æ°ã®åå) inputs: azureSubscription: 'ãµã¼ãã¹æ¥ç¶ã®åå' ScriptType: 'FilePath' ScriptPath: 'ã¹ã¯ãªãããã¡ã¤ã«ã®ãã¹' ScriptArguments: 'ãã©ã¡ã¼ã¿ãã¡ã¤ã«ã®ãã¹' azurePowerShellVersion: 'LatestVersion'
[Azure DevOps] ãã¤ãã©ã¤ã³ã®ã¢ã¯ã»ã¹è¨±å¯è¨å®
ãã¤ãã©ã¤ã³ã®ä½æå¾ããµã¼ãã¹æ¥ç¶ã¨å¤æ°ã°ã«ã¼ãã«ãã¤ãã©ã¤ã³ã®ã¢ã¯ã»ã¹è¨±å¯è¨å®ãè¡ãã¾ãã
[Azure Pipelines ã§ãµã¼ãã¹æ¥ç¶ã®ã»ãã¥ãªãã£ãè¨å®ãã]
https://learn.microsoft.com/en-us/azure/devops/pipelines/policies/permissions?view=azure-devops#set-service-connection-security-in-azure-pipelines
[å¤æ°ã°ã«ã¼ãã®ã»ãã¥ãªã㣠ãã¼ã«ãè¨å®ãã]
https://learn.microsoft.com/en-us/azure/devops/pipelines/policies/permissions?view=azure-devops#set-variable-group-security-roles
[Azure DevOps] ãã¤ãã©ã¤ã³ã®å®è¡
ããã§ãã¤ãã©ã¤ã³ã®æºåãæ´ãã¾ããã®ã§ã試ãã«Deploy_Masterãå®è¡ãã¦ã¿ã¾ãã
ç¡äºå®è¡ããä»®æ³ãã·ã³ãä½æããã¾ããã
å¥æ·»
ãç´¹ä»ããã¹ã¯ãªããã¯ä¸è¨ã®GitHubã«ã¦å
¬éãã¦ããã¾ãã®ã§ARMãã³ãã¬ã¼ãã¨åããã¦ãåç
§ãã ããã
https://github.com/mstechcenter/avd-operation
ãããã«
Azure Virtual Desktop éç¨èªåå Vol.2ã¯ããããã§ããã§ããããï¼
Vol.1ããã®ãã¼ã¸ã§ã³ã¢ããã«ããå°ãæéãããããã¨æãã¾ãããæå¤ã¨ãããªãããã¾ãããå¼ã£ããã£ãã®ã¯Azure DevOpsã®ç¡ææ ã®ç³è«ãããã§ããããã
å¹æã¨ãã¦ã¯ãã¾ããµã¼ãã¹ããªã³ã·ãã«ãèªè¨¼æ
å ±ãç§å¿åãã¦ã»ãã¥ãªãã£å¼·åº¦ãé«ãããããã¨ãæããããã¨æãã¾ãããã¨ã¯VSCodeã§ãã©ã¡ã¼ã¿æ´æ°âãã©ã¦ã¶ã§ãã¤ãã©ã¤ã³å®è¡ã¨ããæé ã¸ã®å¤åããæéã®é¢ã§ã¡ãã£ã¨çååãããã®ã¨ããªãã®å®å¿æãå¾ãããã¨æãã¾ãããç¹ã«å¾è
ã®å®å¿æã¯å¹æã¨ãã¦çµæ§å¤§ããã£ãã§ãã
å人ã®æ触ã¨ãã¦ã¯å¤§æåã¨è¨ããçµæã§ããã
Vol.3ã§ã¯ããæ ¼å¥½è¯ãããã«ãªã¯ã¨ã¹ãï¼ãã¼ã¸ãªã¯ã¨ã¹ãï¼é§åããã®ãã¤ãã©ã¤ã³å®è¡ãå®è£
ãã¦ããã¾ãã
- â»æä¸ã®åååãä¼ç¤¾åãå£ä½åã¯ãä¸è¬ã«å社ã®åæ¨ã¾ãã¯ç»é²åæ¨ã§ãã