Azure Triggered Webjob and Oauth - aborting webjob - azure

i'm having continual trouble keeping a triggered webjob up and running on Azure, after digging around in some logs i located one for the 'start' webjob it looks to me there is an authorisation on the service which is specifically scoped for the triggered webjob.
what i'm thinking is the authentication is expiring and not auto-renewing so the triggered webjob fails and moves to an aborted state.
we have already tried setting the configuration setting for the webjob to 12 months (in seconds) and we have applied a heartbeat, service still shuts down though.
log details below;
also does anybody know what e_exp is?
that roughly equates to 3 days in seconds
{
"authorization": {
"action": "Microsoft.Web/sites/TriggeredWebJobs/run/action",
"scope": "/subscriptions/some GUID/resourceGroups/.../providers/Microsoft.Web/sites/.../TriggeredWebJobs/Processing"
},
"caller": "some GUID",
"channels": "Operation",
"claims": {
"aud": "https://management.core.windows.net/",
"iss": "https://sts.windows.net/some GUID/",
"iat": "1537204596",
"nbf": "1537204596",
"exp": "1537208496",
"aio": "numbers and letters",
"appid": "some GUID",
"appidacr": "1",
"e_exp": "262800",
"http://schemas.microsoft.com/identity/claims/identityprovider": "https://sts.windows.net/some GUID/",
"http://schemas.microsoft.com/identity/claims/objectidentifier": "some GUID",
"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier": "some GUID",
"http://schemas.microsoft.com/identity/claims/tenantid": "some GUID",
"uti": "numbers and letters",
"ver": "1.0"
},
"correlationId": "some GUID",
"description": "",
"eventDataId": "some GUID",
"eventName": {
"value": "EndRequest",
"localizedValue": "End request"
},
"category": {
"value": "Administrative",
"localizedValue": "Administrative"
},
"eventTimestamp": "2018-09-17T17:21:50.2300614Z",
"id": "/subscriptions/some GUID/resourceGroups/qcp-ghs-prd/providers/Microsoft.Web/sites/.../TriggeredWebJobs/Processing/events/some GUID/ticks/...",
"level": "Informational",
"operationId": "some GUID",
"operationName": {
"value": "Microsoft.Web/sites/TriggeredWebJobs/run/action",
"localizedValue": "Run Web Apps Triggered WebJobs"
},
"resourceGroupName": "...",
"resourceProviderName": {
"value": "Microsoft.Web",
"localizedValue": "Azure Web Sites"
},
"resourceType": {
"value": "Microsoft.Web/sites/TriggeredWebJobs",
"localizedValue": "Microsoft.Web/sites/TriggeredWebJobs"
},
"resourceId": "/subscriptions/some GUID/resourceGroups/.../providers/Microsoft.Web/sites/qcp-ghs-prd-ase/TriggeredWebJobs/Processing",
"status": {
"value": "Succeeded",
"localizedValue": "Succeeded"
},
"subStatus": {
"value": "OK",
"localizedValue": "OK (HTTP Status Code: 200)"
},
"submissionTimestamp": "2018-09-17T17:22:18.6120141Z",
"subscriptionId": "some GUID",
"properties": {
"statusCode": "OK",
"serviceRequestId": "some GUID"
},
"relatedEvents": []
}

Related

GitLab: how to get the label added date by GitLab API

