Azure / container-apps-deploy-pipelines-task

Azure Pipelines Task (Release Candidate) for building and deploying Azure Container Apps
MIT License
6 stars 10 forks source link

FQDN output #27

Closed BC89 closed 1 year ago

BC89 commented 1 year ago

Greetings,

This is more of a question regarding approach and whether there's a way to get the FQDN using this task. It doesn't appear to be the case so I've also tried using a AzurePowerShell@5 task like so but that results in the error:

- task: AzurePowerShell@5
          inputs:
            azureSubscription: 'm445435'
            ScriptType: 'InlineScript'
            Inline: '(Get-AzContainerApp -Name workbench -ResourceGroupName $vResourceGroup).IngressFqdn'
            azurePowerShellVersion: 'LatestVersion'
Get-AzContainerApp: /home/vsts/work/_temp/ebff7ec8-4ee1-446d-8018-5911ebc58d17.ps1:5
Line |
   5 |  (Get-AzContainerApp -Name workbench -ResourceGroupName $vResourceGrou …
     |   ~~~~~~~~~~~~~~~~~~
     | The term 'Get-AzContainerApp' is not recognized as a name of a cmdlet,
     | function, script file, or executable program. Check the spelling of the
     | name, or if a path was included, verify that the path is correct and try
     | again.

Thanks!

cormacpayne commented 1 year ago

@BC89 Hey Brendan, apologies for the delayed response -- two comments for you:

(1) When you mentioned "it doesn't appear to be the case" to get the FQDN from this task, are you asking about this property being exposed by this task?

(2) I used to work on the Azure PowerShell team, so I may be able to provide some insight as to the error that you're seeing above with the Get-AzContainerApp command: from my understanding, the AzurePowerShell@5 task is running the provided script in a context that has the modules bundled with the Az PowerShell module. Currently, the Az.App module is in preview and is not bundled with Az as a result, and thus not available by default when using the AzurePowerShell@5 task. I'm not 100% sure if this is the accurate way to resolve this issue, but you should be able to run something like Install-Module -Name Az.App -Force as a part of your inline script to ensure that this module is readily available when running the Get-AzContainerApp command within the same inline script. The Az.Accounts module that Az.App depends on is already bundled with Az, so there shouldn't be any additional installations required by you.

Please feel free to let me know if you have any additional questions!

BC89 commented 1 year ago

Thanks for the detailed response. I will take this into consideration.


From: Cormac McCarthy @.> Sent: Wednesday, June 14, 2023 5:58 PM To: Azure/container-apps-deploy-pipelines-task @.> Cc: Brendan Carroll @.>; Mention @.> Subject: [External Email] Re: [Azure/container-apps-deploy-pipelines-task] FQDN output (Issue #27)

https://github.com/BC89

From @. 410-316-7820 This is an External Email from outside of KCI.


@BC89 Hey Brendan, apologies for the delayed response -- two comments for you:

(1) When you mentioned "it doesn't appear to be the case" to get the FQDN from this task, are you asking about this property being exposed by this task?

(2) I used to work on the Azure PowerShell team, so I may be able to provide some insight as to the error that you're seeing above with the Get-AzContainerApp command: from my understanding, the @. task is running the provided script in a context that has the modules bundled with the Az PowerShell modulehttps://www.powershellgallery.com/packages/Az. Currently, the Az.App modulehttps://www.powershellgallery.com/packages/Az.App is in preview and is not bundled with Az as a result, and thus not available by default when using the @. task. I'm not 100% sure if this is the accurate way to resolve this issue, but you should be able to run something like Install-Module -Name Az.Apphttp://Az.App -Force as a part of your inline script to ensure that this module is readily available when running the Get-AzContainerApp command within the same inline script. The Az.Accounts module that Az.Apphttp://Az.App depends on is already bundled with Az, so there shouldn't be any additional installations required by you.

Please feel free to let me know if you have any additional questions!

— Reply to this email directly, view it on GitHubhttps://github.com/Azure/container-apps-deploy-pipelines-task/issues/27#issuecomment-1592045893, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAZFIM23GZUAPEU2MTHN5V3XLIXZHANCNFSM6AAAAAAWNX2YUY. You are receiving this because you were mentioned.Message ID: @.***>

cormacpayne commented 1 year ago

@BC89 Hey Brendan, thanks for the response -- for the first question in my previous comment regarding this AzureContainerApps task:

(1) When you mentioned "it doesn't appear to be the case" to get the FQDN from this task, are you asking about this property being exposed by [AzureContainerApps]?

Was there anything actionable that you wanted to see from this task, or are you moving ahead with using the AzurePowerShell task to fetch metadata about the Container App after it's been built and/or deployed by this task? Thanks in advance.

cormacpayne commented 1 year ago

@BC89 I'm going to close this issue for now, but please feel free to leave a comment if there's anything else you'd like to discuss with this item and I'll gladly re-open the issue. Thanks!