How to check domain is verified using Google Analytics API? - google-analytics

I have used analytics.read in order to get user's sites and Google API response is:
{
"kind": "analytics#accountSummaries",
"username": "user#gmail.com",
"totalResults": 1,
"startIndex": 1,
"itemsPerPage": 1000,
"items": [
{
"id": "92159597",
"kind": "analytics#accountSummary",
"name": "MyNewDomain",
"webProperties": [
{
"kind": "analytics#webPropertySummary",
"id": "UA-92159597-1",
"name": "MyNewDomain",
"internalWebPropertyId": "236529827",
"level": "STANDARD",
"websiteUrl": "http://www.example.com",
"profiles": [
{
"kind": "analytics#profileSummary",
"id": "140745434",
"name": "All Web Site Data",
"type": "WEB"
}
]
}
]
}
]
}
Why there is no property related to domain status? How should I check whether domain is verified or not?
I tried to use siteverification scope for Google Verification API, it has the response that I need and it returns the list of verified domains but it has a scope of managing domains, so no one will actually grant access to our application in order to manage their domains and verify/un-verify domains.
Sample response:
{
"id": "string",
"site": {
"type": "string",
"identifier": "string"
},
"owners": [
"string"
]
}
How can I use analytics.read to get verified domains not unverified websites?

Related

Landing Zone Automation - Disable Owner requirement from ESLZ ARM template

I am trying to deploy ESLZ Arm template in this link "https://github.com/Azure/Enterprise-Scale/blob/main/docs/reference/adventureworks/README.md" and it requires owner permission to do that. Is it possible to remove the Global Admin and/or Owner requirement and run the template using contributor role
I created a management group under tenant root and assigned contributor role. Now I'm trying to create additional management groups using below ARM template
{
"$schema": "https://schema.management.azure.com/schemas/2019-08-01/tenantDeploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"topLevelManagementGroupPrefix": {
"type": "string",
"metadata": {
"description": "Provide prefix for the management group structure."
}
},
"platformMgs": {
"type": "array",
"defaultValue": [
"management",
"connectivity",
"identity"
],
"metadata": {
"description": "Management groups for platform specific purposes, such as management, networking, identity etc."
}
},
"landingZoneMgs": {
"type": "array",
"defaultValue": [
"online",
"corp"
],
"metadata": {
"description": "These are the landing zone management groups."
}
}
},
"variables": {
"enterpriseScaleManagementGroups": {
"ESLZ": "[concat(parameters('topLevelManagementGroupPrefix'))]",
"platform": "[concat(parameters('topLevelManagementGroupPrefix'), '-', 'platform')]"
}
},
"resources": [
{
// Create management group for platform management groups
"type": "Microsoft.Management/managementGroups",
"apiVersion": "2020-05-01",
"scope": "/",
"name": "[variables('enterpriseScaleManagementGroups').platform]",
"properties": {
"displayName": "[variables('enterpriseScaleManagementGroups').platform]",
"details": {
"parent": {
"id": "[tenantResourceId('Microsoft.Management/managementGroups/', parameters('topLevelManagementGroupPrefix'))]"
}
}
}
}
],
"outputs": {}
}
While deploying the template i'm getting permission error, however able to create management group manually. Am I missing something in this template. Any help is really appreciated
You should be able to be able to deploy the template with contributor permissions at the tenant level... You need an owner/userAccessAdmin/global admin to grant those permissions.

TVRP API Authorization

I have successfully created an Bearer Token and i would like to request data from the Tour Planning/VRP API. However, i always get the following response: { "error": "Forbidden", "error_description": "These credentials do not authorize access" }
If i try to make the request with the APIKey instead of the Bearer Token, I don't get autenthification.
Authorization by token and apikey work fine for me, I have used it at the same time in other methods and it works fine. But none of these two authorization methods works:
POST https://vrp.api.here.com/v1/problems
Authorization: Bearer <My_Token>
or
POST https://vrp.api.here.com/v1/problems?apikey=My_ApiKey
with this Body:
{
"plan": {
"jobs": [
{
"id": "myJob",
"places": {
"delivery": {
"location": {"lat": 52.46642, "lng": 13.28124},
"times": [["2019-07-04T10:00:00.000Z","2019-07-04T12:00:00.000Z"]],
"duration": 180
}
},
"demand": [1]
}
]
},
"fleet": {
"types": [
{
"id": "myVehicle",
"profile": "normal_car",
"costs": {
"distance": 0.0002,
"time": 0.004806,
"fixed": 22
},
"shifts": [{
"start": {
"time": "2019-07-04T09:00:00Z",
"location": {"lat": 52.52568, "lng": 13.45345}
},
"end": {
"time": "2019-07-04T18:00:00Z",
"location": {"lat": 52.52568, "lng": 13.45345}
}
}],
"limits": {
"maxDistance": 300000,
"shiftTime": 28800
},
"capacity": [10],
"amount": 1
}
],
"profiles": [{
"name": "normal_car",
"type": "car",
"departureTime": "2019-07-04T09:15:00Z"
}]
}
}
Thanks Jose
You are probably using your Freemium account, which does not include access to the Tour Planning API at this point. We are working on an update for the developer portal that will make it more clear which APIs are included. If you need access please use the contact us form on the developer portal to reach out to a HERE representative.