I'm using GitLab 15.3.1 version and I'd like to obtain, using GitLab API, the label added date for a project issue.
This information is available from GitLab web browser interface as shown below
Is there any way to obtain that "11/10/2022 2.44pm" via API for that issue?
Thank you in advance
You can get Label events for a single Issue with the List project issue label events API.
Here's an example using this Issue:
curl --header 'Authorization: Bearer xxxTOKENxxx' https://gitlab.com/api/v4/projects/278964/issues/378378/resource_label_events | jq '.'
Response:
[
{
"id": 192875035,
"user": {
"id": 9671578,
"username": "rzwambag",
"name": "Roy Zwambag",
"state": "active",
"avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/9671578/avatar.png",
"web_url": "https://gitlab.com/rzwambag"
},
"created_at": "2022-10-19T08:51:15.420Z",
"resource_type": "Issue",
"resource_id": 117155410,
"label": {
"id": 17963221,
"name": "application performance::active",
"description": " Any issues that group::application performance has scheduled and is working on. They are in the build phase of the product development flow.",
"description_html": " Any issues that group::application performance has scheduled and is working on. They are in the build phase of the product development flow.",
"text_color": "#FFFFFF",
"color": "#69D100"
},
"action": "add"
},
{
"id": 192875036,
"user": {
"id": 9671578,
"username": "rzwambag",
"name": "Roy Zwambag",
"state": "active",
"avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/9671578/avatar.png",
"web_url": "https://gitlab.com/rzwambag"
},
"created_at": "2022-10-19T08:51:15.420Z",
"resource_type": "Issue",
"resource_id": 117155410,
"label": {
"id": 10690783,
"name": "group::application performance",
"description": "Issues belonging to the Application Performance group (formerly known as Memory) of the Enablement stage of the DevOps lifecycle. See https://about.gitlab.com/handbook/product/categories/#application-performance-group",
"description_html": "Issues belonging to the Application Performance group (formerly known as Memory) of the Enablement stage of the DevOps lifecycle. See https://about.gitlab.com/handbook/product/categories/#application-performance-group",
"text_color": "#333333",
"color": "#A8D695"
},
"action": "add"
},
{
"id": 192875037,
"user": {
"id": 9671578,
"username": "rzwambag",
"name": "Roy Zwambag",
"state": "active",
"avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/9671578/avatar.png",
"web_url": "https://gitlab.com/rzwambag"
},
"created_at": "2022-10-19T08:51:15.420Z",
"resource_type": "Issue",
"resource_id": 117155410,
"label": {
"id": 15119514,
"name": "type::maintenance",
"description": "Upkeeping efforts and catch-up corrective improvements that are not Feature nor Bugs. Read more at https://about.gitlab.com/handbook/engineering/metrics/#work-type-classification",
"description_html": "Upkeeping efforts and catch-up corrective improvements that are not Feature nor Bugs. Read more at https://about.gitlab.com/handbook/engineering/metrics/#work-type-classification",
"text_color": "#FFFFFF",
"color": "#330066"
},
"action": "add"
},
{
"id": 192875043,
"user": {
"id": 1786152,
"username": "gitlab-bot",
"name": "🤖 GitLab Bot 🤖",
"state": "active",
"avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/1786152/avatar.png",
"web_url": "https://gitlab.com/gitlab-bot"
},
"created_at": "2022-10-19T08:51:16.579Z",
"resource_type": "Issue",
"resource_id": 117155410,
"label": {
"id": 25316145,
"name": "devops::data_stores",
"description": "Issues for the Systems stage of the DevOps lifecycle (Memory, Database, Global Search, Sharding)",
"description_html": "Issues for the Systems stage of the DevOps lifecycle (Memory, Database, Global Search, Sharding)",
"text_color": "#FFFFFF",
"color": "#E44D2A"
},
"action": "add"
},
{
"id": 192875044,
"user": {
"id": 1786152,
"username": "gitlab-bot",
"name": "🤖 GitLab Bot 🤖",
"state": "active",
"avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/1786152/avatar.png",
"web_url": "https://gitlab.com/gitlab-bot"
},
"created_at": "2022-10-19T08:51:16.579Z",
"resource_type": "Issue",
"resource_id": 117155410,
"label": {
"id": 14918396,
"name": "section::enablement",
"description": "Issues related to the Enablement section",
"description_html": "Issues related to the Enablement section",
"text_color": "#FFFFFF",
"color": "#F0AD4E"
},
"action": "add"
},
{
"id": 192875250,
"user": {
"id": 9671578,
"username": "rzwambag",
"name": "Roy Zwambag",
"state": "active",
"avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/9671578/avatar.png",
"web_url": "https://gitlab.com/rzwambag"
},
"created_at": "2022-10-19T08:52:13.714Z",
"resource_type": "Issue",
"resource_id": 117155410,
"label": {
"id": 2526320,
"name": "workflow::in dev",
"description": "Issues that are actively being worked on by a developer",
"description_html": "Issues that are actively being worked on by a developer",
"text_color": "#FFFFFF",
"color": "#428BCA"
},
"action": "add"
},
{
"id": 192875320,
"user": {
"id": 9671578,
"username": "rzwambag",
"name": "Roy Zwambag",
"state": "active",
"avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/9671578/avatar.png",
"web_url": "https://gitlab.com/rzwambag"
},
"created_at": "2022-10-19T08:52:28.908Z",
"resource_type": "Issue",
"resource_id": 117155410,
"label": {
"id": 2526320,
"name": "workflow::in dev",
"description": "Issues that are actively being worked on by a developer",
"description_html": "Issues that are actively being worked on by a developer",
"text_color": "#FFFFFF",
"color": "#428BCA"
},
"action": "remove"
}
]

