Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set-AzureADApplicationLogo not working #20

Open
gabbsmo opened this issue Oct 1, 2020 · 3 comments
Open

Set-AzureADApplicationLogo not working #20

gabbsmo opened this issue Oct 1, 2020 · 3 comments

Comments

@gabbsmo
Copy link

gabbsmo commented Oct 1, 2020

I am using the following command to set the logo of a app registration: Set-AzureADApplicationLogo -ObjectId $app.ObjectId -FilePath ".\logo.png"

The output is the following error:

Set-AzureADApplicationLogo : Invalid image file
At line:1 char:1
+ Set-AzureADApplicationLogo -ObjectId $app.ObjectId -FilePath ".\metas ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Set-AzureADApplicationLogo], IOException
    + FullyQualifiedErrorId : System.IO.IOException,Microsoft.Open.AzureAD16.Graph.PowerShell.Custom.Cmdlet.SetApplica
   tionMainLogoCustom

At first I thought the image was too large so I changed it to a 215x215 png as per the guidelines but that did not help.

@buerklma
Copy link

Try to use an absolute path for FilePath. That worked for me.

@gabbsmo
Copy link
Author

gabbsmo commented Oct 27, 2020

Thanks @buerklma. I am now using the following code that works:

$logo = Join-Path (Get-Location) "logo.png"
Set-AzureADApplicationLogo -ObjectId $objectId -FilePath $logo

Using har larger image file also seem to work regardless of the guidelines.

@code4clouds
Copy link

code4clouds commented Sep 21, 2021

It is not working for me in Azure Cloud shell, even with the absolute FilePath

PS /home/github.com/code4clouds/Microsoft-commercial-marketplace-SaaS-offer-billing-SDK/deployment/Templates> Set-AzureADApplicationLogo -ObjectId  xxxx-xxxx-xxxxxx  -FilePath ./applogo.png
Set-AzureADApplicationLogo: Invalid image file
PS /home/github.com/code4clouds/Microsoft-commercial-marketplace-SaaS-offer-billing-SDK/deployment/Templates> file ./applogo.png
./applogo.png: PNG image data, 96 x 96, 8-bit/color RGBA, non-interlaced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants