I'm trying to publish app from Azure DevOps to appcenter.ms
I have code building and artifacts are being generated. However, step to upload the app to appcenter always fails with the same error:
2019-01-28T14:40:34.0252515Z ##[error]"<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<title>Error</title>\n</head>\n<body>\n<pre>Cannot POST //apps//company/appname//release_uploads</pre>\n</body>\n</html>\n"
http response code: 404
I have added a service connection under Azure DevOps:
Name: api
Server URL: https://api.appcenter.ms
API Token: XXXXX
I'm using App Center Distribute step to publish.
Under build config I got app slug set correctly. What API endpoint I should use?
You can use this endpoint. I've got this issue too and stuck up for days trying to find the right answer but no reference says they change the endpoint.
Server URL: https://api.mobile.azure.com/v0.1
Although the instructions currently suggest otherwise I had success in using the org style APP SLUG setting and it fixed my issue.
{user}/{appname} is the format that worked for me.
Related
What is the permission required to upload an asset to a release via a github app? (no OAuth)
I need to POST to url like https://{{git_url}}/api/uploads/repos/{{owner}}/{{repo}}/releases/{{releaseNumber}}/assets?name={{assetName}}
In the permission page there is no POST to /repos/:owner/:repo/releases/:release_id/assets
Im on GitHub Enterprise 2.22.17.
Currently I am getting
502 Bad Gateway {
message: 'Error uploading to https://media.{{git_url}}/releases/{{releaseNumber}}/files: 404',
request_id: '******'
}
Unclear to me as well. I do get this error from a GitHub Actions step trying to deploy something to GitHub Releases, until I created a custom Personal Access Token that has full repo permissions, and nothing else selected:
I haven't yet tried deselecting any of those to get the smallest set required.
GitHub Enterprise 3.0.13 here.
I followed the directions from https://learn.microsoft.com/en-us/rest/api/computervision/3.1/describeimage/describeimage but each time I fill in my endpoint, as https://[resource_name].cognitiveservices.azure.com or https://southcentralus.api.cognitive.microsot.com, I get a 404 or 401 error, respectively. I've checked to make sure the image url I specify works and loads fine withOUT a 404. Can anyone help?
You can use both hosts below to send request:
https://<your service name>.cognitiveservices.azure.com
https://<your service loaction>.api.cognitive.microsoft.com
You can find all of then on Azure Portal=>Cognitive services=>your service =>Keys and Endpoint:
You should involve key as request header:Ocp-Apim-Subscription-Key to avoid 401 error just as below:
Let me know if you have any more questions.
I'm following the instructions for setting up a Blazor Web Assembly hosted using Azure AD B2C located here: https://learn.microsoft.com/en-us/aspnet/core/blazor/security/webassembly/hosted-with-azure-active-directory-b2c?view=aspnetcore-5.0
When the login is clicked a message appears stating 'There was an error trying to log you in: 'Error: could not resolve endpoints. Please check network and try again. Detail: TypeError: NetworkError when attempting to fetch resource.'
In the debug window the message is displayed: Microsoft .AspNetCore.Authorization.DefaultAuthorizationService[2] Authorization failed. These requirements were not met: DenyAnonymousAuthorizationRequirement: Requires an authenticated user.
In the Microsoft instructions for this error message the recommendation is in Azure for the app set the manifest setting of allowPublicClient to null or true. I set this attribute for both the server app and the client app to true but this did not make a difference.
I was able to follow the instructions in your link and make it work.
Some things to try for the client app registration:
'Authentication': For the 'Platform configurations' make sure you choose SPA and the redirect urls are correct
'Authentication': For 'Implicit grant' don't check 'Access tokens' and 'ID tokens'
'API permissions' make sure you added the server registration and clicked 'Grant admin consent'
In my case, this error was a false positive. I fixed my real problem by adding this code to the .csproj file in the Client project:
<ItemGroup>
<TrimmerRootAssembly Include="Microsoft.Authentication.WebAssembly.Msal" />
</ItemGroup>
I'm developing an API using VS 2017, which I'm testing using Postman. I've been following this blog post Getting started with Windows Azure AD Authentication using Postman. I finally got it to give me an access token and a refresh token. About 3 quarters of the way through the post I came across this:
resource : https://management.core.windows.net
which has to be put into Postman (I'm using the Windows app version of Postman). I wasn't sure what that was for, so I left it off. I eventually got an access token and a refresh token, but when I when to get more info for all subscriptions, I got errors saying that I had specified a valid resource. So, I thought what I'd have to do was start over again, but re-authenticating and getting a code from Azure. I did so, and put that into Postman, as the blog post instructs. However, issuing this POST results in this error:
"error": "unauthorized_client",
"error_description": "AADSTS70002: Error validating credentials. AADSTS65005: Invalid resource. The client has requested access to a resource which is not listed in the requested permissions in the client's application registration. Client app ID: d37abf69-42ce-4571-b146-f3422e73f041. Resource value from request: https://management.core.windows.net. Resource app ID: 797f4846-ba00-4fd7-ba43-dac1f8f63013. List of valid resources from app registration: 00000002-0000-0000-c000-000000000000.\r\nTrace ID: 9f028899-6d03-409e-8db4-4e9905000300\r\nCorrelation ID: ec253a1b-9fdc-495f-9310-6b40a42e5d93\r\nTimestamp: 2018-11-19 22:20:02Z",
"error_codes": [
70002,
65005
]
I don't understand why nor what I could have done wrong. I've prespecified the resource as the tutorial instructed, so what have I done wrong?
Looking at the error message, it seems you could have missed adding relevant permissions for "Windows Azure Service Management API" to your app registration.
Steps:
Go to Azure Portal > Azure AD > App registrations > Your app (with app id: d37abf69-42ce-4571-b146-f3422e73f041)
Go to Settings > Required permissions > Add > Select "Windows Azure Service Management API"
Select the relevant permission under Delegated permissions section. Click on select and then "Done". You should get a notification in portal that successfully added permissions. You should see Windows Azure Service Management API listed under required permissions as well.
After these steps, continue as per the blog post you've mentioned with Postman steps to get the access token again.
I found myself in the same situation when i was trying to setup Postman. Its not as complicated as most blogs make seem. I created a tutorial to try to make the process easy.
http://hazelnest.com/blog/blog/2018/11/17/azure-postman-configuration/
https://youtu.be/2bfgeBKRxl4
Hope this helps.
I was able to successfully create a test API and host in Azure. However when I try to create the proxy client, I receive the following error.
[Fatal]Error generating service model: The operation 'Get' has a body
parameter, but did not have a supported MIME type ('application/json')
in its Consumes property.
Exception: There was an error during code
generation when trying to add a client for the Microsoft Azure API App
Generating client code and adding to project failed
I checked the Swagger file and the Contains node was empty. When I change it to
"consumes": [
"application/json",
"application/xml"
]
the proxy creation works. Why did the auto-generated Swagger json not have the Contains property set? I went with the default SwaggerConfig when I created the API app. Am I missing some configuration? Any help will be greatly appreciated.
As I found out from the comments, the solution is to to remove the HttpRequestMessage as parameter of the Action. This will enable the API App Client to generate the code OK.
If you need to mock the object, please follow the documented way from here or another example here.