Does Azure portal using undocumented ARM features to deploy App Services?

I'm looking at template generated for adding Web App which is generated by Azure portal. I chose .NET core as runtime and it's passed to metadata field in generated ARM template below with a value of dotnetcore. The end result is resource created in Azure with all the stuff you expect from web app. I don't see this field being documented and or explanation how it's being used. Is it some internal know-how or how this process works?
"resources": [
{
"apiVersion": "2018-11-01",
"name": "[parameters('name')]",
"type": "Microsoft.Web/sites",
"location": "[parameters('location')]",
"tags": {},
"dependsOn": [],
"properties": {
"name": "[parameters('name')]",
"siteConfig": {
"appSettings": [
{
"name": "ANCM_ADDITIONAL_ERROR_PAGE_LINK",
"value": "[parameters('errorLink')]"
}
],
"metadata": [
{
"name": "CURRENT_STACK",
"value": "[parameters('currentStack')]"
}
],
"phpVersion": "[parameters('phpVersion')]",
"alwaysOn": "[parameters('alwaysOn')]"
},
"serverFarmId": "[concat('/subscriptions/', parameters('subscriptionId'),'/resourcegroups/', parameters('serverFarmResourceGroup'), '/providers/Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]",
"hostingEnvironment": "[parameters('hostingEnvironment')]",
"clientAffinityEnabled": true
}
}
]

Getting all profiles from Google Analytics API