properties.search.query is not a valid log or metric query

I have an Azure resource manager template that quite often, but now always, give me a strange error when I try to deploy it. My gut feeling is that this started a few days ago, but I’m not sure what the reason is. The deployments most of the times end with the error message:
"error": {
"code": "properties.search.query is not a valid log or metric query.An error occurred while sending the request.",
"message": {
"lang": "en-US",
"value": "properties.search.query is not a valid log or metric query.An error occurred while sending the request."
},
"innererror": {
"stacktrace": "System.ArgumentException: properties.search.query is not a valid log or metric query.An error occurred while sending the request.\r\n at Microsoft.AppInsights.Nexus.ResourceProvider.Validation.Ensure.IsTrue(Boolean value, String message)…
This doesn’t say me much :-( I have noticed that they deployment works fine if I remove this section from my template:
{
"name": "[concat('ExceptionOccured ', variables('insightsNames')[copyIndex()])]",
"apiVersion": "2018-04-16",
"type": "Microsoft.Insights/scheduledQueryRules",
"location": "East US",
"tags": {
"[concat('hidden-link:', resourceId('microsoft.insights/components', variables('insightsNames')[copyIndex()]))]": "Resource"
},
"properties": {
"description": "Some exception has been logged.",
"enabled": "true",
"source": {
"query": "exceptions",
"authorizedResources": [],
"dataSourceId": "[resourceId('microsoft.insights/components', variables('insightsNames')[copyIndex()])]",
"queryType": "ResultCount"
},
"schedule": {
"frequencyInMinutes": 60,
"timeWindowInMinutes": 60
},
"action": {
"severity": "1",
"status": "Active",
"aznsAction": {
"actionGroup": [
"[resourceId('microsoft.insights/actionGroups', variables('alertGroupName'))]"
]
},
"trigger": {
"thresholdOperator": "GreaterThan",
"threshold": 0,
"consecutiveBreach": 1
},
"odata.type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction"
}
},
"dependsOn": [
"[resourceId('microsoft.insights/components', variables('insightsNames')[copyIndex()])]",
"[resourceId('microsoft.insights/actionGroups', variables('alertGroupName'))]"
],
"copy": {
"name": "insightscopy",
"count": "[length(variables('insightsNames'))]"
},
"condition": "[greater(length(parameters('alertEmail')), 0)]"
},
This is a loop to setup alerts for some application insights projects. Is there some error in this section?
I started getting this yesterday too. Same alerting structure, same error. I tried ~30mins later and it worked fine. Not what you wanted to hear, but I couldnt't find the reason why either.

Internal server error while deploying an arm template to azure

I am deploying an new metric alert to Azure with an ARM template.
I am following the exact same way of Microsoft doc.
With the only change that I deploy just 1 metric to an Automation account and not to an storage account
Template file
"variables": {
"criterion1": "[array(parameters('criterion1'))]",
"criteria": "[concat(variables('criterion1'))]"
},
"resources": [
{
"name": "[parameters('alertName')]",
"type": "Microsoft.Insights/metricAlerts",
"location": "global",
"apiVersion": "2018-03-01",
"tags": {},
"properties": {
"description": "[parameters('alertDescription')]",
"severity": "[parameters('alertSeverity')]",
"enabled": "[parameters('isEnabled')]",
"scopes": [
"[parameters('resourceId')]"
],
"evaluationFrequency": "[parameters('evaluationFrequency')]",
"windowSize": "[parameters('windowSize')]",
"criteria": {
"odata.type": "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria",
"allOf": "[variables('criteria')]"
},
"actions": [
{}
]
}
}
]
parameter file
"criterion1": {
"value": {
"name": "1st criterion",
"metricName": "TotalJob",
"dimensions": [
{
"name": "Status",
"operator": "Include",
"values": [
"Failed"
]
},
{
"name": "Status",
"operator": "Include",
"values": [
"Completed"
]
}
],
"operator": "GreaterThan",
"threshold": "5",
"timeAggregation": "Total"
}
}
But when i deploy this to Azure my Powershell command get stuck without giving any errors even with -DeploymentDebugLogLevel All parameter on it. In Azure portal I got the error "Internal server error" without any context. The json log gives me following logs:
{
"authorization": {
"action": "Microsoft.Insights/metricAlerts/write",
"scope": "/subscriptions/xxxxxx/resourcegroups/bilalachahbar/providers/Microsoft.Insights/metricAlerts/New Metric Alert"
},
"caller": "xxxx",
"channels": "Operation",
"claims": {
"aud": "https://management.azure.com/",
"iss": "https://sts.windows.net/17b5a1d-057c-4ac-a15a-08758f7a7064/",
"iat": "15596014",
"nbf": "15596014",
"exp": "15599914",
"aio": "42RgYDgypS7rfe/Of0l1R+q3TbCgA=",
"appid": "0e4a093a-c6fd-4fba-b4e5-f07ba479f203",
"appidacr": "1",
"http://schemas.microsoft.com/identity/claims/identityprovider": "https://sts.windows.net/17xxxxxc5-a15a-08758f7a7064/",
"http://schemas.microsoft.com/identity/claims/objectidentifier": "a3db39bf-8c65-4b84-b049-d7af99bfb3e",
"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier": "a3db39bf-8c65-4b84-b049-d7af99bfb3e",
"http://schemas.microsoft.com/identity/claims/tenantid": "1xxxxxx057c-4ac5-a15a-087f7a7064",
"uti": "SCkIk235EScz0Hst20AA",
"ver": "1.0"
},
"correlationId": "8013b5-9788-41ed-afcf-0dbd8276349c",
"description": "",
"eventDataId": "e39509-0837-4435-af7a-02ba1462055f",
"eventName": {
"value": "EndRequest",
"localizedValue": "End request"
},
"category": {
"value": "Administrative",
"localizedValue": "Administrative"
},
"eventTimestamp": "2018-12-27T14:11:48.1462445Z",
"id": "/subscriptions/xxxxx/resourcegroups/xxxxxx/providers/Microsoft.Insights/metricAlerts/New+Metric+Alert/events/e39509-0837-4435-af7a-02ba1462055f/ticks/815167081462445",
"level": "Error",
"operationId": "e390389-ecc1-4a2-8c2-d94ea635cb",
"operationName": {
"value": "Microsoft.Insights/metricAlerts/write",
"localizedValue": "Create or update metric alert"
},
"resourceGroupName": "xxxxx",
"resourceProviderName": {
"value": "Microsoft.Insights",
"localizedValue": "Microsoft Insights"
},
"resourceType": {
"value": "Microsoft.Insights/metricAlerts",
"localizedValue": "Microsoft.Insights/metricAlerts"
},
"resourceId": "/subscriptions/xxxxxx/resourcegroups/bilalachahbar/providers/Microsoft.Insights/metricAlerts/New Metric Alert",
"status": {
"value": "Failed",
"localizedValue": "Failed"
},
"subStatus": {
"value": "InternalServerError",
"localizedValue": "Internal Server Error (HTTP Status Code: 500)"
},
"submissionTimestamp": "2018-12-27T14:12:05.0719055Z",
"subscriptionId": "xxxxxx",
"properties": {
"statusCode": "InternalServerError",
"serviceRequestId": "8613b5-9788-41d-afcf-0dbd27639c",
"statusMessage": "{\"error\":{\"code\":\"InternalServerError\",\"message\":\"The server encountered an internal error, please retry. If the problem persists, contact support.\"}}"
},
"relatedEvents": []
}
An other stack overflow question got an sort of same question.
He got the problem when using an resource that is not supported anymore but I guess that is not the case with me because the official MS documentation is from september this year. I got the same issues when I use the exact same arm template that is provided in the documentation
I found my own error
Action groups are required when you want to deploy metric alerts.
As you can see in the documentation they provide an action ID, and I didn't. As I thought that it wasn't necessary it actually is.
I know this is obvious but unfortunately I did not saw this in the documentation or in the error. After some debugging and looking in the Resource Explorer I've noticed this.
SO future reader I hope this will solve your issue
One little feedback is that there is no depends on value ATM so I can not create an action group resource first in the same arm template

Update Azure AD App appRoles through MS Graph Explorer

I am trying to update AppRoles of my Azure AD app through MS Graph Explorer. The App is for setup SSO with our AWS account.
The URI looks like below. GET query returns all the properties of the Service Principal correctly.
https://graph.microsoft.com/beta/servicePrincipals/2141b14a-096a-4f26-a73f-4175a4f475f7
But when trying to "PATCH" the section of "appRoles", I received the error below:
{
"error": {
"code": "Request_BadRequest",
"message": "One or more properties on the service principal does not match the application object.",
"innerError": {
"request-id": "0408c2a3-1f1c-4dd6-aacf-6c2c1cca8b98",
"date": "2018-08-10T01:13:40"
}
}
}
The Request Body is as below (The code is slightly modified for masking)
{ "appRoles": [
{
"allowedMemberTypes": [
"User"
],
"displayName": "AWS Developers",
"id": "7dfd756e-8c17-4472-b2b7-38c17fc5de79",
"isEnabled": true,
"description": "Developers",
"value": "arn:aws:iam::12345678910:role/developers-SAML-AzureAD,arn:aws:iam::12345678910:saml-provider/AzureAD"
},
{
"allowedMemberTypes": [
"User"
],
"displayName": "AWS Admins",
"id": "7dfd756e-8c27-4412-b1b7-38c17fc1de83",
"isEnabled": true,
"description": "AWS-Admins-SAML-AzureAD",
"value": "arn:aws:iam::12345678910:role/Admins-SAML-AzureAD,arn:aws:iam::12345678910:saml-provider/AzureAD"
},
{
"allowedMemberTypes": [
"User"
],
"displayName": "IT MGMT",
"id": "7dfd756e-8c17-4172-b1b7-38c11fc1de81",
"isEnabled": true,
"description": "ITS-MGMT-SAML-AzureAD",
"value": "arn:aws:iam::12345678910:role/ITMGMT-SAML-AzureAD,arn:aws:iam::12345678910:saml-provider/AzureAD"
},
{
"allowedMemberTypes": [
"User"
],
"displayName": "S3 Bucket Admins",
"id": "7dfd756e-8c17-4412-b1b1-31c17fc1de18",
"isEnabled": true,
"description": "AWS-S3-Admins-SAML-AzureAD",
"value": "arn:aws:iam::12345678910:role/AWS-S3-Admins-SAML-AzureAD,arn:aws:iam::12345678910:saml-provider/AzureAD"
},
{
"allowedMemberTypes": [
"User"
],
"displayName": "EC2 Admins",
"id": "7d1d756e-8c27-4471-12b7-38c17fc5de78",
"isEnabled": true,
"description": "AWS-EC2-Admins-SAML-AzureAD",
"value": "arn:aws:iam::12345678910:role/AWS-EC2Admins-SAML-AzureAD,arn:aws:iam::12345678910:saml-provider/AzureAD"
},
{
"allowedMemberTypes": [
"User"
],
"displayName": "Network Admins",
"id": "1dfd756e-8c27-4472-b2b7-38c11fc5de67",
"isEnabled": true,
"description": "AWS-Network-Admins-SAML-AzureAD",
"value": "arn:aws:iam::12345678910:role/Network-Admins-SAML-AzureAD,arn:aws:iam::12345678910:saml-provider/AzureAD"
},
{
"allowedMemberTypes": [
"User"
],
"displayName": "msiam_access",
"id": "7dfd756e-8c21-1471-b1b7-11c27fc5de5e",
"isEnabled": true,
"description": "msiam_access",
"value": null
}]}
I validated the JSON codes but MS Graph Explorer still tells me things are missing.
I tried to run the PATCH query with all properties of the Azure AD App, but received the same error.
Did anyone encounter this before? What is your fix?

Azure stream anaytics with PowerBi Fails

I have a stream anaytics job which gets data from IoT hub and sends it to PowerBi and azure data lake. Writing data azure data lake works alone perfectly but when I try to stream data to powerbi my steam analytics job fails after writing first out put and I am getting following error log.
{
"channels": "Operation",
"correlationId": "ff2593c9-cda2-498c-8e1f-6f13260ae32f",
"description": "Stream Analytics job status changed for last user action [Start job 'AVLStreamAnalytics'].",
"eventDataId": "953665c1-aec0-482d-852c-fdf3160cd6fb",
"eventName": {
"value": "Start job 'AVLStreamAnalytics'",
"localizedValue": "Start job 'AVLStreamAnalytics'"
},
"category": {
"value": "Administrative",
"localizedValue": "Administrative"
},
"eventTimestamp": "2017-07-13T16:35:46.2226177Z",
"id": "/subscriptions/161fc731-59a3-4173-9cf5-866b3188abf3/resourceGroups/AVLPOC/providers/Microsoft.StreamAnalytics/streamingjobs/AVLStreamAnalytics/events/953665c1-aec0-482d-852c-fdf3160cd6fb/ticks/636355605462226177",
"level": "Error",
"operationId": "2e5ed092-bb88-4dde-8e9f-2a9c0adc1f78",
"operationName": {
"value": "Start job 'AVLStreamAnalytics'",
"localizedValue": "Start job 'AVLStreamAnalytics'"
},
"resourceGroupName": "AVLPOC",
"resourceProviderName": {
"value": "Microsoft.StreamAnalytics",
"localizedValue": "Microsoft.StreamAnalytics"
},
"resourceType": {
"value": "Microsoft.StreamAnalytics/streamingjobs",
"localizedValue": "Microsoft.StreamAnalytics/streamingjobs"
},
"resourceId": "/subscriptions/161fc731-59a3-4173-9cf5-866b3188abf3/resourceGroups/AVLPOC/providers/Microsoft.StreamAnalytics/streamingjobs/AVLStreamAnalytics",
"status": {
"value": "Failed",
"localizedValue": "Failed"
},
"subStatus": {
"value": "",
"localizedValue": ""
},
"submissionTimestamp": "2017-07-13T16:35:59.7904001Z",
"subscriptionId": "161fc731-59a3-4173-9cf5-866b3188abf3",
"properties": {
"JobFailedMessage": "The streaming job failed.",
"JobId": "ff2593c9-cda2-498c-8e1f-6f13260ae32f",
"JobRunId": "d43b6623-3f9a-4e88-8c7d-21f8788e5cdd",
"JobRunCreatedDateTime": "2017-07-13 16:31:17Z",
"JobRunLastUpdateDateTime": "2017-07-13 16:35:46Z",
"JobRunStatus": "Failed",
"JobContentVersion": "1.10",
"JobFrameworkVersion": "1.2.61907.22"
},
"relatedEvents": []
}
Any ideas why job fails would be perfect. I am quite sure that I ma within limits of power bi app.
You need to authorize the Power BI subscription from within Stream Analytics.

Resources