When I call the bing speech rest api a few days ago, I get an error and do not return a result.
System.Net.WebException: The remote server returned an error: (503) Server Unavailable.
at System.Net.HttpWebRequest.GetResponse()
at SpeechRESTSample.Program.Main(String[] args) in C:\Users\kaki1\Source\Repos\Cognitive-Speech-STT-ServiceLibrary\sample\SpeechRESTSample\Program.cs:line 78
The remote server returned an error: (503) Server Unavailable.
Renewed token.
or Internal Server Error
Does not provide services?
If I use the sample code directly to get the token then I got the 401 error.
The FetchTokenUri is changed from https://api.cognitive.microsoft.com/sts/v1.0 to
https://{region}.api.cognitive.microsoft.com/sts/v1.0/issueToken
we could get the authentication endpoint from this link.
And the endpoints for the Speech to Text REST API is the following format
https://{region}.stt.speech.microsoft.com/speech/recognition/conversation/cognitiveservices/v1
I also test it locally I can get the token with the endpoint.
For more demo code, please refer to this.
Related
I am trying to do a Get Request for REST API Azure from Postman.
https://dev.azure.com/{organization}/{project}/_apis/pipelines/{pipelineId}/runs/{runId}?api-version=6.0-preview.1
I am trying to do the auth with my PAT (empty username and PAT as password) and I get 401 status code.
Can anyone tell me why it is not working ?
I dont have Full access token, I am using Custom access scope with ToKenAdmin and Tokens Scope added.
When I just try to access the link from browser, it works.
Azure DevOps Rest Call giving 401 status code
The 401 status code indicates a permission issue.
You should have the token with ToKen Build (Read):
I am trying to use an AWS single sign on script from my company to log into aws using the internal Azure Platform. When trying to log into the platform using SSO, I receive the following error messages:
Logging in to Azure AD...
Please enter your username(email address): test#company.com
Please enter your password: ********
Login failed: Authorization failed, please activate company's VPN.
The logs of the sso script show me this information:
2022-07-11 11:57:42,042 auth_with_adfs 207 | DEBUG | loginMessage: Authorization failed
2022-07-11 11:57:42,042 log_in_to_aad 174 | ERROR Login failed: Authorization failed, please activate your company's VPN.
I have activated the VPN so that is not the issue.
By looking at the internals of the files that raise those errors I found out that during the failed login process the login page for the Microsoft Office 365 Identity Platform is returned.
The login webpage tells me that I receive the following error when logging in with my credentials:
Error details: MSIS7012: An error occurred while processing the request. Contact your administrator
My POST request seems to be redirected with a 302 code and GET the login page with a 200 OK response.
So I can tell that I get stuck during the login process and according to the error message it is an authorization issue. My credentials are correct so I am wondering what needs to be changed here to get correct access? Is there some permissions missing I should have a closer look at? Do I need to make changes in AzureAD somehow?
Thanks in advance for looking into this, I know the information is sparse but I hope it is enough.
I am trying to connect to Microsoft Defender API using Elastic Filebeat. I followed the instructions here register a new application with granted permission.
Create app for Microsoft Defender
However, when trying to call the api, i encountered this message:
Error while processing http request: failed to execute http client.Do:
server responded with status code 403:
{"error":{"code":"Forbidden","message":"The application does not have
any of the required application permissions (Alert.ReadWrite.All,
Alert.Read.All, Incident.ReadWrite.All, Incident.Read.All) to access
the resource.","target":}} {"input_source":
"https://api.security.microsoft.com/api/incidents", "input_url":
"https://api.security.microsoft.com/api/incidents"}
Can anyone assist me on this ?
EDIT: Added JWT token screenshot for reference if needed
JWT decoded screenshot
Your token lacks permissions, you need to use the client credential flow to obtain the token:
Parse the token:
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.
All of a sudden my bot started to get this error:
[onTurnError] unhandled error: Error: Get Token request returned http error: 401 and server response: {"error":"invalid_client","error_description":"AADSTS7000222: The provided client secret keys are expired. Visit the Azure Portal to create new keys for your app, or consider using certificate credentials for added security: https://learn.microsoft.com/azure/active-directory/develop/active-directory-certificate-credentials\r\nTrace ID: 91097c7f-35a4-4f95-97bc-d616a6b45100\r\nCorrelation ID: e0110013-d13c-4897-aafc-f2e36a194ed5\r\nTimestamp: 2021-03-01 20:00:25Z","error_codes":[7000222],"timestamp":"2021-03-01 20:00:25Z","trace_id":"91097c7f-35a4-4f95-97bc-d616a6b45100","correlation_id":"e0110013-d13c-4897-aafc-f2e36a194ed5","error_uri":"https://login.microsoftonline.com/error?code=7000222"}
It sounds like your Direct Line secret has expired, assuming you are trying to hit https://directline.botframework.com/v3/directline/tokens/generate. You can regenerate them by going to the Bot Service blade, selecting your Bot Service, and then clicking on Channels. Click Edit on your Direct Line channel and you'll have the option to regenerate your key(s).