I'm trying to get all profiles using ~all option with this endpoint
https://www.googleapis.com/analytics/v3/management/accounts/~all/webproperties/~all/profiles
It doesn't return all profiles due to ~all for accounts. If I include account ID instead of ~all, then it returns profiles based on that account id - which are missing when used with ~all option.
https://www.googleapis.com/analytics/v3/management/accounts/89478503/webproperties/~all/profiles
Am I doing something wrong or is this GA API bug?
I sugst you look into using account summaries list
GET https://www.googleapis.com/analytics/v3/management/accountSummaries
This will return all the account information for a user.
{
"kind": "analytics#accountSummaries",
"username": "me#gmail.com",
"totalResults": 15,
"startIndex": 1,
"itemsPerPage": 1000,
"items": [
{
"id": "59183475",
"kind": "analytics#accountSummary",
"name": "Cube Analytics",
"webProperties": [
{
"kind": "analytics#webPropertySummary",
"id": "UA-59183475-1",
"name": "Cube Analytics",
"internalWebPropertyId": "93305066",
"level": "STANDARD",
"websiteUrl": "XXXXXXX",
"profiles": [
{
"kind": "analytics#profileSummary",
"id": "115455750",
"name": "Alaternate",
"type": "WEB"
},
{
"kind": "analytics#profileSummary",
"id": "97191919",
"name": "All Web Site Data",
"type": "WEB"
},
{
"kind": "analytics#profileSummary",
"id": "178538323",
"name": "MobileView",
"type": "APP"
}
]
}, ]
}
By using this call you should only need to make one call and get all of the information back.

Internal server error when deploying ARM Template

I am deploying an arm template that contains the following resources
Microsoft.Storage/storageAccount
Microsoft.Sql/servers
Microsoft.Sql/servers/auditPolicies
Now everything worked until I started changing the values for the auditPolicies object. Here are the steps I took until the InternalServerError occurred.
Added the auditState property and set its value to Disabled. Deployment Successful.
Changed the auditState property to Enabled. Deployment failed. Error states that the storageAccountName is required.
Added storageAccountName and set its value to the name of the storage account. Deployment failed. Error states that storageAccountKey.
Added storageAccountKey and set its value to key1 of the storage account's keys object. Deployment failed. Internal Server Error - "An Error has occurred while saving Auditing settings, please try again later". Additionally, the errors cause the deployment to run indefinitely. Though I am not concerned about that aspect.
The following is the complete template.
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"app-name-prefix": {
"type": "string",
"minLength": 1
},
"app-locations": {
"type": "array",
"minLength": 1
},
"app-friendly-names": {
"type": "array",
"minLength": 1
},
"db-user-admin-username": {
"type": "securestring"
},
"db-user-admin-password": {
"type": "securestring"
},
"database-audit-enabled": {
"defaultValue": "Enabled",
"allowedValues": [
"Enabled",
"Disabled"
],
"type": "string"
},
"storage-kind": {
"defaultValue": "BlobStorage",
"allowedValues": [
"StorageV2",
"BlobStorage"
],
"type": "string"
},
"storage-sku": {
"defaultValue": "Standard_LRS",
"allowedValues": [
"Standard_LRS",
"Standard_ZRS",
"Standard_GRS",
"Standard_RAGRS",
"Premium_LRS"
],
"type": "string"
}
},
"variables": {
"db-service-name": "[concat(parameters('app-name-prefix'), '-database-service-')]",
"storage-name": "[concat(toLower(parameters('app-name-prefix')), 'auditstorage')]"
},
"resources": [
{
"name": "[concat(variables('storage-name'), parameters('app-friendly-names')[copyIndex()])]",
"type": "Microsoft.Storage/storageAccounts",
"sku": {
"name": "[parameters('storage-sku')]"
},
"kind": "[parameters('storage-kind')]",
"apiVersion": "2018-02-01",
"location": "[parameters('app-locations')[copyIndex()]]",
"copy": {
"count": "[length(parameters('app-locations'))]",
"name": "storageCopy"
},
"properties": {
"supportsHttpsTrafficOnly": true,
"accessTier": "Hot",
"encryption": {
"services": {
"blob": {
"enabled": true
},
"file": {
"enabled": true
}
},
"keySource": "Microsoft.Storage"
}
}
},
{
"type": "Microsoft.Sql/servers",
"name": "[concat(variables('db-service-name'), parameters('app-friendly-names')[copyIndex()])]",
"apiVersion": "2014-04-01",
"location": "[parameters('app-locations')[copyIndex()]]",
"copy": {
"name": "databaseServiceCopy",
"count": "[length(parameters('app-locations'))]"
},
"properties": {
"administratorLogin": "[parameters('db-user-admin-username')]",
"administratorLoginPassword": "[parameters('db-user-admin-password')]",
"version": "12.0"
},
"resources": [
{
"type": "auditingPolicies",
"name": "Default",
"apiVersion": "2014-04-01",
"location": "[parameters('app-locations')[copyIndex()]]",
"properties": {
"auditingState": "[parameters('database-audit-enabled')]",
"storageAccountName": "[concat(variables('storage-name'), parameters('app-friendly-names')[copyIndex()])]",
"storageAccountKey": "[listKeys(concat(variables('storage-name'), parameters('app-friendly-names')[copyIndex()]), '2018-02-01').keys[0].value]"
},
"dependsOn": [
"[resourceId('Microsoft.Sql/servers', concat(variables('db-service-name'), parameters('app-friendly-names')[copyIndex()]))]",
"storageCopy"
]
}
]
}
]
}
What am I missing that will help resolve this issue? What do I need to do to stop this internal server error?
I have added the complete template as was requested by #Pete
I have found the answer after connecting with Azure Support.
The resource type: Microsoft.Sql/servers/auditingPolicies is no longer supported and in the next few weeks Azure Resource Manager will no longer support this completely.
This resource type refers directly to table auditing, which has been reported as being deprecated for blob auditing. Though the documentation at this time does not directly report it. The docs will be updated in the coming days after this post, by the owners.
To enable the auditing you need to use the Microsoft.Sql/servers/auditingSettings object. The documentation on this is coming and until it does you will be directed to documentation for the database version of this resource type Microsoft.Sql/servers/databases/auditingSettings.
Auditing settings work much like the Auto-Tuning advisors. You can set either server or database level settings. The server settings will be inherited by the database if the database has not been configured directly.
This is a sample of the auditingSettings object that I use instead of the auditingPolicies object above. It is nested just the same.
{
"apiVersion": "2017-03-01-preview",
"type": "auditingSettings",
"name": "DefaultAuditingSettings",
"dependsOn": [
"[resourceId('Microsoft.Sql/servers', concat(variables('db-service-name'), parameters('app-friendly-names')[copyIndex()]))]",
"storageCopy"
],
"properties": {
"state": "Enabled",
"storageEndpoint": "[reference(concat('Microsoft.Storage/storageAccounts', '/', variables('storage-name'), parameters('app-friendly-names')[copyIndex()]), '2018-02-01').primaryEndpoints.blob]",
"storageAccountAccessKey": "[listKeys(concat(variables('storage-name'), parameters('app-friendly-names')[copyIndex()]), '2018-02-01').keys[0].value]",
"storageAccountSubscriptionId": "[subscription().subscriptionId]",
"isStorageSecondaryKeyInUse": false,
"retentionDays": "30"
}
}

Resources