OfficeDev / microsoft-teams-apps-requestateam

Power Platform based solution that allows users to request teams and automates team creation. NO LONGER MAINTAINED. Please use 'Provision Assist' - https://github.com/pnp/provision-assist-m365/ instead.
MIT License
236 stars 66 forks source link

Error creating Azure AD App #364

Closed JESS-arichards closed 2 years ago

JESS-arichards commented 2 years ago

Description

Error appears in script when created Azure AD app. Script continues and reports success but no app is created. Error report problem with password

Steps to reproduce

Running the script with the parameters a few timesbrings the same result

Expected results

Azure AD App created

Actual Results

No Azure AD App created

Solution component

Deployment Script

Operating system (environment)

Windows

Additional Info

No response

Leviani commented 2 years ago

I am getting the same Error. After the Notification: "This command or command group has been migrated to Microsoft Graph API. Please carefully review all breaking changes introduced during this migration"

There is an error saying unrecognized arguments: --password

The rest of the installation continues, until hitting an Error for the API Connection creation, which complains about argument --id: expected one argument which is supposed to be the App ID, used in the API Connector.

Did not encounter this issues a few weeks ago, so I would guess this is fairly new. teamsCreatorSetup

Leviani commented 2 years ago

And after digging a bit deeper, the issue is in line 544 of the deploy.ps1. az ad app create --display-name $appName --required-resource-accesses './manifest.json' --password $global:appSecret --end-date '2299-12-31T11:59:59+00:00'

Looking at the Microsoft Graph Migration Article https://docs.microsoft.com/en-us/cli/azure/microsoft-graph-migration I can see that: az ad app create/update has the following change: Remove --password and --credential-description. Use az ad app credential reset to let Graph service create a password for you (https://github.com/Azure/azure-cli/issues/20675)

So it seems that the Deploy.ps1 needs to be updated to reflect the new az ad app create command.

nickmac88 commented 2 years ago

Is there a work around to this issue? I need to be able to deploy this and am happy to do some legwork, but as is, the deployment script is not good for me.

nickmac88 commented 2 years ago

Is there a work around to this issue? I need to be able to deploy this and am happy to do some legwork, but as is, the deployment script is not good for me.

For anyone else wondering... I was able to get to a workaround by commenting out --password $global:appSecret on line 530 and line 544 of the deploy.ps1 file.

In the event that these lines change you can search for the following lines in the script and just make sure to comment out or delete "password $global:appSecret"

az ad app update --id $app.appId --required-resource-accesses './manifest.json' #--password $global:appSecret

and

az ad app create --display-name $appName --required-resource-accesses './manifest.json' --end-date '2299-12-31T11:59:59+00:00 #--password$global:appSecret

After commenting these line out you will need to run the refreshclientsecret.ps1 described in the following wiki.

https://github.com/OfficeDev/microsoft-teams-apps-requestateam/wiki/Refreshing-Expired-Secrets

hopefully there will be a fix for this soon, but either way this is a solid workaround and only added a couple minutes to the deployment.

alexc-MSFT commented 2 years ago

Hi All,

Can you please ensure you have the latest deploy.ps1 script, I fixed these issues about a month ago now and updated the cmdlets as required.

Thanks

dav1dbailey commented 2 years ago

Hi All,

Can you please ensure you have the latest deploy.ps1 script, I fixed these issues about a month ago now and updated the cmdlets as required.

Thanks

Hi. I have found that the deployment guide Step 1 states to : "Download the latest release" which links to the page with 'Source code (zip) ' available to download. However the package is different to master, you need to use the "package" which is 'Master' that is referred to in the 'Prerequisites' section above Step 1. It's the master that contains the latest release NOT the link stating "Latest release".

nickmac88 commented 2 years ago

Hi All, Can you please ensure you have the latest deploy.ps1 script, I fixed these issues about a month ago now and updated the cmdlets as required. Thanks

Hi. I have found that the deployment guide Step 1 states to : "Download the latest release" which links to the page with 'Source code (zip) ' available to download. However the package is different to master, you need to use the "package" which is 'Master' that is referred to in the 'Prerequisites' section above Step 1. It's the master that contains the latest release NOT the link stating "Latest release".

This was exactly my issue.

nickmac88 commented 2 years ago

Hi All,

Can you please ensure you have the latest deploy.ps1 script, I fixed these issues about a month ago now and updated the cmdlets as required.

Thanks

Will do, thanks for the update!

Leviani commented 2 years ago

I guess this confusion could be easily circumvented if both Links in the Deployment Guide would point towards the same package ;) image

alexc-MSFT commented 2 years ago

Sorry folks, I have updated both the release and the documentation, so the latest version is linked from the deployment guide. Thanks